Going Upon the Account

“Going upon the account” is what it was called when people people decided to embark on the dangerous journey of joining up with a pirate crew during the Golden Age of Piracy. Most of those who did it had been experienced sailors who had been successful privateers or soldiers during the wars that preceded the era, but found themselves unemployed and cast off without much in the way of a soft landing. Merchant captains were notoriously brutal and paid very poorly, and some decided they’d rather live a short life, and a merry one.

Well we’re in a rough economy again, worse than at any point in my employed life, and unfortunately my former employer seemingly hasn’t fared as well as we’d all hoped, and a significant number of us have been laid off. I feel fortunate to be an engineer with 12 years of experience, rather than one just starting out, as there are at least job listings I’m qualified for, and I’m certainly applying. But it’s a rough job market and I’m certainly being met with an awful lot of silence for my efforts so far.

Given that I’ve suddenly found myself with a lot of free time, and am realizing that too much time to ruminate on negative emotions isn’t good for me, I’ve decided to start building my first commercial game. It’s as of yet, unnamed, but it’s going to be a multiplayer, procedurally-generated sandbox game that’s got a mixture of city-building and pirate-adventuring in it. More specifics are to be worked out, but it’s the sort of game I’ve always wanted. A cute, relaxing, fun pirate game to play with my friends.

Someday, if I’m lucky maybe this sort of thing can be my full-time job. If this job market continues to disappoint, maybe of necessity that time is now. So I guess you can consider this my “going upon the account” in a way.

Here’s a screenshot of the progress so far:

I intend to write more about it as I continue working on it. Hopefully I’ll even make some fun little videos talking about the mechanics that excite me, or some interesting aspects of the development.

The game is being written in Rust using the Bevy game engine. It’ll be compiled natively for Linux, Windows, and MacOS, and I plan to release it on both Steam and Itch.io, and plan to test on the Steam Deck specifically throughout development to ensure it runs flawlessly there and on devices with similar capabilities and controller layouts. I also plan to release playable demos before release.

So far there’s not a ton to do, but the technical foundation is being laid. It has a functional multiplayer server-client architecture, so it’s being built with multiplayer networking as a first-class, from the start feature rather than bolted on later.

The terrain is infinite (or, infinite in the same way Minecraft is, eventually you’ll get far enough away that floating point precision causes weirdness, but it’d take literal months or years to sail that far). It’s generated using a pretty complex layer of Simplex noise fields with multiple passes to shape the terrain into a consistently interesting infinite archipelago. Though that part is sorely in need of a clean architecture to support the massive amount of features I plan to add to terrain generation.

The ocean is also really cool. It’s technically just a big flat plane on the CPU. On the GPU, it’s using a vertex shader that takes a bunch of Gerstner wave parameters via uniforms, and it simulates the waves entirely on the GPU. I still need to add functionality to the multiplayer server to ensure all players GPUs are on synchronized clocks so they see identical waves, but that’ll be worked out soon. Unlike something like Sea of Thieves, this game won’t be as realistic a simulation, so at least tentatively it seems okay for minor desynchronization there, which allows saving a lot of CPU resources.

(Also, in case you noticed the cool background on the homepage of this blog: that is actually a real-time simulation of Gerstner waves happening in your GPU via WebGL2 and rendered like a topo map, it was my way of playing around with Gerstner waves before starting this game project)

Similarly to Sea of Thieves, the waves become less pronounced as you get close to islands. That way harbors and along the shore are nice and steady and perfect for docking or anchoring.

And the water’s fragment shader is pretty neat as well. It uses multi-pass rendering. So in the first pass, we render the whole scene without the water, including a depth buffer. Then, we render the water in a second pass and give it access to the frame buffer and depth buffer from the previous pass. The tinting strength of the water is calculated by the distance between the screen depth of the fragment being rendered on the water’s surface, and the depth of the pixel at the previous pass. If the previous pass depth is closer, the vertex is dropped (because the water is occluded), and if the previous pass depth is further away, then we know exactly how much water that ray of light is passing through, and can tint it according to that thickness of water. This allows fairly realistic-looking water. Obviously it’s not refracting accurately, but for the style of this game, I think that’s certainly okay, and the added complexity and performance impact of truly realistic refraction doesn’t seem justified. Besides, nobody can buy computer parts anymore thanks to AI datacenters, so it’s an explicit goal of my game to be low-end-hardware-friendly. I want my game to run flawlessly on a steam deck, or a crappy old laptop. I think the lower the friction necessary to play, the more likely it is for people to be able to bring their friends together to play, and that’s the whole point.

Anyway, hopefully I’ll have more to share soon, so keep an eye out if you’re interested in the game. And if you happen to know of any good job opportunities, I’m on the job market. Here’s my resume.