{"slug": "how-warship-workshop-runs-a-1000-place-online-ladder-from-one-browser-page", "title": "How WARSHIP WORKSHOP runs a 1000-place online ladder from one browser page", "summary": "Ant Games released WARSHIP WORKSHOP, a free browser-based 3D warship auto-battler with a 1000-place online ladder, built as a single 127 MB HTML file. The developer reports that the fight simulation is a pure, clock-free rules layer of 74 source files whose identity is a hash-of-hashes, so the page and server can verify they run identical rules and reject mismatched fights with a 409. The ladder server is a single Node program using only node: built-ins, with fights run in a worker thread and state kept in a JSON file backed by an append log, atomic-rename snapshots and hourly backups.", "body_md": "[WARSHIP WORKSHOP](https://antgames.ai/play/warship-workshop/#play) is a free 3D warship builder that runs in the browser: you design a warship part by part, press FIGHT, and watch it battle on its own, then climb a shared ladder of 1000 places. It is an original release by Ant Games. Free to play, no pay to win, no sign-up, on desktop and phone with nothing to install.\n\nThis is a technical devlog: how the game is put together, and the three decisions that made a networked auto-battler possible inside a single HTML file.\n\nAn auto-battler where you fight the server's ships is usually two programs: a client that renders, and a server that simulates. The obvious split works, but then a fight is a black box — the player sends a ship and waits for a result.\n\nWe wanted fights you *watch*. So the browser has to run the exact same simulation the server runs, and both must agree down to the byte, or every fight between them is a lie.\n\nThe fight rules are 74 source files: 59 in `src/sim`, 13 in `src/content`, the RNG, and one entry file. They obey a single import rule: they import nothing from the game, render, UI, online, platform, input or asset layers — and they never read a clock or call `Math.random`.\n\nEvery one of those files is hashed, and the rules layer's identity is a hash-of-hashes: the first 16 hex digits of a sha256 over the sorted list of every file's path and sha256. The page carries that value; the server's fight bundle carries it too. A fight request sends the page's value with the ship. If the server runs a different rules value, it answers 409 and the page asks to reload — one changed byte in a rules file cannot silently desync a fight.\n\nBecause the sim is pure — ships in, a seed in, no clock, no `Math.random` — the same fight replays identically everywhere. The fight seed is an FNV-1a hash of `fight|<id>|<place>|<version>`, made by the server, so neither side can pick its own dice.\n\nThe build is deliberately extreme: `dist/index.html` is a single file — one minified script, the CSS, and every asset embedded as base64 blocks in `<script type=\"application/octet-stream\">` tags, 127 MB in total. It runs from a server page, and the same script boots both of the page's workers from a single text Blob.\n\nWhy: a browser game that loads no other file has no loading race, no missing-asset path, and one artifact to publish and version. The cost is size, so assets stream in by family — backdrop, hulls, icons, bodies, maps, VFX, props, debris, music, atlas — with a load manifest, and meshes are glTF in gzip blocks the page inflates with `DecompressionStream` as they are needed. Rendering is three.js on a WebGL2 canvas.\n\nThe online ladder is one Node program with only `node:` built-ins. 1000 places, each held by a player or by a computer ship; every holder or ship change bumps that place's version, which is what lets the rules hash catch a stale page. Fights run in a worker thread. The ladder is a single JSON file: each write appends a line to a log beside it, and periodically the log is folded into a snapshot by atomic rename, with an hourly backup.\n\nSaves never touch a database either: the page keeps the save in `localStorage` under a per-game prefix, uploads it (at most 64 KiB, one in 10 s), and the server keeps three revisions. A SAVE LINK carries the save to another browser. The newest tab holds the save; other tabs stay read-only, so two tabs can never overwrite each other.\n\nThe server also makes every name (a word, a creature and a number), stores players under sha256 hashes of their id and token, and answers every JSON with `Cache-Control: no-store` and `X-Robots-Tag: noindex`.\n\nFrom our server logs, last 7 days, as of 2026-12-04:\n\nSmall numbers, but honest ones, and the ladder makes every one of them count.", "url": "https://wpnews.pro/news/how-warship-workshop-runs-a-1000-place-online-ladder-from-one-browser-page", "canonical_source": "https://dev.to/antgamesai/how-warship-workshop-runs-a-1000-place-online-ladder-from-one-browser-page-h1o", "published_at": "2026-12-04 16:10:39+00:00", "updated_at": "2026-12-04 16:14:29.190440+00:00", "lang": "en", "topics": ["ai-products", "developer-tools"], "entities": ["Ant Games", "WARSHIP WORKSHOP", "three.js", "WebGL2", "Node.js"], "also_reported_by": [], "takeaway": "Hashing every file in a pure, clock-free simulation layer into a hash-of-hashes and sending it with each fight request lets the server reject stale clients with a 409 instead of silently desyncing.", "recommendation": {"advice": "Version your deterministic simulation as a hash-of-hashes of its source files and have the server return 409 on mismatch, so stale clients reload instead of desyncing.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/how-warship-workshop-runs-a-1000-place-online-ladder-from-one-browser-page", "markdown": "https://wpnews.pro/news/how-warship-workshop-runs-a-1000-place-online-ladder-from-one-browser-page.md", "text": "https://wpnews.pro/news/how-warship-workshop-runs-a-1000-place-online-ladder-from-one-browser-page.txt", "jsonld": "https://wpnews.pro/news/how-warship-workshop-runs-a-1000-place-online-ladder-from-one-browser-page.jsonld"}}