Save/Load Manager
Last updated
Was this helpful?
Last updated
Was this helpful?
The Save/Load Manager(AC_SaveLoadManager) is a highly versatile component designed to manage all saving and loading operations. It tracks saved data, interacts with the selected save slot stored in the Game Instance, and uses FInstancedStructs to handle diverse data types. This ensures modularity and flexibility, allowing any type of game data to be saved or loaded seamlessly.
It is added to the PlayerController class by default (PC_SoulslikeFramework).
Works with the Game Instance to determine which save slot to handle.
Utilizes FInstancedStruct to save and load any type of data (e.g., stats, inventory, equipment, world state).
Converts data into serialized structures for storage and retrieval.
Dynamic Save/Load Functionality:
Saves game data dynamically based on the active save slot.
Event-Driven Updates:
Dispatches events to notify other components or systems when data is loaded.
Main method - Event UpdateSaveData: Utilized to add/update our save data. Any type of data can be stored/retrieved in the save file thanks to Instanced Structures:
Additionally, helper method - Event AddToSaveData: Used to add new data to an existing data entry:
Each component has a method of "serializing" their data into a savable structure format:
This method adds the related save data to the main data we have in our save/load component. Each component that has data that needs to be saved implements a similar method.
Additionally, AC_SaveLoadManager has methods for serializing all of the components.
When the save data inside AC_SaveLoadManager is updated, data will be saved into file.
The save/load manager sends a message which each component that requires loading listens to:
When this dispatcher is called, each component that is listening to it will execute a relevant method:
Actors that need to be saved require a unique identifier. For this, we utilize GUID's in Soulslike Framework. Actors without a valid GUID won't be considered for saving:
For example, when this container actor (B_Container) is interacted with, it calls a method to update our save data:
After our save data has changed/updated, it gets serialized and saved automatically into a file.
Similarly, actors that require loading bind to AC_SaveLoadManager's OnDataLoaded() delegate. This way, when data is loaded, we can execute any desired logic.
These events are triggered from various blueprints. If you'd like to see where, see our page related to .