Keep Across Scenes vs. Remember Home Scene

Remember Home Scene vs. Keep Across Scenes

Crystal Save provides two different persistence modes for controlling how SaveablePrefab instances behave across scene changes: Remember Home Scene and Keep Across Scenes. While both impact object restoration, they serve very different purposes and have distinct performance characteristics.


Remember Home Scene

What It Does

  • Ties the SaveablePrefab to a specific scene where it was originally spawned.

  • Crystal Save stores:

    • The home scene name.

    • Transform state (position, rotation, scale).

    • Active state and all saved component data.

  • On load:

    • The prefab is only restored when you are in its home scene.

    • It is not present in other scenes until you return.

Typical Use Case

  • Scene-specific pickups, interactables, or NPCs.

  • Props or enemies that only exist in one map/location.

  • Avoids keeping unnecessary objects alive when they aren’t relevant.

Limitations

  • Will not persist into other scenes without being destroyed and reloaded.

  • Switching scenes destroys the object until its home scene is reloaded.

  • Cannot be used for SaveableComponent-only objects — see important note below.


Keep Across Scenes

What It Does

  • Marks a SaveablePrefab to stay alive across scene loads.

  • Uses Unity’s DontDestroyOnLoad internally to keep the same instance alive between scenes.

  • Saves and restores component data for the same instance rather than re-instantiating.

Typical Use Case

  • Player characters.

  • Global managers, persistent UI, or inventory systems.

  • Any object that must keep its runtime state seamlessly.

Performance Implications

Pros

  • No re-instantiation or re-serialization when switching scenes.

  • Keeps all runtime state exactly as it was.

Cons

  • Stays in memory for the entire session — even if not in use.

  • More persistent objects = more cumulative memory usage.

  • Always serialized into save files, increasing save size.


Side-by-Side Comparison

Feature / Behavior
Remember Home Scene
Keep Across Scenes

Scene Boundaries

Bound to original scene only

Exists in all scenes

Persistence Method

Destroyed/re-spawned on scene load

DontDestroyOnLoad keeps same instance alive

Memory Usage

Low – object exists only in its home scene

Higher – object always in memory

Save File Size Impact

Minimal if unused scenes are skipped

Always included in save data

When to Use

Scene-specific world objects

Global objects that must never reset

Restoration Timing

On entering its home scene

Never destroyed, state carried over directly

Performance Impact

Scene load includes instantiation & restoration

Persistent memory cost, no re-instantiation

Lifecycle Flow Diagram

Below is an internal flow diagram showing how Crystal Save treats these modes:

Memory & Performance Impact Chart

Mode
Runtime Memory Usage
CPU Cost on Scene Load
Save File Size
Load Speed
Best Use Case

Remember Home Scene

Low – only loaded in home scene

Medium – must re-instantiate & restore data

Small – only saved when in use

Slower – due to instantiation

Scene-specific world objects

Keep Across Scenes

High – always in memory

Low – no instantiation on scene change

Large – always included in saves

Faster – skips object creation

Player, managers, persistent UI

Choosing the Right Option

  • Use Remember Home Scene for:

    • Location-bound props, interactables, or enemies.

    • Situations where freeing memory between scenes is important.

  • Use Keep Across Scenes for:

    • Core systems, player characters, or UI that must never reset.

    • Situations where continuity between scenes matters more than memory savings.

Last updated