Save & Load
Table of Contents
Overview
PulseQuest has a built-in, framework-agnostic save system. It serializes all active quests and objectives to a compact byte buffer and stores it as a named entry in an FPulseQuestSaveGame struct (not a USaveGame asset). You own the persistence: write FPulseQuestSaveGame to whatever storage backend you use.
Data Structures
FPulseQuestSaveGame
Top-level save payload stored per manager.
| Field | Type | Description |
|---|---|---|
QuestRecords | TArray<FPulseQuestSaveRecord> | Saved records identified by their save id |
IPulseQuestSaveInterface
Implemented by any UObject that participates in the save system.
// Called before saving; fill OutBytes with custom data
virtual void OnSaveGame(TArray<uint8>& OutBytes) {}
// Called after loading; read saved bytes
virtual void OnLoadGame(const TArray<uint8>& InBytes) {}
// Return false to skip saving this object
virtual bool ShouldSave() const { return true; }
Implementors
| Class | What it saves |
|---|---|
UPulseQuestManagerData | Any custom manager-level data |
UPulseQuestData | Quest-specific runtime data |
UPulseQuestObjective | Objective progress (via K2_OnSaveGame / K2_OnLoadGame) |
UPulseQuestDirector | Director’s narrative state |
Blueprint override in objectives
K2_OnSaveGame(OutBytes) – Serialize progress to bytes
K2_OnLoadGame(InBytes) – Restore progress from bytes
ShouldSave() – Return false to exclude from save
Performing a Save
Blueprint (async action)
[Save Quest Manager Async]
├── Target: Quest Manager interface reference
├── Slot Name: "MySaveSlot"
└── Outputs:
├── On Success (SaveGame struct)
└── On Failure
The async action:
- Calls
Manager->SaveQuestManager(...). - Serializes all active quests, objectives, manager data, and director data.
- Returns an
FPulseQuestSaveGamestruct on theOn Successpin.
You then pass this struct to whatever save system you already use (e.g., SaveGameToSlot or a custom cloud save).
C++ API
FPulseQuestSaveGame SaveData;
bool bSuccess = Manager->SaveQuestManager(SaveData);
if (bSuccess)
{
// Persist SaveData.QuestRecords, .QuestManagerData, .DirectorData
}
Performing a Load
Blueprint (async action)
[Load Quest Manager Async]
├── Target: Quest Manager interface reference
├── SaveGame: FPulseQuestSaveGame (from your storage backend)
└── Outputs:
├── On Success
└── On Failure
The async action:
- Calls
Manager->LoadQuestManager(SaveData). - Restores
UPulseQuestManagerData. - If no Director: starts all quests whose records have
bIsActive == true(respectingPQF_NoStartOnLoad). - If Director present: calls
Director->OnLoadGame(SaveData)and lets the Director decide.
C++ API
FPulseQuestSaveGame SaveData = /* … load from storage … */;
FGameplayTagContainer LoadFailures;
bool bSuccess = Manager->LoadQuestManager(SaveData, LoadFailures);