What is the best way to save the game in C++?

So I’m aware of these methods using the SaveGame Object in Blueprint or C++ :
https://docs.unrealengine.com/latest/INT/Gameplay/SaveGame/Code/index.html

That looks pretty decent, but can I use it to serialize things like all the game AI actors that have been spawned in the level into that SaveGame object? I’m not clear on how to use that to serialize the whole game state to a SaveGame object and the examples given are more like saving some .ini file variables to a single object rather than actual game state and game objects. What about saving ‘many’ objects to the SaveGame object? How would that be done?

On other forums, I read about using things like FArchiveProxy and serializing game objects to uint8 binary streams to read on and back off disk.

So…that said, can someone sort me out on the best strategy for saving a current game state to a save game file to be read back in.

To be clear about my intentions:
This means if I spawn a bunch of objects and actors, I have a player with inventory etc.and they are changing, taking damage (changing state) during gameplay, I then want to be able to call as SaveGame methods that serializes out a snapshot of the entire game state which can then be later read back in to reconstruct the game as exactly was when I saved.

So this means I’m not after a checkpoint type save system. This is more of a ‘save almost everything’ type of save game. :slight_smile:

The closest thing to what I want would be this nice writeup on saving archive data streams to and from disk, and maybe that IS what I should do, but has anything been added to UE4 4.6 that makes this more outdated? I haven’t found it yet, but that doesn’t mean it’s not there.

A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums,Read%26_Write_Any_Data_to_Compressed_Binary_Files

Na, i think you can go with Ramas tutorial of Compressed Binary Files. (:

If you want to be sure, better send him an PM on the Forum and ask (:

The most official post that I referenced is here Look at answer.
I was able to replicate it and save spawned actors using the archive streams. I marked up the properties I wanted using the SaveGame flag and made the simple actor records. I haven’t tested nor tried to save blueprint actors or variables in the blueprint level yet however.

Yeah, I’ve been combing through a lot of these posts as well as the wiki and this is the current way of doing things. The Archive classes are nice to use actually.

check this. Saving & Loading Your Game In Unreal Engine With C++ - YouTube