Rewind: Keep the restored state, and measure "seconds ago" in game time

A rewind used up the state it restored, so rewinding, playing on a bit and
rewinding again went further back than the state you just came from. Now
the state stays, and only a rewind within 0.8 seconds of the last one
steps back past it.

"Seconds ago" was wall-clock time since the snapshot, which counted
pauses, fast-forward and time spent in states rewound to earlier. It's now
emulated time from where the rewinding started.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-19 17:58:36 +02:00
1 parent b75f487dc5
commit ca72577702
4 files changed
+65 -20

No files matched your search

+3 -2
View File
@@ -89,8 +89,9 @@ private:
// The operation is queued, and happens at the end of the next frame the CPU runs, so follow this
// with something that runs it, like cpu.runUntilTime.
//
// Rewind snapshots are only taken with the RewindSnapshotInterval setting on. Each rewind uses up
// the snapshot it restores, so repeating it goes further back.
// Rewind snapshots are only taken with the RewindSnapshotInterval setting on. A rewind restores the
// newest snapshot and keeps it, so a later rewind comes back to it, but one within 0.8 seconds of
// the last steps further back.
//
// Parameters:
// - path: string, path to the .ppst file (only for load and save).