CrimsonSaveSystem · Lesson 3 of 8
Make a System Saveable
Before you start
- Completed: Enable the Plugin
- A system with state worth saving (an inventory, a stats component…)
Chapters
1. Implement the interface
Implement `ICrimsonSaveableSystem` on the object that owns the data and return a unique fragment name from GetFragmentName() — that name becomes the fragment's file on disk, so no two systems may share it.
Where to host it in Blueprint
A Blueprint can't be a Game Instance Subsystem — host the interface on an Actor or Actor Component instead (a manager actor in the level, or a component on the Game State).
2. Register with the manager
On startup (Initialize / BeginPlay), register with the manager subsystem so it knows to include you in every save and load:
// e.g. in your subsystem's Initialize or the actor's BeginPlayUCrimsonSaveGameManagerSubsystem::Get(this)->RegisterSaveableSystem(this);
3. Mark the data
Flag every property to persist with `SaveGame` — the manager captures them automatically through a name-stable archive, so adding fields later doesn't break old saves.
UPROPERTY(SaveGame)TArray<FInventoryEntry> Items;UPROPERTY(SaveGame)int32 Gold = 0;
SaveGame alone does nothing
For systems, the flag is only honored because the owner implements the interface AND registered. Flagged data on an unregistered object is silently never saved. (World actors are the one exception — next lessons.)