For Developers

How a 2009 Flash game became online co-op

There was no source code: one compiled Flash file, 1,855,972 bytes. Everything here, from the 32 levels to the physics, was recovered from it, ported to TypeScript, and given rollback netcode so two people in two browsers play as if they shared a keyboard.

Numbers

The numbers this design rests on

From the benchmarks and the test suite that ship with the code.

Design numbers
Levels32Adventure 17, puzzle 9, speed 6, each pinned by a digest in CI.
Tick26 fpsA 38.5 ms frame, the SWF's own rate, on a fixed-step accumulator.
Input3 bitsPer player per frame. Each packet repeats the last 16 frames.
Session cost~700 B/sIncluding that redundancy; about 34 bytes per input packet.
Input delay1 frameMeasured, against lockstep's 5 on the same build.
Re-simulate a frame~0.04 msSo rewinding is always cheaper than the 38.5 ms a frame has.
Snapshot~4.7 msOne snapshot, refreshed every ~8 settled frames: 1.4 MB, not 17 MB.
Determinism3 enginesV8, SpiderMonkey and JavaScriptCore agree on digest aba863c1 after 600 frames.
Soak640,000 framesAbout seven hours of play, run twice and compared.

The repository

Four parts, one direction of dependency

Repository layout
engine/TypeScriptThe simulation, the renderer and the netcode. No network, no accounts; runs in Node.
app/Static SPASign-up, friends, invitations and the game, served from a CDN.
supabase/PostgresMigrations, row level security and its tests, and the authenticated TURN credential broker.
tools/PythonWhat turned the SWF into everything else. Run once; nothing in a build needs it.
Netcode →