Why a warship game
I wanted a game my nephew and his friends could jump into from any computer without installing anything, and that we could play together online. Naval battles felt right: big ships, slow heavy shells you have to lead, torpedoes, smoke screens. It's easy to understand in ten seconds and still has room to get good at.
One file, no install
Iron Tide is a single HTML page. The game code, the styles, the ship models, the sound effects and the music are all in that one file, a little under a megabyte. The only outside pieces are the three.js 3D library and the PeerJS networking library, both loaded from public CDNs. That makes it trivial to host, quick to load and easy to share.
The ships are built in code from simple shapes rather than loaded as 3D models. Each hull is described by its length, beam and deck height, and the turrets, funnels, masts and superstructure are placed on top. That keeps the file small and makes adding a new ship mostly a matter of writing down its measurements.
The ocean
The sea is a large grid of points moved by several layers of waves in the GPU, with foam on the crests, a sky that changes through day, sunset and night, and storms that roll in with heavy swell and lightning. Ships pitch and roll with the waves, so in rough water your aim moves with the deck.
Gunnery that feels fair
Shells fly on real arcs with travel time, so a moving target needs a lead. The hard part was making that fun with a mouse, a controller or a thumb. The answer was a range marker that shows how long your shells will take, plus aim assist that gently sets the range on whatever ship is under your crosshair. Aim assist only ever helps against computer ships. Online against people, it switches off.
Online without servers
Multiplayer uses WebRTC, which lets browsers talk straight to each other. One player hosts and gets a short room code. Everyone else connects directly to the host, whose game runs the simulation and sends out compact snapshots of every ship twenty times a second. Each player's game blends smoothly between snapshots so ships glide instead of jumping. There's no game server to pay for, and friends who join late can watch as spectators until a seat opens.
Music that's never the same twice
The soundtrack isn't a recording. It's generated live with the Web Audio API in D minor, and it shifts mood with the game: calm when you're sailing, tense in combat, heavy when a boss shows up. All the sound effects are synthesized the same way, which is a big part of how everything fits in one file.
Phones and tablets
The latest update added touch controls. The game detects a phone or tablet and switches to a layout made for thumbs: a stick on the left to steer, drag on the right to aim, double tap to lock, and big buttons for fire, torpedoes and abilities. Phones also get a lighter graphics setting to keep the frame rate up.
How I built it
I built Iron Tide with an AI coding assistant, Claude, as my programming partner. I'd describe what I wanted, play the result, and keep pushing on what felt wrong. That loop let one person build something with this many moving parts: a 3D ocean, over a dozen ships to sail, more than twenty game modes and online play.
What's next
More ships, more modes, and whatever the players ask for. If you have an idea or found a bug, send me feedback. I read all of it.