Time Travel Manager
Overview
The TimeTravelManager drives the Time Crystal's time-travel demo and implements the ITimeTravelGhostManager contract so that timeline ghosts can be recorded, replayed, and restored from saves. It orchestrates two synchronized timelines (Original and Alt1), spawns playable ghosts, and coordinates the scene puzzle and UI state that represent the core time paradox gameplay loop.
The behaviour is only compiled when Crystal Save, MemoryPack serialization, and the Crystal Save Time Crystal module are imported. If the global GameObjectTimeMachine singleton has not been initialized, the manager aborts early and prompts developers to add initialization to the scene.
Relationship to ITimeTravelGhostManager
ITimeTravelGhostManager
TimeTravelManager implements ITimeTravelGhostManager and therefore becomes the bridge between RememberTimeTravel and the runtime ghost playback pipeline. The interface defines three responsibilities:
Register newly spawned ghosts so Remember Me can persist their branch name, playback duration, and loop settings.
Unregister destroyed ghosts to stop tracking after the puzzle is solved or the ghost is despawned.
Restore ghosts from saved games by respawning the ghost prefab, copying saved playback metadata, and seeking to the saved playback timestamp.
Because the manager owns the scene references (player, recorder, ghost container, UI widgets), it can reconstruct the entire ghost experience when RememberTimeTravel.DeserializeComponentData invokes RestoreGhost after loading a save slot.
Required preset: Time Travel

In the Crystal Save Settings window, the "Configuration Preset" dropdown under TimeMachine Configuration includes the ⏰ Time Travel option, described as the preset for "Back to the Future" and "Chrono Trigger" style mechanics. Selecting this preset automatically applies the MaxTwoBranches branch policy, ensures continuous time is enabled (with the option to override in code), and limits the system to an Original and Alt1 timeline. The help box in the settings warns that any new divergence overwrites Alt1 from the current position, reinforcing the two-branch constraint.
TimeTravelManager expects this preset to be active. During Start() it explicitly applies the preset and immediately begins recording on the Original branch. When the player rewinds, it creates the Alt1 branch, spawns a ghost that replays Original, and records the player's new actions into Alt1, matching the preset's MaxTwoBranches behaviour.
Gameplay Loop
Initialization – On scene load the manager validates the Time Machine singleton, ensures the player has a
TimeMachineRecorder, applies the Time Travel preset, and subscribes UI callbacks.Original recording – The player records actions on the Original branch until they trigger a rewind. UI prompts guide the player toward the first pressure plate puzzle state.
Rewind and branch – Pressing rewind stops the Original recording, spawns a ghost that replays the recorded timeline, resets the player, and switches to Alt1 for a new recording session.
Ghost playback – The ghost clones the player's animator, optionally adds NavMesh navigation, applies translucent materials, and enforces trigger-ready physics so it can interact with the puzzle environment.
Persistence – Ghost state is registered with Remember Me as soon as it spawns and is unregistered when the puzzle is solved or the ghost is removed. Loading a save reconstructs the ghost and fast-forwards it to its saved playback time.
Difference from PuzzleSolverManager
PuzzleSolverManagerAlthough both managers orchestrate ghost-like characters, their fundamental goals diverge:
Branch budget – Time Travel enforces exactly two timelines (Original + Alt1), while Puzzle Solver accumulates a list of clones with each rewind, enabling multi-plate puzzles that require several simultaneous selves.
Clone lifecycle –
TimeTravelManagerreplaces the single ghost every time the player rewinds, whereasPuzzleSolverManagerkeeps a collection of clones alive, tracking each recording duration and start time to orchestrate overlapping playback.Save-system integration – Time Travel integrates through
ITimeTravelGhostManagerto restore one ghost with branch/duration metadata. Puzzle Solver implementsIPuzzleSolverCloneManagerand serializes an arbitrary number of clones, their durations, and puzzle progress, reflecting the different persistence requirements of Braid-style puzzles.
In short, Time Travel is optimized for a single paradox loop with deterministic Original/Alt1 playback, whereas Puzzle Solver caters to cumulative puzzle layering that expects many concurrent ghosts.
Genre inspiration
Crystal Save's Time Crystal surfaces the Time Travel preset as ideal for story-driven paradox adventures such as Back to the Future and Chrono Trigger. These titles use two-timeline causality loops where a player's past actions directly influence a present scenario, mirroring the Original/Alt1 arrangement enforced by TimeTravelManager. By contrast, the Puzzle Solver preset references games like Braid and The Witness, emphasizing multi-clone puzzle solving. Understanding this distinction helps designers choose the correct preset for their project.
Last updated