Dev log · · v0.36.0-water

A sea that moves: new water dynamics

The water is now a simulated ocean: wind-driven waves in three layers, long swells that arrive in sets, and a boat that rides them, pitching over crests, rolling in a beam sea and slamming in a head sea. Still on a test branch, v0.36.0-water.

  • water
  • physics
  • work in progress

Until now the sea in Fjord was a sum of 32 smooth waves. It looked fine from the deck on a nice day, but in a blow the boat sat on top of it like a toy on a table. This week we rebuilt it around how the sea actually moves.

What changed

  • A simulated ocean. The surface comes from a wind-driven wave spectrum, computed every frame on the graphics card in three layers: big waves about 490 m across, medium ones, and short chop. The crests are sharp and the troughs are broad, and the pattern never repeats.
  • Swell that comes in sets. Long swell rolls in under the wind waves and builds in groups, so every few minutes a bigger set arrives. When the weather changes, the sea builds up or lies down over a few seconds instead of snapping.
  • The boat rides it. The same sea runs on the processor for the physics, so the boat feels exactly the waves you see. It samples the water at 66 points along the hull: it lifts its bow over a crest, surfs down the face of a wave, rolls in a beam sea and slams when it punches into one.
  • Numbers from our test run (Tadoussac, close reach): in 18 knots the waves reach 1.35 m and the boat pitches up to 11 degrees; in a 30-knot storm they reach 3.3 m and the bow slams almost 40 times in a few minutes. In a calm, nothing moves at all, as it should.

Still to do

From far away, the storm still looks more like busy chop than big rolling swells, so the shading needs work. The boat also heels too much in strong wind even when reefed, which is a sail problem, not a water one. Spray off the bow is next.

This is on a test branch for now, so it isn’t in the main game yet. It was inspired by how the sea moves in games like Sea of Thieves, built from our own simulation.