DEV LOG /

The story so far, part 1: starting over

Veiled Depths began a second time, as a fresh project. What the first prototype taught us, why the ground came before the sea, and what the first burst of work put in the game.

This dev log tells the story of the game in order, from the first line of code to the build we play today. This is part 1: the start, and the first burst of work.

A second start

Veiled Depths is the second try. A first prototype ran for about three months and taught us most by what broke. Three things stood out. The boat's pitch was only right while she was heading north, because the physics read her angles the wrong way. The ocean came from a ready-made addon whose surface glitched when the camera crossed it. And the terrain did not agree with itself: what you collided with was not what was drawn, and the boat could dive deeper than the sea floor went.

So the project started again as a fresh one, keeping little more than some models and a map of the world, with those lessons written down first. Every number about the world would live in one place, so the sea floor and the boat could never disagree about how deep the sea is. And the work would go in a fixed order: terrain, then the ocean, then the cameras, then the physics, then the game. Nothing moved on until it could be seen working.

The ground came first

The first thing built was land and sea floor, with nothing else on screen but a flying camera. A heightmap became terrain in one-kilometre chunks, with four levels of detail and skirts along their edges to hide the seams. Coloured by height, from a blue sea floor up to snow, it was drawn from both sides so it could be seen from under water.

Within days the whole Earth was in it: a world map cut into 72 tiles of 30 degrees each, loaded and dropped as the camera moved. That grid is still how the world streams today, though the depths in it have since been replaced by far better survey data.

The tactical chart off Malta, with the boat and two contacts
The tactical chart off Malta, in today's build.

Then the sea

The plan said to build our own ocean. To get a sea on screen quickly, the first one was borrowed after all: an open-source FFT wave simulation, patched so it would run on a Mac. Under it went the first underwater pass: fog and colour that change with depth, caustics, light shafts, drifting particles, and water running off the lens when the camera surfaced. Our own ocean replaced the borrowed one later, as the plan intended.

The submarine seen from below the surface
Below the surface, in today's build.

The boat that kept flipping

Next came the physics. The first version used the engine's rigid-body physics, and it fought us. Speed did not hold from one frame to the next, and in dives the boat flipped and rolled over. There were two causes. Her velocity was being applied twice, once by the engine and once by our code. And her orientation was turned a little more each frame, so small rounding errors added up until she tumbled.

The fix was to take the boat out of the engine's physics altogether. Heading and pitch became two plain numbers, and her orientation is rebuilt from them, from scratch, every frame. Nothing accumulates, so nothing drifts. Her handling has been rewritten since, but that rule still holds.

A chart of a dive to 150 metres: depth, pitch, speed, vertical speed, ballast and planes over five minutes
From the physics test bench of those weeks: a dive to 150 m.

The stations, one after another

With the ground, the sea and a boat that stayed upright, the rest came fast. Within days the game had first versions of most of what you know:

  • Sonar: an operator's station with a waterfall, a towed array, silent running, an acoustic database to classify contacts by their sound, and target motion analysis.
  • Masts: radar, and an ESM mast that hears other ships' radars.
  • Weapons: torpedoes steered on the wire or homing on their own, a fire control station, decoys and noisemakers.
  • Damage: five compartments, and flooding that spreads.
  • Others at sea: enemy ships that patrol, close in or turn away, aircraft on patrol, merchant ships on shipping lanes between ports, and 91 real places, from naval bases to straits.
  • A crew: an instrument panel, crew logs and, by the end, voices.

The first mission was written then too: Silent Approach, in which you find an enemy surface group without being detected. And the first page of what is now the field manual went up the same week.

All of it has been rebuilt since, most of it more than once, but this is where the game took its shape.

The sonar station with its waterfall display
The sonar station, in today's build.

Then it went quiet

At the end of that burst the terrain was switched off for the time being, and the project went quiet for months. Part 2 is about how it came back: the terrain on again, and an ocean of our own.

To follow along, check back here, add the RSS feed to your reader, or join us on Discord.

See you at periscope depth.