📚 Encyclopedia

Games & Graphics · updated 2026-10-13

Ghost replays for racing and speedrun games

ghostreplayspeedrunserializationinterpolation

A ghost is a translucent replay of a previous run (your PB or someone else's) shown while you play. There are two ways to record one, and the right choice depends on whether your physics is deterministic.

State recording vs input recording

Run's format (built v0.8.14)

Input recording when the sim is deterministic (seed + input log)

If a game is built deterministic from the start (fixed 60 Hz step, all randomness from one seeded PRNG such as mulberry32, no wall-clock reads in the sim), input recording becomes the cheap option and unlocks more than ghosts. Design worked out for the ~/dev/game wireframe flight game ("VECTOR" pitch, July 2026): - Replay = seed + input log. Delta-encode inputs per tick; a whole sortie fits in a ~2 KB string that can be pasted or shared. - Daily seed: everyone gets the same spawn sequence that day, so scores are directly comparable, a retention loop for free. - Campaign missions = named seeds + scripted spawn tables, the same code path as the endless mode. - Build this early, while the sim is small. Every later system must stay deterministic or old replays desync, so stamp replays with a sim version.

Checkpoint splits

Bugs worth remembering

Ideas not yet built

Race-this-ghost buttons on the leaderboard, a pre-level ghost picker (your PB / #1 / browse), spectate mode, multi-ghost racing, and live ghost racing (Live ghost-racing multiplayer (design research)).

See also

Linked from

Sources: run memory (research-ghost-replay.md, research-speedrun-features.md, improvement-cycles.md, architecture-audit-2026-10.md)