PulseSave Integration
Table of Contents
Overview
Pulse Quest does not depend on PulseSave, and no bridge is needed: the quest manager of a player (UPulseQuestManager) and the shared quest host (APulseSharedQuestHost) save themselves as bytes (IPulseByteSaveable of Pulse Foundation). PulseSave keeps them in its general byte model. The bytes are the quest save game of the manager (FPulseQuestSaveGame, written by UPulseQuestSaveUtils::QuestSaveGameToBytes, with the versioned state structs of its records, see Save & Load).
Setup
- Enable Pulse Quest and Pulse Save.
- Let the save menus (or your save manager) collect objects that save themselves as bytes: add the byte collector of PulseSave (
UPulseSaveByteCollector; for the save menus the Set Up step “Let the save menus save objects that save themselves as bytes”).
Settings
| Property | Description |
|---|---|
SaveIdentity | What the manager is for save keys: tag Pulse.Quest.Save.Manager (host: Pulse.Quest.Save.SharedHost), an optional Key and the save scope |
SaveLoadParams | FPulseQuestManagerLoadParams used when the bytes are loaded (reset first by default) |
The key must be the same in every session. On a player controller or player state it is made from the player id (Player.<player id>.Pulse.Quest.Save.Manager). A host placed in a level keeps the key of its actor; a host spawned at runtime needs a SaveIdentity.Key of its own: the party hosts of PulseQuestOnlineBridge use the id of their party (save scope World).
How it works
- The manager saves and loads asynchronously (
EPulseSaveTiming::Asynchronous): a save runs through the event queue of the manager and hands over its bytes onceOnSavedEventfired; a load startsLoadQuestManagerand reports back onceOnLoadedEventfired, with the report of the load. PulseSave waits for both. - Quest managers load after inventories and equipment (load priority -20), so objectives that count items see them.
ResetToDefaults(the carry rule Reset of a respawn) resets the manager (ResetQuestManager).- Only the authority saves and loads. The players of a shared quest host are not saved; add them again after loading.
Pulse.Message.Quest.Startedof a restored quest carriesCatchUp = Load, so toasts leave it out.
Own save systems
Save the quest save game yourself: SaveQuestManager / LoadQuestManager of the manager with a FPulseQuestSaveGame, or the bytes of SaveToBytes (synchronous, quests that are still queued are not included) and BeginLoadFromBytes.
Versions
The quest save game has its own version (PULSE_QUEST_SAVE_GAME_VERSION, also GetSaveVersion of the byte save); data of a newer version is refused. Saves of the archived PulseQuestSaveBridge (model UPulseQuestManagerSaveModel) are not read anymore (Pulse Quest was not released yet).