Can we have a tutorial on the GenericSaveGameSystem?

Can we have a tutorial on the GenericSaveGameSystem ?

Hi Tom,

Thank you for the request. There is a demo in the works for this feature which can be expected to be seen in a future release.

  • Adam

You need to create a subclass or Blueprint of USaveGame - you can then use the in built functions or blueprint nodes to serialise and deserialise that USaveGame object to disk.

It contains no other functionality - you need to implement the rest yourself (i.e determine what properties you put in your save game class, and how you reconstruct the game state from those properties).

Edit: Coincidentally I replied to your other post on the same subject here too:
https://rocket.unrealengine.com/questions/3517/runtime-content-saves-data-reads.html

Thanks ambershee.
Sorry if this is not written up well… some extra questions.

I believe I understand how you’re doing it, and I wanted to see whether the built-in tools would be sufficient for me. It looks like it - I just need to hammer out a class file full of variables.

I don’t quite get the usage of Create Save Game Object (in event graph) so I’m looking forward to tuts.

I’m assuming that Get and Set Transform using interface BP_SaveG_Interface C (the ones with mail icons on 'em) are for altering a saved object’s location … well, probably not, but I’m finding it hard to guess. The asset in classes ‘BP_SaveGame’ has get TM and get Stage … I’m assuming Stage is kind of like ‘waves’ in a game, or ‘current level’, or maybe represents something like checkpoint.

There’s a thingy called ReturnNode – but I can’t add this myself from the contextual menu.

I hope I am right in understanding ‘create a subclass of USaveGame’ you mean something like this: In VS - if I add a TomSaveGame extending SaveGame from the Rocket’s File>Add C++ Code to Project I get VS12 Express opening (already went through the set up docs for that)… and I see this class … how to adjust it to include some example variables? (looks different to unrealscript)

#pragma once

#include “TomSaveGame.generated.h”

/**
*
*/
UCLASS()
class UTomSaveGame : public USaveGame
{
GENERATED_UCLASS_BODY()

};

Notably, I don’t use this generic system, so some of this is guesswork.

1) I don’t quite get the usage of Create Save Game Object (in event graph) so I’m looking forward to tuts.

Create Save Game Object appears to just do exactly that and nothing more; create a save game object. It’s existence seems unnecessary (I guess it’s a silly workaround for not being able to create new UObjects from Blueprint), but this node will do that and return the object for you.

Create Save Game Object takes your USaveGame subclass returns and returns the instance of that object for you to use and set it’s member variables using whatever you provide in your subclass.

From there, you can Save Game to Slot, and if you have a saved game, you can Load Game From Slot which will recreate your USaveGame object.

As mentioned before, what your USaveGame subclass contains, and how you use it, is completely up to you to define, by default it does nothing.

2) I’m assuming that Get and Set Transform using interface BP_SaveG_Interface C (the ones with mail icons on 'em) are for altering a saved object’s location … well, probably not, but I’m finding it hard to guess. The asset in classes ‘BP_SaveGame’ has get TM and get Stage … I’m assuming Stage is kind of like ‘waves’ in a game, or ‘current level’, or maybe represents something like checkpoint.

Get and Set Transform can be used to obtain and set the world transforms of an object - ergo it’s location, rotation and scale. You’d probably use this in your save load system if you want to retain something like a specific player position.

I would ignore those interfaces and blueprints, and focus on what your game requires; work out what your save system needs to save and just save / load that.

3) I hope I am right in understanding ‘create a subclass of USaveGame’ you mean something like this: In VS - if I add a TomSaveGame extending SaveGame from the Rocket’s File>Add C++ Code to Project I get VS12 Express opening (already went through the set up docs for that)… and I see this class … how to adjust it to include some example variables? (looks different to unrealscript)

Yes, that’s what you want to do. You can also coincidentally use a Blueprint of USaveGame, so it doesn’t strictly need to be C++. Either way, that’s a correct looking class definition. You will need to learn a little C++ before continuing, but it’s essentially all variable declaration. You will additionally want to look at the Unreal 4 specific UPROPERTY() specifiers for your variable declarations. You’ll see examples used all over other classes, as well as being documented here:
https://rocket.unrealengine.com/docs/ue4/INT/Gameplay/Programming/Reference/index.html