Saving Component Data: Root-Level Prefabs vs. Individual Remember Components

Crystal Save uses a hybrid approach to saving data. The root prefab’s Remember Prefab (SaveablePrefab) manages instance lifecycle and general hierarchy tracking, while component-specific Remember scripts manage custom field serialization for individual components.


1. Is a Single ‘Remember’ Component on the Root Prefab Enough?

A single SaveablePrefab (Remember Prefab) on the root prefab is sufficient for:

  • Creation and destruction tracking of prefab instances.

  • Tracking changes to child objects’ active state, tags, layers, runtime-added components, mesh/material changes, particle states, and Animator state — if the relevant tracking toggles (trackChildStateOverrides, trackComponentBlobs, etc.) are enabled.

However, component-specific data — such as a child object’s Health, Inventory, Transform, or custom script fieldsstill requires dedicated Remember components (like RememberTransform, RememberGameObject, or custom SaveableComponent derivatives).

Summary: Root-level prefab management is covered, but component-specific data still needs its own Remember scripts or composites.


2. Must Every Additional Component Have a Custom ‘Remember’ Script?

Yes — if you want to persist its state. (Unless: Read above 1. Is a Single ‘Remember’ Component on the Root Prefab Enough?)

Crystal Save focuses on fast load times and small save files. To achieve this, it avoids costly reflection-based serialization where possible. Instead, each component is responsible for pushing its state to the SaveManager during save operations.

This means:

  • Any component whose internal state you want to persist needs a Remember script (a SaveableComponent subclass).

  • You must implement:

    • SerializeComponentData() – Convert your chosen fields into binary.

    • DeserializeComponentData(byte[]) – Read from binary and reapply the values.

If you don’t add a Remember script, that component’s state will not be included in saves.


Mermaid Diagram – Decision Flow

Mermaid Diagram – Data Collection Flow

Last updated