ULimenGameSaveSubsystem
Overview
The ULimenGameSaveSubsystem is a subsystem within Unreal Engine that manages game saving and loading. It serializes data from ULimenSavesHandler instances into ULimenGameSaveData, handles the lifecycle of these data objects, and provides asynchronous save and load operations. The subsystem also exposes delegates for tracking the state of save and load operations.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| OnGameDataLoaded | Public | Delegate called when game data is loaded. |
| OnGameSaveStateChanged | BlueprintAssignable | Delegate for tracking the state of save and load operations. |
Functions
Return Type | Signature | Description |
|---|---|---|
| Initialize(FSubsystemCollectionBase& Collection) | Initializes the subsystem, setting up dependencies and event listeners. |
| Deinitialize() | Cleans up resources and removes event listeners when the subsystem is being destroyed. |
| SaveCurrentGame(UObject* Caller) | Saves the current game data asynchronously using the caller's world context. |
| LoadCurrentGame(UObject* Caller) | Loads the current game data asynchronously using the caller's world context. |
| ScheduleGameLoadOnMapChange() | Schedules a game load when the map changes. |
| HasLoadedGameData() const | Checks if game data has been loaded into the current world. |
| DoesSavedDataExist() const | Checks if a save file exists for the current game slot. |
| DeleteGameSave() | Deletes the saved game data for the current game slot. |
| ShouldSaveData() const override | Determines whether to save game data. Always returns true. |
| ShouldLoadData() const override | Determines whether to load game data. Always returns true. |
| PreDataSaved() override | Called before data is saved. Currently does nothing. |
| PostDataSaved() override | Called after data is saved. Currently does nothing. |
| PreDataLoaded() override | Called before data is loaded. Currently does nothing. |
| PostDataLoaded() override | Called after data is loaded. Currently does nothing. |
| GetUniqueDeterministicId() const override | Returns a unique, deterministic ID for the subsystem class. |
| GetCurrentGameSaveData() const | Retrieves the current game save data object. |
| IsGameLoadScheduled() const | Checks if a game load is scheduled on map change. |
Usage & Implementation Notes
Threading Constraints: The subsystem operates within the Unreal Engine's threading model, utilizing async operations for saving and loading.
Replication Requirements: Not applicable as this is a local-only subsystem.
Memory Lifetime Management: Properly manages memory by destroying temporary objects after serialization and deserialization.
Initialization Dependencies: Depends on
ULimenSaveSubsystemto handle actual data storage.