Detailed usage
1. Configure the system
System configuration is performed in a Data Asset.
As explained in the Installation section, the configuration Data Asset must be added to the assets to cook list.
Open DA_ADS_SaveSystemConfig to configure the system. The plugin loads this asset at this location, so do not move, rename, or delete it. The parameters are detailed below:
| Parameter | Description |
|---|---|
| Project Save Behavior | Blueprint class derived from ADS Project Save Behavior. It is optional, but handles project-specific events and conversions. |
| Profile Save Game Class | Class derived from ADS Save Game Object used for profile.sav. |
| Slot Save Game Class | Class derived from ADS Save Game Object used for manual and automatic slots. |
| Current Save Version | Save format version, at least 1. Increase it when a change makes old data incompatible. |
| Auto Convert Without Confirmation | Enables direct conversion of older saves. When disabled, the project receives a confirmation request first. |
| Manual Save Slot Base Name | Prefix for manual saves. For example, save produces save01; add a separator yourself when needed. |
| Manual Save Max Slot Index | Last allowed manual-save index, from 0 to 999. |
| Automatic Save Slot Base Name | Prefix for automatic saves. No separator is added automatically. |
| Automatic Save Slot Count | Number of rotating automatic-save slots, from 1 to 5. |
| Save Operation Timeout | Participant response wait time, between 2 and 20 seconds. |
| Default Slot Thumbnail | Fallback image used when a saved thumbnail is unavailable. |
| Thumbnail Width | Captured-thumbnail width, from 64 to 2048 pixels. |
| Thumbnail Height | Captured-thumbnail height, from 64 to 2048 pixels. |
| Thumbnail JPEG Quality | Thumbnail JPEG compression quality, from 1 to 100. |
| Custom Save Directory | Reserved for custom uses. Slot operations currently use Unreal Engine’s standard save directory. |
2. The subsystem
Access the subsystem
ADS Save System is a Game Instance Subsystem. Retrieve a reference to the subsystem in the Blueprint that needs to use it.
Functions
The functions below are accessible from a subsystem reference.
| Function | Description |
|---|---|
Get Project Save Behavior | Returns the project save behavior. |
Get Project Save Behavior As | Returns the project behavior with the requested class. |
Check Config | Checks the runtime configuration and returns warnings and errors. |
Get Current Save Version | Returns the current save-format version. |
Check Save Version | Compares a save version with the current version. |
Get Save Version From Slot | Reads the save version stored in a slot. |
Scan Saves Needing Conversion | Finds saves that need conversion. |
Is Convert Pending | Indicates whether a conversion is pending. |
Continue Convert | Continues a pending conversion. |
Cancel Convert | Cancels a pending conversion. |
Add Participant | Registers a participant and defines the save types in which it takes part. |
Remove Participant | Removes a registered participant. |
Clear Participants | Removes all registered participants. |
Cleanup Participants | Removes participant references that are no longer valid. |
Get Registered Participants | Returns registered participants. |
Get Registered Participant Count | Returns the number of registered participants. |
Save Slot | Starts a slot save. |
Load Slot | Starts a slot load. |
Get Slot Cache | Returns the cached save object for a slot. |
Get Last Save | Returns the last save known by the profile. |
Get Slot List | Returns the requested slot list, existing or empty. |
Delete Slot | Deletes a manual or automatic slot. |
Copy Slot | Copies a slot to the first available slot of the same type. |
Format Time | Formats a UTC date for display. |
Get Thumbnail | Returns a slot thumbnail or its fallback image. |
Save Slot Cache | Writes a slot cache to disk. |
Does Slot Exist | Indicates whether a slot exists. |
Get Slot Name | Builds the name for a slot type and index. |
Get Digits | Returns the number of digits needed for slot indices. |
Is Slot Index Valid | Checks whether a slot index is valid. |
Set Part Saved | Notifies that a participant has finished saving. |
Set Part Loaded | Notifies that a participant has finished loading. |
Is Saved Cache Complete | Indicates whether every participant has finished saving. |
Is Loaded Cache Complete | Indicates whether every participant has finished loading. |
Is Operation In Progress | Indicates whether an operation is active. |
Has Pending Load | Indicates whether a load still needs to be applied. |
Apply Pending Load | Applies a pending load. |
Get Active Operation ID | Returns the active-operation identifier. |
Get Pending Participant Count | Returns the number of participants whose response is expected. |
Cancel Active Operation | Cancels the active operation. |
Get Last Automatic Index | Returns the last index used for automatic saves. |
Get Next Automatic Index | Returns the next automatic-save index. |
Set Automatic Index State | Sets the rotation state of automatic saves. |
Event Dispatchers
The subsystem Event Dispatchers let participants, menus, and project logic react to operations. Participants must subscribe in their BeginPlay to On Save Requested and On Load Requested to handle their own portion of the data.
| Event Dispatcher | Description |
|---|---|
On Save Requested | Triggered at the start of a save. Each registered participant writes its data, then calls Set Part Saved with the received context. |
On Load Requested | Triggered when loaded data must be applied. Each participant reads and applies its data, then calls Set Part Loaded with the received context. |
On Save Completed | Triggered when a save succeeds, fails, or times out. Disk writing occurs only after every expected participant has responded successfully. |
On Load Completed | Triggered when a load succeeds, fails, or times out, after every expected participant has applied its data. |
On Convert Completed | Triggered when a save conversion succeeds, fails, or is cancelled. It is independent of load completion. |
On Slot Deleted | Triggered after a manual or automatic slot has been successfully deleted. Profile saves cannot be deleted with Delete Slot. |
On Slot Copied | Triggered after a manual or automatic slot has been successfully copied to the first available slot of the same type. |
3. Save Game Object
Create a child Blueprint of ADS Save Game Object and add the project variables to retain (with the SaveGame option). The system automatically fills in the version, UTC date, level, type, index, slot name, and, if requested, thumbnail.
For generic data per participant, you can use Set Part Data, Get Part Data, Remove Part Data, Clear Part Data, and Has Part Data. A part has a name, version, text content, and binary content. For common data, however, prefer explicit variables in your child Blueprint: they remain easier to read and maintain.
4. Register participants
A participant is the object that has data to write into a save or reapply when loading. Each participant is responsible for its own registration: do not centralize this call in another Blueprint.
In each participant’s BeginPlay event, retrieve a reference to the subsystem. From a subsystem reference, call Add Participant, specifying the participant object and whether it takes part in profile, manual, and/or automatic saves.
When a participant is no longer needed, call Remove Participant from a subsystem reference. Use Clear Participants or Cleanup Participants from the object that deliberately manages all participants. Never create a new context: always reuse the one received through the event. The Is Saved Cache Complete, Is Loaded Cache Complete, Get Pending Participant Count, and Is Operation In Progress functions help diagnose the flow.
5. Save
Trigger a save
From a subsystem reference, call Save Slot, specifying the slot type and index when the type is manual. For an automatic save, the index is resolved by rotation. The Capture Thumbnail option saves a JPEG thumbnail of the current view before writing.
Save Slot triggers the overall operation: the subsystem prepares the save object, then delegates data saving to every participant registered for that slot type. Once the operation ends, the subsystem calls the On Save Completed dispatcher with the context, success, and a failure reason. Call Cancel Active Operation to stop an operation in progress; no cancelled save is written to disk.
Participant saving
In its BeginPlay, each relevant participant subscribes to the On Save Requested dispatcher. When this dispatcher is triggered, the participant receives the context and handles its save. It writes its own portion of data into Save Game Object, then calls Set Part Saved from a subsystem reference, using the same context with Success set to true. The subsystem waits for every participant to respond before writing the slot.
6. Load
Trigger a load
From a subsystem reference, call Load Slot with the configured save class. The subsystem retrieves the slot, can automatically open the saved level, then delegates applying data to the participants after the map has loaded. Apply Pending Load is intended for a custom flow or debugging; normally it is called automatically.
Once the operation ends, the subsystem calls the On Load Completed dispatcher with the context, success, and a failure reason.
Participant loading
In its BeginPlay, each relevant participant subscribes to the On Load Requested dispatcher. When this dispatcher is triggered, the participant receives the context and handles its load. It reads its own portion of data from Save Game Object, applies it, then calls Set Part Loaded from a subsystem reference using the same context. The overall load finishes only when every expected participant has responded.
7. Project logic
Introduction
ADS Project Save Behavior is an optional object for project-specific logic. The subsystem creates it from the class configured in the runtime asset, then uses it to notify lifecycle, operations, and save conversions.
Create the logic
Create a child Blueprint of ADS Project Save Behavior, then assign this class to Project Save Behavior in DA_ADS_SaveSystemConfig. Implement only the events required by your project. The functions below are events to override in this child Blueprint. Override only those your project needs.
Functions
| Function | Description |
|---|---|
Initialize Behavior | Called after project logic is created. It receives the main subsystem. |
Deinitialize Behavior | Called before project logic is released. |
Handle Save Operation Completed | Called at the end of a save, successful or not, before the public On Save Completed dispatcher. |
Handle Load Operation Completed | Called at the end of a load, successful or not, before the public On Load Completed dispatcher. |
Handle Save Operation Failed | Called when a save fails; the reason identifies the cause of the failure. |
Handle Load Operation Failed | Called when a load fails; the reason identifies the cause of the failure. |
Handle Need Convert | Called when an old save requires project confirmation before conversion. |
Convert Save | Converts the save object between two versions. This function must be synchronous and return true only if data is compatible. |
Handle Convert Completed | Called after a conversion succeeds, fails, or is cancelled, before the public On Convert Completed dispatcher. |
Get ADS Save System | Returns the subsystem that owns this project logic. |
Manage save versions
From a subsystem reference, use Check Save Version, Get Save Version From Slot, or Scan Saves Needing Conversion to identify old saves. If conversion is required and Auto Convert Without Confirmation is disabled, project logic receives Handle Need Convert. After confirmation from your interface, call Continue Convert; otherwise call Cancel Convert.
In Convert Save, adapt the save-object data to the new version. A save created with a version newer than the project version cannot be loaded.