All about saving data?!

Hi everyone,

currently i am working on something that needs to be saved :smiley:

I want to clarify the different methods of saving and hope you can help me cause i have a question that is very important for me.

So:

Is it true that:

  1. Using Game State is for saving and loading server-sided, e.g. things in a online game that runs on the server
  2. Using Player State us for saving and loading server-sided, e.g. the characters that you play in an online game
  3. Using Save/Load Game in Slot is for offline game

Now i have a question that is very important for me:

When Open (Teleporting to) a new level, all the Game Mode Classes will be reloaded, but i want to take with a few variables. What i am really looking for is something like that:

  1. Create one asset in UE4 that contains all the variables that i can change during runtime.
  2. I do not want to spawn that asset in the level
  3. It would be a container that should be readable and writeable and just exist as a temporary variable container.

Hope you can help me :smiley:

Thanks in advance

To you first answer, check this out

The rest will take

Saving stuff you want to access in other levels

I created a custom GameInstance blueprint to store variables in I need to use in different levels. I use this in my MMORPG WIP for storing the entered username, which I then request from the GameInstance (done by casting to it) once the player gets spawned in the world. (- YouTube)

To store data in your GameInstance blueprint simply right click in a blueprint, type Get Game Instance, off of that node type in Cast to and you should be able to get the right Cast to node.

Now drag off of ‘As My Game Instance’ and either call a custom event you made in the GameInstance blueprint or type in the variable’s name you wish to set and set it right there and then after the Cast node.

Note: I called my custom GameInstance blueprint ‘MyGameInstance’ so you probably won’t find it if you search for it using the word ‘My’ in front of it.

To answer the first three questions: PlayerState and GameState are indeed server-sided. Saving and Loading from Save slots are for singleplayer games.

Goodluck!