x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Can we have a tutorial on the GenericSaveGameSystem ?

Can we have a tutorial on the GenericSaveGameSystem ?

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 02:00 AM in Everything Else

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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

more ▼

answered Mar 11 '14 at 02:00 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

more ▼

answered Mar 11 '14 at 02:00 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:00 AM

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()

};

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:00 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question