Savegame Plugin


I was always wondering, why variables in the Unreal Editor have the Savegame option. But if you use the default savegame system, the user still has to collect and apply the variables manually. The reason for this problem is the missing use of Serialize(). When using serialize in the save and load flow, the native system of Unreal Engine collects all variables with the marker and serializes the data. This already covers a lot of utility, but if a user has visual updates which are not applied or updated in Tick() they should update in the OnActorLoaded() function. The user needs to do this, because BeginPlay() might have been called already (eg. actors in sublevels or application of the savedata without loading the level).
Another feature of games I always was wondering about how to implement is an actual loading screen. My plugin allows the user to create a custom UserWidget and has the options to hold for a minimum time and/or only end the loading when the user provides an input.
For the serialization of the player, I decided to use the player state instead of the pawn. The reason for this choice is to have a simpler way to save data in a potential multiplayer game. Just like the serialization of regular actors, there are notifier functions, but the player gets serialized last instead of when he gets spawned. This is so we can ensure that every reference and attachment is valid when updated.
Once the savegame has been loaded, it is possible to have an auto save feature active and perform manual saves or save automatically before changing to a different level. This is only the act of saving, but the update of the to save data is done whenever a level is unloaded.

Features

Loading screen
Easy serialization of variables
Interface to mark actors for saving and feedback for loaded/saved
Persistant savegame
Playerstate for serialization of player
Compatible with world parition

Hints

If you want to save a reference to other actors, you have to use a soft reference, because hard references cant be serialized.
If you want to attach different actors, make sure they are part of the same level. If they are not part of the same level, they have to be not spatially loaded or part of the persistent level to prevent asynchronous unloading.

Characteristics

Role: Developer
Plattform: UE5 Plugin
Engine: Unreal Engine 5
Source: Git