Replay from the terminal
Scripts/ue.mjs replay re-simulates a recorded run from tick 0 without a window. It is the command that Fork from here runs. You can use it by itself, without GameGen.
Before you start
- Build the project:
node Scripts/ue.mjs build. - Record a run. See Record a run.
- Run the commands from the project folder.
Replay a run
Name the run by its folder name under Saved/Lou/runs, or by its path.
node Scripts/ue.mjs replay play-20261111-200501-1With no other option, the replay uses the same inputs and writes the same frames.jsonl. It stops at the parent run’s last tick.
Change an input
node Scripts/ue.mjs replay play-20261111-200501-1 --flap-at 41 # flap on tick 41 as well
node Scripts/ue.mjs replay play-20261111-200501-1 --no-flap-at 41 # drop the flap on tick 41
node Scripts/ue.mjs replay play-20261111-200501-1 --to 40 # recorded inputs up to tick 40, none afterAn edited replay runs on to GameOver.
Options
| Option | Meaning |
|---|---|
--to N | Keep the recorded inputs up to tick N, and none after it. |
--flap-at N | Flap on tick N whatever was recorded. You can repeat it. |
--no-flap-at N | Do not flap on tick N. You can repeat it. |
--max-ticks N | Stop at tick N if the bird is still alive. |
--child NAME | Name the new run. The default is the run’s name, then -replay- and a counter. |
--runs-root DIR | Where runs live. The default is Saved/Lou/runs. |
--engine-root DIR | The engine to use. See Engine setup. |
Ticks for --flap-at and --no-flap-at start at 1. A tick cannot be in both.
Read the output
The command prints one line of JSON with these fields:
| Field | Meaning |
|---|---|
child | The run that was written. |
terminal | How it ended. |
fork_tick | The tick where the replay forks from its parent. |
terminal_tick | The last tick. |
score | The final score. |
The command never overwrites a run. The replay’s log is Saved/Automation/floppy-replay.log.
If the replay does not run
| Message | Fix |
|---|---|
| “error: no run … under …” | Check the run name and --runs-root. |
| “error: the replay did not run (exit …). Build first (ue.mjs build); see …” | Build the project, then read the log it names. |
Next steps
Last updated on