Storage
A storage is the place where PulseSave keeps the bytes of its slots. PulseSave turns objects into a save game, checks it and migrates it; the storage only keeps bytes. The storage decides where they go: the disk of this machine, a cloud, a database or the backend of a platform.
PulseSave brings three storages. Files keeps every slot in folders on this machine and needs no setup; it is the default. Platform keeps the slots in the save games of the platform: the save data of a console user, or a cloud the platform syncs. Memory keeps them in memory only, for specs, servers without a disk and previews. A game that wants another place derives its own storage in C++ or Blueprint and names it in the settings. The code that saves and loads does not change.
Two more things work on top of every storage. Byte layers compress, check and encrypt the bytes of each entry. A Mirror keeps two storages in step, for example the folders of this machine and a cloud: the game works with the first one, and the second one gets the slots in the background.
Purposes
Every storage serves a purpose, a gameplay tag. Each purpose has one storage per game instance, kept by the storage subsystem (UPulseSaveStorageSubsystem).
| Purpose | What it keeps | Used by |
|---|---|---|
Pulse.Save.Storage.Game | The slots of the game: menus, auto saves, Ironman | The save game (UPulseSaveGameSubsystem), the session, the menus |
Pulse.Save.Storage.Profile | The profile of each local player | The profiles (UPulseSaveProfileSubsystem) |
Pulse.Save.Storage.Server | Data the server keeps for itself and its players, such as characters | Add-ons such as PulseSaveCharacters |
A game can add purposes of its own. Two purposes may use the same storage class: each gets its own storage object, and Files gives each purpose its own folder.
Owners and slots
A storage keeps the slots of an owner (FPulseSaveOwner). There are three kinds:
| Kind | Made with | Used for |
|---|---|---|
| Local User | FPulseSaveOwner::LocalUser(UserId), Blueprint Make Local User Owner, Make Primary User Owner | A user of this machine: its game saves, its profile |
| Server | FPulseSaveOwner::Server(), Make Server Owner | The machine as a server: the saves of a dedicated server |
| Player Key | FPulseSaveOwner::Player(Key), Make Player Key Owner | A player known by a key (1 to 128 characters, no control characters, not only dots or spaces), such as a player id or an account of a backend |
The save game keeps its slots for the server on a dedicated server, else for the first local user of the machine (UPulseSaveGameSubsystem::GetOwner). A profile belongs to the user of its local player.
A slot holds entries. An entry id (FPulseSaveSlotEntryId) has an optional category and an identifier, for example Game or Chunks/Forest. Slot names and the parts of an entry id follow one rule that every storage accepts (Pulse::Save::Storage::IsValidName): 1 to 64 characters, no control characters, no / or \, and not only dots or spaces. Slot names compare without case.
FPulseSaveSlotRef names one slot: the storage, the owner and the slot name. Make it with:
UPulseSaveGameSubsystem::MakeSlot(SlotName)(Blueprint Make Slot) for a slot of the save game.UPulseSaveStorageSubsystem::MakeSlotRef(Purpose, Owner, SlotName)(Blueprint Make Slot Ref) for any other slot.
The save game, the session and the profiles keep their slots through a slot ref, so they work with every storage.
Who uses which storage
- The save game saves, loads, lists and deletes in the storage of
Pulse.Save.Storage.Game. When that storage changes, it lists its slots again; until the answer comes,IsSlotListReadyis false andGetSlotsis empty. When the storage tells of slots it took from elsewhere (a mirror after a round), it lists them again on the next tick. - The session writes its auto saves into the slot of the running game. Save Game and Load Game give it a slot of the storage of the save game.
- Profiles use the storage of
Pulse.Save.Storage.Profile.UPulseSaveProfileSubsystem::SetStoragegives the profile of one player a storage of its own, for example the cloud of that player or a test storage. - Add-ons ask the storage subsystem for the storage of their purpose. PulseSaveCharacters keeps the characters of players in the storage of
Pulse.Save.Storage.Server. - Your own code calls
UPulseSaveStorageSubsystem::GetStorage(Purpose)and uses the storage directly (see Use a storage directly).
Rules every storage keeps
A storage is a provider of PulseFoundation (UPulseProvider). The base class UPulseSaveStorage keeps these rules for every storage, also for one written in Blueprint:
- Answers come later. The caller gets every answer on the game thread on a later tick, never inside the call that asked, even when the storage answers at once. Only in teardown and while
FlushPendingWorkruns (see Teardown and tools) an answer reaches the caller as soon as the storage gives it. - One request after another per slot. Requests on one owner and slot reach the storage in the order they were made. A storage never sees a read before the write that was asked first. List Slots is not ordered with the slot requests.
- A package lands whole or not at all. Write Entries gets a package of entries. Success means every entry landed; a failure means none did.
- Checked before the storage sees it. An invalid owner, slot name or entry, an entry twice in a package, an owner kind the storage does not keep, or a package larger than the storage allows is refused with Invalid Name, Unsupported or Full. The operation of the storage is not called.
- No answer forever. A request without an answer fails after Storage Timeout Seconds of the settings (60 by default, 0 waits forever). The first answer of a request wins; later ones are ignored.
Work that takes several requests, such as “read, decide, write”, runs as slot work: UPulseSaveStorage::EnqueueSlotWork starts it after all earlier requests and work on the same slot. Requests made with its handle run at once inside the slot. The work calls Finish on its handle when its last answer came. Work that never finishes is ended after three times the storage timeout (with a timeout of 0 it is never ended), so the slot does not stay blocked.
Failures
A storage answers a failure with Pulse::Save::Storage::MakeFailure(Reason, Diagnosis, NativeCode). The player sees the text of the reason; the diagnosis and the native code (a platform error, an HTTP status) go to the log through FPulseSaveStorageFailureDetails.
| Reason | When |
|---|---|
Pulse.Result.Failure.Save.Storage.NotFound | The slot, the entry or the asked version is not there |
Pulse.Result.Failure.Save.Storage.InvalidName | An owner, slot or entry the storage cannot keep (name rule, reserved entry, a path too long) |
Pulse.Result.Failure.Save.Storage.Unsupported | The storage does not keep this kind of owner or does not do this operation |
Pulse.Result.Failure.Save.Storage.ReadFailed | Reading failed (disk, network) |
Pulse.Result.Failure.Save.Storage.WriteFailed | Writing failed; nothing of the package landed |
Pulse.Result.Failure.Save.Storage.Damaged | The stored bytes failed the storage’s own check |
Pulse.Result.Failure.Save.Storage.Full | No room: disk full, a quota, the largest package of the storage |
Pulse.Result.Failure.Save.Storage.Unavailable | The storage cannot be reached now (offline, no signed-in user) |
Timeouts and cancelled requests use the reasons of PulseFoundation.
Versions and write modes
Every entry has a current version. A storage may also keep the version before it, the previous version. A load falls back to the previous version when the current one is damaged.
A package names how it treats the versions it replaces (EPulseSaveWriteMode):
| Mode | What happens | Used by |
|---|---|---|
| New Version | The current version of each written entry becomes its previous version | Every save |
| Replace Current | Only the current version is replaced; the previous one stays | A meta written alone (WriteSlotMeta), such as a new name |
| Repair | Like Replace Current after a damaged load; the storage may keep the replaced bytes aside for diagnosis | A load that fell back to the previous version writes it back |
With bReplaceSlot on, the entries of the slot that are not in the package go in the same step. This replaces a whole slot at once, for example after a download from a cloud.
Capabilities
GetCapabilities tells what a storage can do. It is answered from members, without any I/O.
| Field | Meaning |
|---|---|
SupportedOwners | The owner kinds it keeps; other kinds fail with Unsupported |
bKeepsPreviousVersion | New Version packages keep the previous version, and a damaged load falls back to it |
bRemote | The data lives on another machine: answers take time and fail offline |
MaxPackageBytes | The largest package in bytes; 0 for no limit |
The default of the base class: every owner kind, no previous versions, not remote, no limit. With bRemote off a profile has its data when GetProfile returns. With bRemote on it comes a moment later: wait with UPulseSaveProfileSubsystem::WhenProfileLoaded (Blueprint Wait For Profile (Async)).
Files on disk
Files (UPulseSaveStorage_Files) is the storage of every purpose that has no other class. It keeps each slot in a folder:
<Root>/<Purpose>/<Owner>/<Slot>/
[<Category>/]<Identifier>.sav the current version
[<Category>/]<Identifier>.sav.prev the previous version
[<Category>/]<Identifier>.sav.damaged bytes a Repair package replaced
- Root:
RootDirectoryOverrideof the storage, else Root Directory of the PulseSave settings, elseSaved/SaveGames. - Purpose:
FolderOverrideof the storage, else the last part of the purpose tag (Game,Profile,Server);Defaultfor a storage without a purpose. - Owner:
User_<id>for a local user,Server, orPlayers/<key>for a player key. - Names: characters other than
A-Z,a-z, digits,_,-and inner spaces are written as%XX, so a slot or entry can have any name the name rule allows. Lists give back the exact names. A path too long for the file system is refused with Invalid Name.
Examples:
Saved/SaveGames/Game/User_0/Save_0001/Game.sav
Saved/SaveGames/Game/User_0/Save_0001/Game.sav.prev
Saved/SaveGames/Game/User_0/Save_0001/slot_meta.sav
Saved/SaveGames/Profile/User_0/Profile/
Saved/SaveGames/Server/Players/<key>/
How Files writes:
- A package is written to temporary files first. A journal in the slot folder is the commit point; then the files are moved into place. A crash leaves the old package or the new one, never a mix. The next request on the slot finishes a committed package before it does anything else.
- Every file starts with a header: the package that wrote it, the size and check sum of its bytes and the time of the package. A file whose header or bytes do not match answers Damaged. Lists and reads take the time from the header, exact also where the file system keeps the times of files only to the second: all entries of a package have the same time, and a copied slot keeps the time of its source.
- All disk work runs on background tasks, one after another per slot folder (also across Files storages on the same folder). List Slots reads the folders of the owner on a task of its own. The answers come on the game thread.
- The process waits for these writes when the engine exits.
- The previous version is kept while Enable Slot Backups of the settings is on.
bOverrideKeepPreviousandbKeepPreviousVersionset it for one storage object. GetOwnerDirectoryandGetSlotDirectorygive the folders for diagnostics, tools and specs. Never write into them.
Platform save games
Platform (UPulseSaveStorage_Platform) keeps the slots in the save game system of the platform (ISaveGameSystem, which the save slots of the engine use too): the save data of a console user, a cloud the platform syncs, Saved/SaveGames on desktop platforms. Name it in Storage Classes for a purpose, or in Default Storage Class for all of them. Its options are properties of the storage: to change them, make a Blueprint of Platform, set them there and name that class instead.
A save system keeps one save game per name and has no folders, so Platform builds its slots from save games:
<Prefix>_<Owner>_I0, <Prefix>_<Owner>_I1 the index of the owner (its slots and entries), kept twice
<Prefix>_<Owner>_B<number> one version of one entry
- Prefix: Name Prefix of the storage (1 to 24 letters or digits), else
Pulseand the last part of the purpose:PulseGame,PulseProfile,PulseServer. A Name Prefix that breaks the rule is logged once, and the prefix of the purpose is used. - Owner:
Ufor a local user (U<index>while the names hold the user, see Users),Sfor the server,Pand a hash of the key for a player key. The index keeps the key itself, so two keys with the same hash never read each other’s slots (Invalid Name). - Users keeps the slots of the users of one machine apart. Automatic puts the user index into the names where the save system keeps every user in one place (desktop platforms), In Names always does, By System leaves it to the save system; where that keeps one user only, only the first user of the machine gets slots and the others answer Unsupported. The server and player keys keep their slots in the save data of the first user.
- A platform without save system, or a local user without a user index of the platform, answers Unavailable.
How Platform writes:
- A package writes a save game for each entry first, then the copy of the index that is not the newest (the commit point), then the other copy. A crash leaves the old package or the new one, never a mix. A damaged copy of the index falls back to the other one; save games no version needs any more go once both copies agree.
- A copy the save system cannot read at the moment (an error instead of the data) is never passed over, because it may hold the newest package: every request of that owner answers Read Failed until the copy reads again.
- With no sound copy left, the slots of the owner are lost (logged as an error), and the next write starts a new index that uses the save game names again.
- An index written by a newer version of PulseSave is never written over: requests on its slots answer Damaged.
- Every call to the save system runs on one background pipe for the whole process, one after another; the answers come on the game thread. The process waits for these writes when the engine exits.
- Keep Previous Version (on by default) keeps the version before the current one of every entry. Max Package Bytes refuses larger packages with Full, because platforms limit the size of their save data (0: no limit).
GetSaveNameBase(Owner)gives<Prefix>_<Owner>for diagnostics, tools and specs. Never write save games of these names yourself.
Memory only
Memory (UPulseSaveStorage_Memory) keeps the slots in memory: nothing reaches a disk, and the slots are gone when the process ends. It suits specs, a server without a disk and previews in the editor.
- Every operation takes effect at once; the answers come on the next tick, like those of every storage.
- Shared Space: storages with the same name share their slots while the process runs, so a new game instance or play session finds them again. Without one (None) the slots go with the storage object.
- Keep Previous Version (on by default) keeps the version before the current one. Max Total Bytes limits the bytes of every version it holds (with a Shared Space: every slot of the space, whichever storage wrote it); a package that does not fit fails with Full (0: no limit).
- Clear All removes every slot (with a Shared Space: of every storage on it), Get Total Bytes tells how much it holds. In C++,
Put,FindandHasSlotreach the bytes directly (specs, tools).
Byte layers
Byte layers work on the bytes of every entry before a storage keeps them and after it gives them back, one layer after another: compression, a check sum, encryption. The base class UPulseSaveStorage applies them, so they work for every storage, also one of the game; the storage only sees the result. All layers are off by default.
| Setting | What it does |
|---|---|
| Compression | None, Fast (quick to write, a little larger), Normal or Small (smallest, slowest to write); Oodle Kraken, reading is fast at every level. An entry that does not get smaller stays as it is. |
| Checksum | Keeps a CRC32 of the bytes. A read of changed bytes answers Damaged, so a load falls back to the previous version. |
| Cipher | Encrypts the bytes with a class of the game (see Encryption); empty: no encryption. |
| Read Unencrypted | With a cipher: entries written without encryption still read (saves from before it was turned on). Off: such an entry answers Damaged, so nobody can put unencrypted bytes in place of a save. |
Set them in Project Settings > Pulse > Save > Storage, block Bytes: Default Byte Layers for every purpose, Byte Layers By Purpose for one purpose (the profile without compression, the server encrypted). SetByteLayers(Layers) (Blueprint Set Byte Layers) gives one storage object its own; GetByteLayers tells which layers apply to it.
- Entries keep how they were written. An entry written with layers starts with a header that names its layers; bytes without it were written without layers and read as they are. Turning a layer on or off later still reads the slots of before; encrypted entries need their cipher. A request that waits for its slot takes the layers of when it runs.
- Sizes count after the layers. List Slots and List Entries tell the bytes as the storage keeps them, and Max Package Bytes of a storage is checked on them.
- Large entries on a task. Entries and packages from 64 KiB on go through the layers on a background thread (and so does the work of a cipher that allows it); the answers come on the game thread as always.
- Failures. A cipher class that does not load fails the write with Write Failed, and so does a failed encryption: nothing of the package lands. Changed bytes, a wrong check sum and bytes the cipher refuses read as Damaged. Encrypted bytes without a cipher and bytes of a newer PulseSave answer Unsupported, so a load does not take the previous version for them.
- A mirror passes the layers set on it to both of its storages.
Encryption
PulseSave brings no key. AES (UPulseSaveCipher_AES) encrypts with AES-256 in counter mode and checks with HMAC-SHA1 (encrypt, then authenticate), on a background thread. Make a Blueprint or C++ class of it, give it a Key (a long random text, not a word) and name that class in Cipher. Without a key it encrypts nothing and every write fails. Override Get Key to take the key from somewhere else; it gets the entry (purpose, owner, slot, entry).
Each entry is bound to its place: the purpose, the owner kind, the key of a player owner and the entry id (FPulseSaveCipherContext::MakeBinding). Bytes moved to another entry, another player or another purpose do not read. A copied slot still loads (the slot name is not part of the binding), and so does the slot of a local user that the platform gives another user next time.
A key inside the game can be found by whoever has the game. Encryption keeps players from editing their saves; it does not keep secrets.
A cipher of your own derives from Pulse Save Cipher (UPulseSaveCipher):
- Blueprint: implement Encrypt and Decrypt. They run on the game thread.
- C++: override
MakeWork(Context)and return anIPulseSaveCipherWorkwithEncryptandDecrypt. A work whoseCanRunOnAnyThread()is true runs on a background thread, so it holds plain values only (keys, the binding), never objects. A null work means the cipher cannot work now: the write and the read answer Unavailable, and a load keeps the entry instead of taking its previous version. Pulse::Save::Storage::MakeAESWork(Secret, Binding)gives the work of the AES cipher without an object, for specs and tools that read the saves of the game.
Mirror
A mirror (UPulseSaveStorage_Mirror, Mirror) keeps two storages in step. The primary storage answers every request of the game; the secondary storage gets the slots in the background. The usual case is a cloud: the folders of this machine answer at once, the cloud gets every save a moment later, and a save made on another machine comes back here. The game saves and loads as before and never waits for the secondary storage.
Set up a mirror
- By a plugin. A plugin with a cloud calls
UPulseSaveStorageSubsystem::AddMirrorStorage(Purpose, StorageClass)inStartupModuleandRemoveMirrorStorageinShutdownModule. From then on the storage of that purpose is a mirror: the class of the settings is its primary storage, the class of the plugin its secondary storage. PulseOnlineSaveBridge does this for the save game and the profiles (see Cloud saves). The newest registration of a purpose wins;FindMirrorStorage(Purpose)tells which class it is. - In the settings. Name Mirror, or a Blueprint of it, in Storage Classes for a purpose. On the Blueprint, Primary Storage Class is the storage that answers at once (empty: the class of the settings for the purpose, Files when that is the mirror itself) and Secondary Storage Class the storage kept in step (empty: the class a plugin registered with Add Mirror Storage).
- At runtime.
SetStorages(Primary, Secondary)on a mirror uses storage objects you made (specs, a game that makes its storages itself). Rounds that run end; the storages of before finish what they were asked and end. A null primary storage is made from Primary Storage Class; a null secondary storage means none. A storage that already works for another owner, or a mirror, is refused.
A class of the settings that is a mirror itself and storages set at runtime with SetStorage stay as they are when a plugin registers a mirror storage. Without a secondary storage, or for owners it does not keep, the mirror is the primary storage alone. GetPrimaryStorage and GetSecondaryStorage give both storages.
Rounds
A round compares both storages for one owner. A round starts:
- at the first request of an owner,
- after each change of the game (a save, a delete),
- when the secondary storage tells of changes (a cloud after a login),
- every Sync Interval Seconds of the mirror options (300 by default; 0: never by time),
- when the game asks:
Sync(Owner),RequestSync(Owner, Done)in C++, or the storage subsystem’sRequestSync(Purpose, Owner, Done)(Blueprint Sync Save Storage (Async)), which answers Success on the next tick when there is nothing to compare (the storage of the purpose is no mirror, or no secondary storage keeps the slots of the owner).
Rounds of one owner run one after another, at least 2 seconds apart. After a failed round (the cloud could not be reached) the next one waits 30 seconds, and so does the round after one that left a slot or a choice of the game for later (a slot in use, a slot that changed while the round ran). A round the game waits for (Sync, RequestSync, a decided conflict) and a note of the secondary storage (a login) cut the wait short; after a slot left for later, so does a change of the game. Nothing in PulseSave waits for a round by itself: a main menu that wants the newest slots of the cloud shows “Syncing…” with Sync Save Storage (Async) before it offers Continue.
A round lists the slots of both storages and compares them with its record: the slots as both storages held them when they were last the same. The record lives in the reserved slot _PulseMirror of the primary storage (Pulse::Save::MirrorRecordSlotName), one entry per class of the secondary storage and its account (GetOwnerAccount), so another account of a cloud on the same machine compares from a record of its own. In the secondary storage the reserved slot holds the marks of deletes (below). The reserved slot is never a slot of the game: List Slots of every storage leaves it out, and nobody can save into it.
The round copies whole slots, with all of their entries:
| Primary storage | Secondary storage | The round |
|---|---|---|
| changed since the record | as in the record | copies the slot to the secondary storage |
| as in the record | changed since the record | copies the slot to the primary storage |
| gone | as in the record | deletes the slot in the secondary storage |
| as in the record | gone | deletes the slot in the primary storage |
| changed | gone, or the other way round | copies the changed slot back: a change wins over a delete |
| changed | changed | decides a conflict, unless both hold the same package |
| there, unknown to the record | not there | copies the slot to the other storage (also the other way round) |
| there, unknown to the record | there | takes both as the same with the same package, else decides a conflict |
- A cleared storage gets its slots back. A storage that holds none of the slots the record knows was emptied outside the mirror (a deleted save folder, a cleared cloud). The round forgets those slots and copies them back instead of deleting them in the other storage.
- Deletes of other machines still arrive. Before a round deletes slots in the secondary storage, it notes each of them there with the version it deletes (the marks of deletes: the entry
Deletesof the reserved slot, the newest 128 deletes of the owner). When the secondary storage holds none of the slots the record knows, a slot a mark names in exactly the version the record knows was deleted by a mirror on another machine and goes here too, also when those were the last slots of the owner. Every other slot is copied back, also when only the slots went and the reserved slot stayed. A machine that missed the last versions of a deleted slot copies its own version back: a delete can come back, but no slot is ever deleted in a version no mirror deleted. Marks that do not read (Damaged, Unsupported, Invalid Name) count as none; a secondary storage that cannot be read now (Unavailable, Read Failed, Timeout) ends the round, and a later one tries again. - Slots in use wait. Before a round replaces or deletes a slot in the primary storage it asks
IsSlotInUse. By default that asks the checks of the storage subsystem (AddSlotInUseCheck): the save game holds the slot of the running game, a profile its slot while it has changes, is read or saved, or an object of it loads. Such a slot waits for a later round (see the waits above). Copies to the secondary storage are not held back. - Slots of play sessions in the editor stay on this machine.
ShouldMirrorSlot(Owner, SlotName)leaves out slots that end in_PIE<number>(the profiles of play windows); override it to keep more slots on this machine. - The game hears about new slots. After a round the mirror tells which slots of the primary storage it changed (
OnSlotChangedNativeof the storage, andOnSlotChangedNativeof the storage subsystem with the purpose). The save game lists its slots again, the menus follow throughOnSlotsChanged, and a profile without changes reads its slot again. - Copies keep their source. A copy keeps the package id and the time of its source, so the next round finds both storages the same. The version a copy replaces stays as the previous version where the target keeps previous versions.
On Sync Finished (C++ OnSyncFinishedNative) tells the end of each round with Success or its first failure. IsSyncing(Owner) is true while a round of the owner runs, while one that was asked for (the first request of the owner, a change of the game, a note of a storage, Sync) only waits for the 2 seconds between rounds, and while a RequestSync or a decided conflict of the owner waits for its answer. It is false while the next round only waits out the 30 seconds after a failed round or after a round that left a slot for later, so an indicator does not stay on while the game holds a slot the cloud has a newer version of.
Conflicts
A slot both storages changed since the record is a conflict. Conflict Rule of the mirror options decides:
| Rule | Keeps |
|---|---|
| Newer (default) | The newer version (the time of its last package); the version of the primary storage on a tie |
| Primary | Always the version of the primary storage (this machine) |
| Secondary | Always the version of the secondary storage (the cloud) |
| Ask | Nothing yet: the game decides |
The kept version is copied over the other one, which stays as the previous version where that storage keeps previous versions. ChooseVersion(Conflict) decides each conflict and applies the rule by default; override it in a Blueprint or C++ class of the mirror for rules of the game (the version with the longer play time, ask only for some slots), and return Later to leave a conflict to the game.
With Ask or Later both storages keep their version. The round fires On Conflict (C++ OnConflictNative) once per conflict, and GetConflicts(Owner) lists the open ones (FPulseSaveMirrorConflict: owner, slot, and time, size and package of both versions). A menu reads the meta of both versions (Read Slot Meta on the slot in GetPrimaryStorage() and in GetSecondaryStorage()) and calls ResolveConflict(Owner, SlotName, Choice) (C++ RequestResolveConflict with a done callback): the next round copies the chosen version over the other one, if both storages still hold the versions of the conflict. ResolveConflict answers false without such a conflict, for Later, and for Secondary while the game uses the slot. UPulseSaveStorageSubsystem::FindMirror(Purpose) gives a menu the mirror of a purpose (null when it has none).
RequestResolveConflict answers:
| Answer | When |
|---|---|
| Success | The chosen version landed |
| The failure of the round or of the copy | The round failed before the copy (the cloud could not be reached) or the copy failed; the choice stays for a later round, unless the other storage refused the version (Refused versions) |
| Not Found | No such conflict, or the versions of the conflict changed before the chosen one was copied (also while the round copied, or by a save of the game); the choice is dropped and a later round decides the new versions |
| Busy | The game uses the slot: at once for Secondary; when the round finds the slot in use, the choice waits for a later round |
| Invalid | Later |
| Unsupported | Nothing mirrors the slots of the owner: no secondary storage, or one that keeps no slots of the owner’s kind |
| Cancelled | The mirror ended, or SetStorages replaced its storages, before the chosen version landed |
Refused versions
A version the other storage refuses (Full: too large for it or no room; Invalid Name: a name it cannot keep), or one that does not read (Damaged), fails the round that tried it. Later rounds leave that version alone and end with Success; GetRefusedSlots(Owner) lists them (FPulseSaveMirrorRefusal: owner, slot, the storage that holds the version, the version and the failure). The mirror tries a refused version again when it changes, when the game asks for a round (Sync, RequestSync), after a delete in the storage that refused it (Full only), with other storages or other byte layers, and after a restart (the refusals are not kept in the record).
Options and limits
- Mirror Options in the settings (Storage, block Mirror): Conflict Rule and Sync Interval Seconds.
SetMirrorOptionsgives one mirror its own. - Byte layers set on the mirror go to both storages; the mirror passes the bytes on unchanged, and each storage checks its own size limit.
- Requests of the game to the mirror fail after Storage Timeout Seconds like those of any storage; each step of a round waits as long as its storage allows.
- A round runs under the account the secondary storage names at its start. When that account changes while the round runs (another online login of the player), the round ends with Unavailable and writes no record: at once when the secondary storage tells of the change (
NotifyOwnerAccountChanged), else when it ends. The next round compares under the new account with its own record. - Requests of the game wait for the primary storage only. A flush (
FlushPendingWork, the end of the game instance) does not wait for a secondary storage that is remote: a save made just before the game quits reaches the cloud at the next start. - The answers of
RequestSyncandRequestResolveConflictnever come inside the call, except in teardown and during a flush. - Two machines that write the same slot between two rounds make a conflict; the rule decides it at the next round of either machine. Without a newer version on either side nothing is copied.
What a secondary storage needs
Any storage can be the secondary storage. To keep rounds short and free of false conflicts, it:
- keeps the package id and the time of a package (
Pulse::Save::Storage::GetOrMakePackageId(Package),GetPackageTime(Package)) and answers them in List Entries and List Slots; - answers in List Slots the slot info its List Entries give:
Pulse::Save::Storage::AddVersionToSlotInfobuilds it from the entries (the newest version decides time and package); - tells the account that holds the slots of an owner (
GetOwnerAccount; a cloud: the signed-in user, empty without one), or nothing when the slots belong to the owner itself, and callsNotifyOwnerAccountChanged(Owner)when that account changes: requests of the owner asked before that still wait for their slot or for the byte layers fail Unavailable, so nothing asked under one account runs under the next one, and a mirror ends a round of the account of before; - calls
NotifySlotChanged(Owner, SlotName)when slots changed without its own requests (empty name: several slots), for example after a login; - keeps the reserved slot
_PulseMirrorlike any other slot (the marks of deletes); without it, slots that another machine deleted as the last ones of an owner come back; - sets
bRemotein its capabilities when the data lives on another machine.
The Pulse Debugger shows each mirror in the snapshot of its storage (category Save): its storages and options, and per owner the account, a round that runs or waits, the wait after a failed round, the last round, open conflicts and refused versions. The cheats PulseSaveMirror and PulseSaveMirrorResolve do the same in the console (see Console).
Wrapper
A wrapper is a storage around the storage of a purpose: it adds something to every save without knowing which storage the project uses, such as older versions of each slot or a count of what is written. UPulseSaveStorage_Wrapper hands every request to its inner storage as it is and answers with its answer; a plugin derives from it and overrides the operations it changes.
- Register it in
StartupModuleof the plugin withUPulseSaveStorageSubsystem::AddStorageWrapper(Purpose, WrapperClass)and take it back inShutdownModulewithRemoveStorageWrapper. Storages of the purpose made from then on are the wrapper. Without a registration nothing changes. - Order: wrappers outside, a mirror inside. The inner storage of a wrapper is the wrapper registered before it, else the mirror of the purpose (
AddMirrorStorage), else the class of the settings. The newest registration is the outermost one; a class registered again moves to the outside.FindInnerStorageClass(Purpose, WrapperClass)andGetUnwrappedStorageClass(Purpose)tell the classes. - Inner Storage Class names the inner storage of one wrapper class instead;
SetInnerStorageuses a storage you made (specs). A class of the settings that is a wrapper itself and storages set at runtime get no wrapper around them. - The inner storage applies the byte layers; the wrapper hands bytes on as it gets them. It tells the changes of its inner storage (
OnSlotChangedNative) and counts its pending work. FindMirror(Purpose)and the save game look through wrappers (UPulseSaveStorage_Wrapper::Unwrap).
A wrapper that keeps data of its own puts it into a reserved slot. Pulse::Save::AddReservedSlotName(Name) and AddReservedSlotPrefix(Prefix) (in StartupModule, taken back with RemoveReservedSlotName and RemoveReservedSlotPrefix) add to _PulseMirror, the slot of the record of a mirror. Reserved slots never show in the answer of List Slots or in the lists of the game. A mirror inside a wrapper keeps them in its primary storage and never copies them to its secondary storage; only _PulseMirror itself is refused from outside the mirror. Start the names with _ and the name of the plugin, so they do not meet the names of the game.
#include "Storage/PulseSaveStorageSubsystem.h"
#include "Storage/PulseSaveStorage_Wrapper.h"
// A wrapper that counts the packages written (MyCountingWrapper.h)
UCLASS()
class UMyCountingWrapper : public UPulseSaveStorage_Wrapper
{
GENERATED_BODY()
public:
int32 Writes = 0;
protected:
virtual void WriteEntries_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName, const FPulseSaveStoragePackage& Package) override
{
++Writes;
Super::WriteEntries_Implementation(RequestId, Owner, SlotName, Package);
}
};
// StartupModule of the plugin
UPulseSaveStorageSubsystem::AddStorageWrapper(Pulse::Save::Storage::TAG_PurposeGame, UMyCountingWrapper::StaticClass());
Write a storage in C++
Derive from UPulseSaveStorage and override the operations. Each operation gets a request id and answers it once with its Finish function, now or later:
| Operation | Answer with |
|---|---|
ListSlots_Implementation(RequestId, Owner) | FinishListSlots(RequestId, Result, Slots) |
ListEntries_Implementation(RequestId, Owner, SlotName) | FinishListEntries(RequestId, Result, Entries) |
ReadEntry_Implementation(RequestId, Owner, SlotName, Entry, Version) | FinishRead(RequestId, Result, Bytes, Info) (or FinishReadMoved) |
WriteEntries_Implementation(RequestId, Owner, SlotName, Package) | FinishWrite(RequestId, Result) |
DeleteSlot_Implementation(RequestId, Owner, SlotName) | FinishDelete(RequestId, Result) |
DeleteEntry_Implementation(RequestId, Owner, SlotName, Entry) | FinishDelete(RequestId, Result) |
An operation you do not override answers Unsupported. List Entries lists the current versions, the meta entry included. Read Entry answers Not Found for a missing slot, entry or version. Write Entries gives all entries of a package one time, GetPackageTime(Package): the time of its source for a copy of a slot, else now. A storage that a mirror keeps in step also keeps the package id and tells of changes from elsewhere (see What a secondary storage needs).
This storage keeps its slots in a map (the Memory storage of PulseSave does the same with previous versions, a size limit and shared spaces). It answers at once on the game thread; PulseSave still delivers the answers on a later tick.
// MyMapStorage.h
#pragma once
#include "CoreMinimal.h"
#include "Storage/PulseSaveStorage.h"
#include "MyMapStorage.generated.h"
/** Keeps slots in a map while the storage lives (no previous versions). */
UCLASS()
class UMyMapStorage : public UPulseSaveStorage
{
GENERATED_BODY()
protected:
virtual void ListSlots_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner) override;
virtual void ListEntries_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName) override;
virtual void ReadEntry_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName, const FPulseSaveSlotEntryId& Entry, EPulseSaveEntryVersion Version) override;
virtual void WriteEntries_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName, const FPulseSaveStoragePackage& Package) override;
virtual void DeleteSlot_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName) override;
virtual void DeleteEntry_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName, const FPulseSaveSlotEntryId& Entry) override;
private:
/** One slot: its name as written, its entries and when it was written. */
struct FSlot
{
FString Name;
TMap<FPulseSaveSlotEntryId, TArray<uint8>> Entries;
FDateTime ModifiedAt;
};
/** Owner and slot name without case. */
using FSlotKey = TPair<FPulseSaveOwner, FString>;
static FSlotKey MakeKey(const FPulseSaveOwner& InOwner, const FString& InSlotName) { return FSlotKey(InOwner, InSlotName.ToLower()); }
TMap<FSlotKey, FSlot> Slots;
};
// MyMapStorage.cpp
#include "MyMapStorage.h"
using namespace Pulse::Save::Storage;
void UMyMapStorage::ListSlots_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner)
{
TArray<FPulseSaveStorageSlotInfo> slots;
for (const TPair<FSlotKey, FSlot>& pair : Slots)
{
if (pair.Key.Key != Owner)
continue;
FPulseSaveStorageSlotInfo& info = slots.AddDefaulted_GetRef();
info.SlotName = pair.Value.Name;
info.ModifiedAt = pair.Value.ModifiedAt;
}
FinishListSlots(RequestId, FPulseResult::Success(), slots);
}
void UMyMapStorage::ListEntries_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName)
{
const FSlot* slot = Slots.Find(MakeKey(Owner, SlotName));
if (!slot)
{
FinishListEntries(RequestId, MakeFailure(TAG_FailureNotFound), {});
return;
}
TArray<FPulseSaveStorageEntryInfo> entries;
for (const TPair<FPulseSaveSlotEntryId, TArray<uint8>>& entry : slot->Entries)
{
FPulseSaveStorageEntryInfo& info = entries.AddDefaulted_GetRef();
info.Entry = entry.Key;
info.SizeBytes = entry.Value.Num();
info.ModifiedAt = slot->ModifiedAt;
}
FinishListEntries(RequestId, FPulseResult::Success(), entries);
}
void UMyMapStorage::ReadEntry_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName, const FPulseSaveSlotEntryId& Entry, EPulseSaveEntryVersion Version)
{
const FSlot* slot = Slots.Find(MakeKey(Owner, SlotName));
// No previous versions: only the current one can be found
const TArray<uint8>* bytes = slot && Version == EPulseSaveEntryVersion::Current ? slot->Entries.Find(Entry) : nullptr;
if (!bytes)
{
FinishRead(RequestId, MakeFailure(TAG_FailureNotFound), {}, FPulseSaveStorageEntryInfo());
return;
}
FPulseSaveStorageEntryInfo info;
info.Entry = Entry;
info.SizeBytes = bytes->Num();
info.ModifiedAt = slot->ModifiedAt;
FinishRead(RequestId, FPulseResult::Success(), *bytes, info);
}
void UMyMapStorage::WriteEntries_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName, const FPulseSaveStoragePackage& Package)
{
FSlot& slot = Slots.FindOrAdd(MakeKey(Owner, SlotName));
slot.Name = SlotName;
if (Package.bReplaceSlot)
slot.Entries.Reset();
for (const FPulseSaveStorageEntryBytes& entry : Package.Entries)
slot.Entries.Add(entry.Entry, entry.Bytes);
// A copy of a slot keeps the time of its source
slot.ModifiedAt = GetPackageTime(Package);
FinishWrite(RequestId, FPulseResult::Success());
}
void UMyMapStorage::DeleteSlot_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName)
{
const bool bRemoved = Slots.Remove(MakeKey(Owner, SlotName)) > 0;
FinishDelete(RequestId, bRemoved ? FPulseResult::Success() : MakeFailure(TAG_FailureNotFound));
}
void UMyMapStorage::DeleteEntry_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName, const FPulseSaveSlotEntryId& Entry)
{
FSlot* slot = Slots.Find(MakeKey(Owner, SlotName));
const bool bRemoved = slot && slot->Entries.Remove(Entry) > 0;
FinishDelete(RequestId, bRemoved ? FPulseResult::Success() : MakeFailure(TAG_FailureNotFound));
}
The base class keeps the rules above: this storage never sees two requests on one slot at the same time, and its answers reach the caller on a later tick.
Long work on a task
Disk and network work belongs on a task. A task never touches the storage object: it keeps the inbox (GetInbox()) and posts its answer there from any thread. The payload is the answer struct of the operation: FPulseSaveStorageReadAnswer for Read Entry, FPulseSaveStorageListSlotsAnswer for List Slots, FPulseSaveStorageListEntriesAnswer for List Entries, and an empty struct for writes and deletes.
#include "Misc/FileHelper.h"
#include "Misc/Paths.h"
#include "Tasks/Task.h"
void UMyFolderStorage::ReadEntry_Implementation(FPulseRequestId RequestId, const FPulseSaveOwner& Owner, const FString& SlotName, const FPulseSaveSlotEntryId& Entry, EPulseSaveEntryVersion Version)
{
using namespace Pulse::Save::Storage;
if (Version == EPulseSaveEntryVersion::Previous)
{
FinishRead(RequestId, MakeFailure(TAG_FailureNotFound, TEXT("no previous versions")), {}, FPulseSaveStorageEntryInfo());
return;
}
// Plain values and the inbox only, never the storage
TSharedRef<FPulseProviderInbox, ESPMode::ThreadSafe> inbox = GetInbox();
const FString path = FPaths::Combine(FPaths::ProjectSavedDir(), TEXT("MySaves"), SlotName, Entry.Identifier + TEXT(".bin"));
UE::Tasks::Launch(TEXT("MyFolderStorageRead"), [inbox, path, RequestId, Entry]()
{
FPulseSaveStorageReadAnswer answer;
answer.Info.Entry = Entry;
if (!FFileHelper::LoadFileToArray(answer.Bytes, *path))
{
inbox->Post(RequestId, MakeFailure(TAG_FailureNotFound, path), FInstancedStruct());
return;
}
answer.Info.SizeBytes = answer.Bytes.Num();
inbox->Post(RequestId, FPulseResult::Success(), FInstancedStruct::Make(answer));
});
}
A storage with tasks of its own also overrides the protected WaitForOwnWork(MaxSeconds) and waits for them there, so FlushPendingWork can finish their answers in teardown (Files waits for its slot tasks).
Override GetCapabilities_Implementation when the storage keeps previous versions, lives on another machine, keeps only some owner kinds or has a size limit:
FPulseSaveStorageCapabilities UMyCloudStorage::GetCapabilities_Implementation() const
{
FPulseSaveStorageCapabilities capabilities = Super::GetCapabilities_Implementation();
capabilities.SupportedOwners = static_cast<uint8>(EPulseSaveOwnerKindFlags::LocalUser);
capabilities.bRemote = true;
capabilities.MaxPackageBytes = 16 * 1024 * 1024;
return capabilities;
}
Write a storage in Blueprint
- Create a Blueprint class with the parent Pulse Save Storage.
- Override the events List Slots, List Entries, Read Entry, Write Entries, Delete Slot and Delete Entry that your storage needs.
- End each event with its answer: Finish List Slots, Finish List Entries, Finish Read, Finish Write or Finish Delete, with the Request Id of the event. The answer may come later, on a later frame. Make a failure with Make Pulse Failure and a reason of the table above.
- Make the lists and the read info with the Make nodes of
FPulseSaveStorageSlotInfo(Slot Name, Modified At, Size Bytes, Package Id) andFPulseSaveStorageEntryInfo(Entry, Size Bytes, Modified At, Package Id, Has Previous). Every field can be set in Blueprint. The slot list of the save game and its menus come from Finish List Slots. - Override Get Capabilities when the defaults do not fit.
- Name the class in the settings or set it at runtime (see below).
The events of different requests can run at the same time: a load reads the entry and the meta of a slot at once, and different slots run side by side. Keep what belongs to a request with its Request Id, not in one variable of the storage.
A Blueprint storage that needs frames to answer (a delay, a latent node) cannot finish inside FlushPendingWork. At the end of the game its last writes may then be lost; keep such work short, or write the storage in C++ with tasks.
Set the storage
In the settings: Project Settings > Pulse > Save > Storage.
| Setting | Meaning |
|---|---|
| Storage Classes | A storage class per purpose: Files, Platform, Memory or a class of the game |
| Default Storage Class | The class of every purpose without its own; empty: Files |
| Root Directory | Files: the folder of the slots; empty: Saved/SaveGames |
| Enable Slot Backups | Files: every save keeps the version before it (.prev) |
| Storage Timeout Seconds | A request without an answer for this long fails (0 waits forever) |
| Storage Shutdown Seconds | How long the end of the game, or of a play session in the editor, waits for storage work |
| Default Byte Layers, Byte Layers By Purpose | Compression, check sum and encryption of the bytes (see Byte layers) |
| Mirror Options | Conflict rule and sync interval of mirrors (see Mirror) |
The storage of a purpose is made when it is first needed. With nothing set, every purpose uses Files. A purpose a plugin mirrors (AddMirrorStorage) gets a mirror around the class of the settings; a purpose a plugin wraps (AddStorageWrapper) gets the wrapper around that (see Wrapper).
At runtime: the storage subsystem replaces the storage of a purpose.
#include "Storage/PulseSaveStorageSubsystem.h"
#include "Storage/PulseSaveStorage_Memory.h"
void UMyGameInstance::UseMemorySaves()
{
if (UPulseSaveStorageSubsystem* storages = UPulseSaveStorageSubsystem::Get(this))
storages->SetStorageClass(Pulse::Save::Storage::TAG_PurposeGame, UPulseSaveStorage_Memory::StaticClass());
}
SetStorage(Purpose, Storage)uses a storage object you made;SetStorageClass(Purpose, Class)makes one of the class when it is next needed. Null goes back to the class of the settings.- The storage before finishes what it was asked, then ends.
- The save game lists its slots again in the new storage; the menus follow through
OnSlotsChanged. UPulseSaveProfileSubsystem::SetStoragesets a storage for the profile of one local player only. CallLoadProfileafterwards when the profile already had data.
Use a storage directly
Code that keeps data of its own (a world, characters) can use a storage without a save manager. The Request* functions check the request, wait for their turn on the slot and answer once on the game thread.
#include "Storage/PulseSaveStorageSubsystem.h"
void UMyCharacterKeeper::WriteCharacter(const FString& PlayerKey, TArray<uint8> Bytes)
{
UPulseSaveStorageSubsystem* storages = UPulseSaveStorageSubsystem::Get(this);
UPulseSaveStorage* storage = storages ? storages->GetStorage(Pulse::Save::Storage::TAG_PurposeServer) : nullptr;
if (!storage)
return;
FPulseSaveStoragePackage package;
FPulseSaveStorageEntryBytes& entry = package.Entries.AddDefaulted_GetRef();
entry.Entry = FPulseSaveSlotEntryId(TEXT("Character"));
entry.Bytes = MoveTemp(Bytes);
storage->RequestWrite(FPulseSaveOwner::Player(PlayerKey), TEXT("Character"), MoveTemp(package), [](const FPulseResult& InResult)
{
UE_CLOG(!InResult.IsSuccess(), LogTemp, Warning, TEXT("The character was not written."));
});
}
The other calls are RequestListSlots, RequestListEntries, RequestRead, RequestDeleteSlot and RequestDeleteEntry. Inside slot work, pass a pointer to the handle of EnqueueSlotWork as the last parameter.
Teardown and tools
FlushPendingWork(MaxSeconds) delivers waiting answers, starts queued slot work and waits for the storage’s own work on the game thread, until nothing is pending or the time is up. It returns true when nothing is pending afterwards. UPulseSaveStorageSubsystem::FlushPendingWork does it for every storage. Use it in editor tools, commandlets and specs that need a result before they go on.
When the game instance ends, the storage subsystem flushes every storage (Storage Shutdown Seconds) and switches them to teardown. In teardown a storage still takes the last saves of other subsystems; slot work starts at once when its slot is free, and each answer reaches its caller as soon as the storage gives it, without waiting for a tick. IsInTeardown tells whether a storage is there. A mirror flushes its primary storage and does not wait for a secondary storage that is remote.
Tests
UPulseSaveTestStorage is the Memory storage for the specs of PulseSave and of the plugins built on it, with answer modes, failures and a log of the calls. It keeps previous versions and every owner kind by default. It is not for games.
| Member | Use |
|---|---|
Answer | At Once, Manual (held until ReleaseManual), Manual Answer (done at once, the answer held until ReleaseManual), Never (the request times out), Fail |
FailReason, FailOnly | The reason of Fail answers and the operations that fail ("Read", "Write", …) |
Capabilities | What the storage tells it can do |
ReleaseManual, CountHeld | Answer the held requests in the order they came; how many wait |
Calls | A log of the calls, such as Write <owner>/<slot> [<entries>] <mode> |
Put, Find, HasSlot | Bytes put in or read out directly (from the Memory storage) |
CorruptCurrent | Reads of the current version answer Damaged until it is written again |
#include "Storage/PulseSaveStorageSubsystem.h"
#include "Storage/PulseSaveTestStorage.h"
#include "UObject/StrongObjectPtr.h"
// In a spec with a game world
const TStrongObjectPtr<UPulseSaveTestStorage> storage(NewObject<UPulseSaveTestStorage>());
storage->Answer = EPulseSaveTestAnswer::Manual;
UPulseSaveStorageSubsystem::Get(World)->SetStorage(Pulse::Save::Storage::TAG_PurposeGame, storage.Get());
// ... start a save of the save game, then let the storage answer
storage->ReleaseManual();
storage->FlushPendingWork(5.0);
Check a storage
Testing/PulseSaveStorageConformance.h (header only, builds with automation tests) holds the checks every storage passes: answers once and never inside the call, what was written reads back entry by entry, Not Found for a slot, an entry or a version that is not there, previous versions as the capabilities say, a package that replaces the slot, deletes, owners kept apart, reserved slots kept out of List Slots, the package id kept, Full above the largest package. Files, Platform, Memory, Mirror, the wrapper and the test storage run them in their specs; a storage of a plugin (a cloud, a wrapper) runs them the same way:
#include "Testing/PulseSaveStorageConformance.h"
void FMyCloudStorageSpec::Define()
{
BeforeEach([this]()
{
// A new, empty storage for each check, its transport faked
Storage.Reset(MakeStorageOnFakeTransport());
});
AfterEach([this]()
{
Storage->Deinitialize();
Storage.Reset();
});
Pulse::Save::Testing::DefineStorageConformance(*this, [this]() { return Storage.Get(); });
}
The checks wait with FlushPendingWork (10 seconds per request; FStorageConformanceOptions changes it and the name of the Describe, “Conformance”). FStorageConformanceCalls runs single requests the same way for checks of your own.
The slot meta
The meta of a slot (name, date, play time, level, preview picture, fields of the game) lives in the reserved entry slot_meta (Pulse::Save::MetaEntryId) of the slot. It holds a small Pulse save game with the static record PulseSaveSlotMeta; other static records of the game may sit next to it. A save game is never written into this entry. A meta entry the game writes itself is never written over (Foreign Meta).
| C++ | Blueprint | What it does |
|---|---|---|
Pulse::Save::ReadSlotMeta(Slot, Done) | Read Slot Meta (Async) | Reads the meta of a slot. No meta, a damaged one or a foreign one is a success without meta |
Pulse::Save::WriteSlotMeta(Slot, EntryId, Meta, Done) | Write Slot Meta (Async) | Writes the meta alone (Replace Current), for example a new name |
Pulse::Save::ListSlotsWithMeta(Storage, Owner, Prefix, Done) | List Slots With Meta (Async) | Lists the slots of an owner with their meta, newest first |
Pulse::Save::MakeNewSlotName(Prefix, TakenNames) | - | The first free name <Prefix>_0001, <Prefix>_0002, … |
Save Game writes the save and its meta in one package, and Load Game picks the meta that was written with the loaded save. The save game keeps its slot list with the meta of each slot (UPulseSaveGameSubsystem::GetSlots). How the menus show the meta is in Save and load menus.