Bruce Gill

tank slop

A Wii Tanks tribute in one HTML file, with a LAN server that needs no npm install because the WebSocket implementation is written out by hand.

  • JavaScript
  • Canvas
  • WebSockets
  • Node
  • Zero dependencies
Role
Solo — I set the constraints; AI agents implemented them
Method
Specification-driven
Status
Playable

Top-down tank combat across twenty seeded levels: solo, two-player co-op, or versus on one keyboard. Open the file in a browser and it runs. There is no build step, no install, and no dependency — index.html is the game.

The hosted version above covers solo, co-op, and versus. The LAN modes need a server on your own network, which is a node server.js away.

The constraint

The self-imposed rule was that hosting a game for your friends should never require an npm install. Someone has a laptop, everyone's on the same wifi, and the whole thing should be running in under a minute. That rule is the reason the project has an interesting middle section at all: it meant implementing RFC 6455 — the WebSocket protocol — by hand, in about 120 lines, against Node's raw HTTP upgrade event. The server does its own frame parsing and masking, serves the static files, and holds the tournament state. Total dependency count: zero.

Who simulates the game

The interesting design decision is that the server never simulates anything. One client is elected arena host and runs the physics for everyone. The others send their controls at 30 Hz and replay the host's world snapshots, interpolating between them, and reconcile against whatever the host says actually happened. On a LAN that correction is usually zero pixels, which is precisely why the design is allowed to be this simple — the latency budget the architecture assumes is the latency a living room actually has.

The server's job is the part that has to survive people closing laptops: lobby state, ready-up, match format, wins, frags, and who advances. When the arena host disconnects mid-match the server hands the arena to somebody else and replays what's needed to get them synchronized. Losing the person running the physics should cost a stutter, not the tournament.

Formats

Four players can race the same twenty seeded levels side by side — separate arenas, identical level generation, so it's a genuine race rather than a scramble. Or everyone drops into one arena for a single-elimination 1v1 bracket or blue versus red teams. The host picks the format from the lobby, everyone readies up, and it starts.

← All projects