Storm Breakers : an ocean engine specialized in simulating rough seas, designed for gameplay.
For Unity 2021.3+, in URP (maybe upgradable to HDRP)
About me
Hi everyone, I’m a French engineer, passionate about seas, waves and boats. I always wanted to play video games with good waves, but was only disappointed with existing ones. So I decided to do something about it ! After observing for years waves in real condition (doing body surfing and sea kayaking) and learning about the science of waves (I have a brother who did a thesis about sea waves), I eventually gathered enough knowledge to write a new ocean model that will suits my desires, and I hope you’ll like it too !
It will be a customizable asset instead of a game to reduce ambition, still I’m not a pro game developer, I’m basically learning Unity through this full time project. So you can’t expect something as good as Crest for example. But I intend to include in this asset something that I couldn’t find anywhere else : realistic waves designed to be playable, allowing to create new game mechanics (storm survival, extreme surfing). I’ll get back to this major point later in the post.
By the way, if you are interested in sharing the adventure with me, I am open minded to partnership !
About the asset
This asset is called Storm Breakers because it is suited to render and simulate physics with breaking waves in stormy deep waters. This will also be able to render a calm ocean, but it might not be as good as existing assets. This asset will not be suited to render and simulate breaking waves on the shoreline as they are very different waves (this I intend to code it later if I get successful enough with this asset).
This asset is not an accurate scientific ocean model at all, but it is largely inspired by real world physics. I’m using science only to reduce tweaking, and I simplify most of the scientific models I need for performance purposes.
I’m designing this asset for gameplay purposes mainly, not that much for high definition rendering as I have no good graphic skills at my disposal.
In this thread I will explain all the things that I feel are important for both the game creators and the players, including some explanation on my ocean model. Basically the thread post will consist of the documentation of the asset. I will also post about the update in the development of the asset. I will be open minded to suggestions and criticism, especially for Unity usage as I’m not a professional !
Feature list
The main features that I plan to include in the first release :
-
Vertex shader to animate the ocean with realistic and playable waves. (completed)
-
Descent surface shader. (to be done)
-
Extended ocean controller. (done)
-
Simple ocean controller. (to be done)
-
Buoyancy interaction with the ocean. (almost completed)
-
Particles system to simulate breaking wave and make dynamic texturing on the water. (to be polished)
-
Particles systems for the interaction of object in water, make dynamic texturing on the water. (to be polished)
-
A hull generator so you can tweak the behavior of a boat through realistic physic. (to be done)
-
A camera controller that you can tweak the motion sickness. (to be done)
-
A simple gameplay I’ve been thinking about so you can directly play with the asset. (to be done)
Then if I get successful enough, I plan to code some additional features :
-
Baked wave system to improve performance.
-
Underwater camera simple effect.
-
Procedural water sound. (I have some ideas how to do it.) Do you feel it should be a main feature ?
-
Rogue waves (you will want it for your game, I know it ^^ ) and ocean local tweaking (for example the effect of a reef).
Gameplay
So I’m making this asset for gameplay purposes, after all we are here to make games right ?
There are many mechanics in the real ocean that inspired me for game mechanics. The objective of this asset is to share them with you.
First of all, even if the stormy ocean looks like complete chaos, waves are actually predictable, yet not obvious. Once the patterns based on physical phenomena that I will explain clearly here and in the documentation are learnt, the player can read the ocean to anticipate the waves. This is more difficult with the Gerstener model because it makes too many waves overlapping in too many directions.
Waves can be like enemies in your game. That’s what we expect from a 15m-high breaking wave : danger. And I will make sure that a boat will capsize if steering badly onto the breaking waves.
Waves can also be your friends, that would be especially true if your game consists of surfing waves. This is possible in this model because waves exist for a time long enough to be rode with a boat. Adding this to the fact you can predict them, but also taking in account the fact that it is daring to surf big waves, this should make for a hell of an extreme surfing gameplay.
Last but not least, most of the gameplay would be based on the satisfaction of seeing tons of water particles, providing the same experience to the video watchers of ships in storms. I hope I’ll do something good enough for your eyes !
Global architecture
For the global architecture of the asset, I choose to copy the math of the ocean model 3 time: one in C#, one in shader graph and one in VFX graph. I know this is bad programming practice, but this also leads to a very forward computation, which is easier for newbie like me, and I think it is more optimized.
All the 3 codes are a bit different in some points as to how they manage breaking, but are otherwise rigorously exactly the same for the rest so they can be synchronized without any callback. It means for example to handwrite a random function and make a fully deterministic ocean model.
The ocean model math is computed a lot. So any change on the ocean model math will have drastic change in the overall performance. At first, I’m coding everything analytically as it helps me move fast without having to learn baking techniques. Then when the overall asset will be settled, I will go by baking texture to improve performance and allow more complex game mechanics on top of the asset.
Project state
Today I’ve reached the milestone of the proof of concept, meaning I’ve successfully implemented the most innovative features with decent performance : custom ocean model, breaking waves VFX, dynamic water texturing using both VFX graph and shader graph (this is full of Unity latest experimental features), and realistic buoyancy physics (which needed to be coded my way to better integrate the rough sea phenomena).
Here are some screen shot :
The next steps in the project - after receiving your feedback - will consist of less innovative but more rigorous coding (not my best). I will be full time on it.
That’s it for today, next time I will talk a bit about my ocean model !