Sitelet https://github.com/pleiondev/flutter3d/pull/78
Skip to content

Keep paused steps and branches on the run's tapes - #78

Open
dzolotov wants to merge 4 commits into
0.9.0from
wf/timeline-tape-consistency
Open

dzolotov wants to merge 4 commits into
0.9.0from
wf/timeline-tape-consistency

Conversation

@dzolotov

@dzolotov dzolotov commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Paused steps and branches now stay on the run's tapes (N4 and HR3 tails in tasks/0.9-engine-roadmap.md).

What changed

  • RunTimeline.stepOnce at the present now records its step, as a loop step does: input to the recorders first (the rewind buffer's by default, or the loop's GameLoop.recorders), then the due keyframe through capture, the step, and onStepped. A rewind or branch after paused steps now replays through them.
  • releaseAt and branchHere call onBranched(step, stepsAgo:). DemoRecording.branched cuts the demo's tape there with the new InputTapeRecorder.truncate, forgets later checkpoints and drops later level swaps. A swap exactly at the branch step is kept: restoring a snapshot does not undo a swap, so that level is still the one on screen.
  • The platformer wires its loop recorders, capture, a checkpointing onStepped and onBranched. A branch from before its demo started restarts the demo with the level on screen at step 0. The dungeon and racing pass their recorders and capture.

Tests

  • run_timeline_test, demo_recording_test (a branched run replays through replayDemo with no divergence), input_tape_test, and demo_level_swap_test on the real platformer, byte for byte.
  • Full suites: flutter3d_sim 724, flutter3d_game 330, dungeon 133, racing 193; platformer run in groups (all 34 files pass; one whole-suite run hung under machine load). tool/structure.dart holds.
  • Mutation checks: dropping the recorder call, the keyframe, or the truncate each fails the tests meant for it.

Left

  • A paused step still runs only stepSim, not the game's whole step: sounds and events from paused steps show on the next live step.
  • The dungeon and racing keep their demos outside DemoRecording, so a branch there leaves their demo tape on the old future.
  • Both are written into the roadmap's Left paragraphs.

Overlap to check: the cn queue has HR3 and N4 tasks in verifying (t-a7a8eaa5f63a, t-c91a30969bc3). This branch closes Left tails of those items, not their main work; worth a look before merging either.

A recorder now keeps only the first so many entries on request, so a tape
can be cut where a branch left the old future and recorded on from there.
Truncating to nothing makes the next entry a first one again.
RunTimeline.stepOnce at the present stepped the simulation without writing
the input to any recorder or taking a due keyframe, so a rewind or branch
afterwards replayed to a state the run never had. It now writes to
recorders (the loop's list, or the rewind buffer's recorder by default),
keyframes through capture and runs onStepped after the step.

releaseAt and branchHere report the step they cut to and how far back it
was through onBranched. DemoRecording.branched truncates the demo's tape
there, forgets later checkpoints and drops swaps after the step, so a
saved demo replays the branch that was played rather than the old future.
The platformer, crypt and racer hand RunTimeline their GameLoop.recorders
and a capture, so a paused step lands on the rewind and demo tapes and
keyframes. The platformer also checkpoints a paused step into its demo and
cuts the demo on a branch; a branch back past the demo's start begins it
again from now with the level on screen at step zero.
N4 and HR3 move the stepOnce and branch items from Left to Done and say
what stays: a paused step still runs only the simulation step, and the
crypt and racer demos do not hear branches. Test counts updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant