Claim: with the same seed, viewport and flags, --snapshot prints a byte-identical frame, and --state-snapshot prints the matching game state as JSON.
InputSeed 42, 80×24, --ascii --no-color
NeedsPython 3.9+ and Git, no packages
Evidencecmp exit 0, state JSON, Ran 128 tests ... OK

Prerequisites

  • Python 3.9 or newer.
  • Git.
  • A macOS or Linux shell, or Windows through WSL.
The snapshot commands don’t need a TTY, so they also work in CI or over a pipe.

1. Clone the game

You run everything from the checkout through starfield.py. Nothing gets installed.

2. Render the same frame twice

Each command starts a fresh process, builds a campaign Simulation with seed 42, advances it 2.2 s of game time in fixed 120 Hz steps, and prints one frame. cmp prints nothing and exits 0 when the files match. On 23 October 2026 at commit 3765e27 both files were 1,944 bytes and identical. The frame opens with the HUD line VANGUARD // ODYSSEY and shows WAVE 01 // HOSTILES INBOUND. To render other staged screens, add --snapshot-screen boss, route, upgrade or systems, among others.

3. Read the state as JSON

This prints the same simulated moment as one JSON object, built by Simulation.render_game_to_text in model.py. For seed 42 it reports "seed":42, "wave":1, "ship":"vanguard", two scout enemies with positions and hit points, and a target that is aligned and locked. To list the top-level keys:
That printed coordinates, credits, enemies, jump_time, kills, mode, pickups, player, projectiles, remaining, route, route_choices, route_history, run_stats, score, screen, seed, services, ship, target, upgrade_choices, upgrades, wave, wave_total and weapons.

4. Run the test suite

Use unittest. A bare pytest fails at collection with ModuleNotFoundError: No module named 'terminal_starfield' because nothing puts the repo root on sys.path. On 23 October 2026 the run printed Ran 128 tests and OK in about 24 s. The tests cover the fixed-step clock, swept collisions, boss volleys, routes, refit services, ship loadouts, compact and ASCII layouts, input decoding, flight records and pseudo-terminal restoration.

5. Play it

This needs a real TTY. Press Enter on the flight deck to launch, steer with WASD, fire with Space, and quit with Q. You can also play the same code in a browser at terminal-starfield.vercel.app.

Expected evidence

  • cmp exits 0 and the script prints identical.
  • The frame contains only ASCII characters and no ANSI color codes.
  • --state-snapshot prints valid JSON with "seed":42.
  • The unittest run ends with OK.

This recipe does not prove

  • That a live run repeats. Keyboard input arrives at different simulation times, which changes later random draws.
  • Frame rate or smoothness in any terminal emulator or browser.
  • Anything about the browser build beyond what the shared Python code covers.
  • That seed 42 reaches most of the game. It shows the first 2.2 s of wave 1.
Remove the captures when you’re done: