Skip to content

// project

DEADLOCK

A first-person time-loop game about a moment someone could not let end.

DEADLOCK is a first-person time-loop game about a moment someone could not let end — a grieving mind's mathematics, rendered as a room that lies about its own floor. Under the mood sits one deterministic engine: every action is recorded as intent, never position, and replayed through the exact same physics step. That one idea — record intent, replay deterministically — is reused, unmodified, five different ways across the game's core systems.

Godot 4.7GDScriptDeterministic fixed-timestep simgdUnit4AI-orchestrated content pipeline
Field notes on this work In development · private repo, public case study

0

systems · one deterministic spine

0,026

lines of GDScript · 36 files

0

AI agents · one dev-crew session

0

tolerance in the determinism gate

// deep dive

How it works

Record intent, never position

The determinism contract in one line: an InputFrame stores a move vector, jump, and dash — never a position. Motion.step(state, frame) replays it through the same fixed-timestep physics tick every time, so the same state plus the same frame always produces the same state out. Positions are outputs, never inputs, which is what makes an Echo standing on a pressure pad, a ghost racing a past run, and the Hunter's prediction the same handful of lines wearing three different narrative masks.

One spine, five faces

Recorder is a ring buffer of InputFrames; Echo replays a slice of it tick-for-tick, either incrementally (once per physics tick, for a live cooperating Echo holding a pressure pad open) or in one shot (for ghosts, tests, and the Hunter's prediction). Cooperative Echoes hold a bridge open, ghosts race a past run, the leaderboard replays a full match, and the Hunter — the thing hunting you — predicts your position off the same replay math. No branch of that list touches a second system.

The gate that can't be skipped

tests/test_determinism.gd asserts bit-exact field equality with no tolerance, plus a perturbation check that fails if a changed input ever produces an identical output — the test that would catch a gate that silently stopped testing anything. A PostToolUse hook reruns it automatically on any edit to the time or player systems, so drift surfaces the moment it's introduced, not at playtest.

The Hunter, built on the same replay math

The Hunter wakes once the player's attention score crosses a threshold, can be frozen by the Stutter ability, and catches the player by proximity — a CharacterBody3D whose prediction runs on the exact same recorded-intent pipeline as the cooperative-Echo and boss-desync mechanics. It isn't a second AI system bolted on; it's the same fifteen lines of replay code with a different narrative job.

Design bible before geometry

52 logged iterations, 10 entity dossiers, 24 hand-authored animated-SVG design boards, and a 4,300+ line, seven-document codex — written before most of the game's rooms exist. The frame test for every addition is one question: would a grieving mind hold this?

An AI dev crew, checked in, not described

The codex wasn't hand-written — it was generated by a workflow script checked into the repo: three readers distill source material, seven documents generate in a pipeline where critique starts the moment each one finishes its own draft, the four widest creative documents run dual-lens ensembles merged by a judge pass, and every draft clears adversarial critics for frame, fairness, originality, and voice before a reviser is allowed to touch the file. One session: 39 agents, zero failures, ~4.8M tokens.

Honesty as a design constraint

The project's own README states plainly which systems are playable versus designed-but-unbuilt, and backs every specific number with a literal command a reader could run against the source. The in-fiction lesson — an unreliable room lies about the floor; sending an Echo reveals the truth — is asked of the documentation too.

// architecture

How it's built

One deterministic step, five uses

The gate that can't be skipped

// under the hood

Tech stack

Engine

  • Godot 4.7 (Forward+)
  • GDScript
  • fixed-timestep _physics_process

Determinism core

  • InputFrame (intent, not position)
  • Recorder ring buffer
  • Echo (incremental + one-shot replay)

Testing

  • gdUnit4
  • bit-exact determinism gate
  • PostToolUse re-run hook

Build

  • Single-threaded WASM web export
  • Git LFS for binary assets

Content pipeline

  • Checked-in AI dev-crew workflow script
  • voice/dash deterministic lints
  • pre-commit enforced

// gallery

Screens (7)

Swipe or use the arrows · tap a screen to enlarge

See how everything connects →