Cannons

Cannons was a turn-based artillery game on playray.com — a Java applet, shipped as obfuscated bytecode, whose servers are long gone. This is that client, decompiled and given its names back, playing against a server I wrote from scratch by watching what the client expected.

Nothing here talks to a server of mine. The Java client is compiled to JavaScript, the Go server is compiled to WebAssembly, and both run in this tab — so when you press play, your browser is hosting the game and a computer opponent takes the other seat.

The battle below the button is a demo, and it has no server at all: the client’s packet handlers are ordinary methods, so a scene is just a script of the packets a real match would have sent, fed straight in. Which is why it can open with a volley of SS-20s all landing on named cannons — a thing no actual match can produce, because the computer opponents cannot aim a guided weapon. It runs nine scenes, two of them in winter, and the aim points are compiled: each one was found by simulating every shot the game can express against the battlefield as it stood at that moment.

Aim with the mouse, adjust power, and mind the wind. The terrain is destructible and generated from the round seed, which is why the server sends four bytes instead of a map. Built from 4e1e718 on Sep 2, 2026.

Wesley Ray · blog · git · resume · linkedin

built 2026-09-13 14:35 ET · b6c6233 · 117 notes