Saving a game in c++ via SaveGame Object, any relation to the Blueprint Variable SaveGame flag?

Hi all,

I’m starting to look at implementing a save/load system via https://docs.unrealengine.com/latest/INT/Gameplay/SaveGame/Code/index.html . I’ve seen other peoples approaches writing to binary files via an archiver system (Or something like that) but think that this SaveGame object system seems like the more polished approach being promoted by Unreal.

So my question is, does it have any relation to the “SaveGame” flag you can see in the Unreal Editor Blueprint Variable properties menu? Hovering over it the tool-tip is “Should this variable be serialized for saved games?” so does it tie into the SaveGame object approach? Or is it for use by another system?

I was wondering how I’d save my more complex classes of objects, perhaps that’s the option I need to tick. Unfortunately documentation seems a bit scarce on anything more than the basics.

Thanks for your time!

Hi,

well using the SaveGame object way is indeed a nice way to go. If you would look further into this system, you will notice that it will do nothing different than what you see in those archiver system (i.e. Rama explained in his Tut).

So in the end each Object in UE4 has the Function Serialize containing an FArchive to read or write data from/to. If you use the UPROPERTY(SaveGame) the underlying variable will be serialized in the Archive during serialization.
This UPROPERTY is the same as you can see in Blueprint.

here is quite some information i found myself when i was going for a save/load system: AnswerHUB

best regards