As noted at the top of this section, our actual game and the state of all our dynamic actors is done in three major steps:
- Add an interface to all actors that need to save. This involves a few changes to our moving platform, which we'll try to keep straightforward.
- Serialize all our actors' desired variables to an FArchive by tagging our UPROPERTIES.
- Write this to a file we can then serialize everything back out from.
For very simple saving (such as player stats and the current level), be sure to check out the USaveGame document link in the Further reading section at the end of the chapter. Now, on to our relatively complex version.
First we need an interface that we'll add to all of our actors that we care about ...