HeadlinesBriefing favicon HeadlinesBriefing.com

AI Reverse-Engineers Thrust Physics Timing

Hacker News •
×

James Randall asked Claude Code to recreate the 1986 BBC Micro classic Thrust in the browser. The initial attempt produced superficial code that looked like the game but felt wrong — gravity, momentum, and ship weight were all off. Rather than iterate on generation, Randall fed the AI a commented 6502 disassembly by Kieran Connell and used it as an archaeology tool to interrogate the original source.

The analysis revealed that Thrust's feel comes from precise timing, not just constants. The physics runs at roughly 33.33 Hz, not the 50 Hz VSync, with only 6 active physics slots per 16-tick window (ticks 0, 3, 5, 8, 11, 13). Gravity and thrust apply only on those slots; rotation skips every fourth tick. Q7.8 fixed-point arithmetic and asymmetric drag (63/64 on X, 255/256 on Y) create the characteristic sticky horizontal movement. Matching this exact cadence made the recreation indistinguishable from the emulator.

Sound required a different approach: the engine is a continuous drone, so Randall emulated the SN76489 sound chip (also used in the Sega Master System) rather than sampling discrete effects. The result is a browser version that switches seamlessly with the original BBC Micro experience.

The project demonstrates that AI's value here wasn't code generation but reverse-engineering legacy assembly. Recreating "feel" demands understanding micro-timing patterns — gated physics updates, rotation skips, drag asymmetry — that no spec or constant list captures. AI accelerated the archaeology, but the insight came from reading the original logic.