Case study 24 / 37
Emberline
A 2D game engine where time is a data structure: fixed-step deterministic simulation, hold-to-rewind, replays and save files that are verifiable input logs.
- Status
- Research
- Period
- 2026
- Domain
- Web · Experiments
- Language
- TypeScript
- Last push
- 26 OCT 2026
- License
- MIT
- Source of claims
- README.md, ARCHITECTURE.md

01/The problem
In most engines, time travel, replays and deterministic saves are things you build yourself, and you find out too late that randomness and wall-clock time are scattered through your systems.
02/The system
Emberline records every input frame of a deterministic, fixed-step simulation, which gives rewind, replays, tamper-evident saves and, in the demo, a bot that completes a level by searching the future and rewinding. TypeScript with zero runtime dependencies; runs in the browser and headless in Node.
03/Implementation
- 01An ECS with JSON-only components, deterministic query order and deep snapshot/restore.
- 02A timeline at the core: fixed-hz steps, keyframes, rewind, seek, hashing and serialisation, with an accumulator loop and render interpolation.
- 03AABB physics, scenes, a Canvas2D renderer with camera and DPR-aware backing store, an asset packer that reads PNG headers, and Web Audio triggered from tick events.
- 04Saves are a keyframe plus the input log; loading replays them and rejects a file whose replay diverges.
- 05A debug overlay and an entity inspector.
04/Engineering
Determinism is enforced, not hoped for
A lint fails the build if engine code touches Math.random, Date.now, performance.now or the DOM outside the backends that own them.
The engine can search
Because stepping and rewinding are cheap and exact, the headless bot completes the level by depth-first search over inputs, using the same code path players use.
05/Interface
Real screenshots of the running software. Captions state the data shown.
06/Tech stack
- TypeScript
- Zero runtime dependencies
- ECS
- Canvas2D
- Web Audio
- Node test runner
07/Result
Verified outcomes
- 17 tests: identical hashes for identical inputs, exact rewind, save/load round trip and tamper rejection; CI runs the headless demo end to end.
Known limitations
- Canvas2D only; AABB physics without dynamic-vs-dynamic response; cross-browser bit-exactness not yet verified in CI.
08/Links
Related work
Temporal SQL database
TesseraDB →
An embedded SQL database where the past is a first-class query: every row version retained, AS OF reads, and event streams in the same transactions.
Open source · Research
Deterministic sandbox VM
Halyard →
A deterministic, gas-metered, capability-gated register VM for running code you don't trust and replaying exactly what it did.
Open source · Research
Optimizing compiler
Bellows →
An optimizing compiler you can read end to end, from source text to x86-64 machine code, with an IR interpreter that must agree with the native binary on every program.
Open source · Research
Next case study
ArchitectFlow →