# What do "save game to slot" and "load game from slot" actually do?

**URL:** <https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [May 25, 2021, 7:04am UTC](https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945 "2021-05-25T07:04:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hillofgold](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hillofgold](https://forums.unrealengine.com/u/hillofgold)\
**Post date:** [May 25, 2021, 7:04am UTC](https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945/1 "2021-05-25T07:04:42Z")

</div>

Please explain to me what these actually do, because obviously they don’t actually save or load the game, because you still have to get and set the variables manually (like player stats, inventory, opened doors etc.) in order to store and use them, and it doesn’t actually reset the current play session when you “load” the game, as far as i know you still have to reopen the map and manually set every single variable that has changed when the game was “saved”, otherwise the current play session continues running as if nothing happened.

So what’s the point of these nodes? And isn’t there a more efficient way of saving and loading besides manually getting and setting every single variable in the game one by one? What if i want to save a hundred different player stats or objects that have been moved/modified during a play session and load all of them in a new play session? Please help me understand, my brain is about to explode trying to grasp this concept.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 25, 2021, 8:00am UTC](https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945/2 "2021-05-25T08:00:25Z")

</div>

If these nodes could magically know what you wanted to save, that would be amazing.

in the meantime, what they do is write ( and read ) the save game object to disk.

It’s up to you what you want to put in that object, there’s no way the system could know that. It might seem obvious to you, but it’s not.

If you want something that just writes everything in a massive lump to a huge file on the hard drive, there are plenty of plugins on the marketplace for that…

---

<div class="post-metadata">

**Author:** ![hillofgold](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hillofgold](https://forums.unrealengine.com/u/hillofgold)\
**Post date:** [May 25, 2021, 8:05am UTC](https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945/3 "2021-05-25T08:05:01Z")

</div>

I try to avoid using too many marketplace assets at least for blueprints because i want to learn how to make my own stuff rather than copying, but i constantly run into roadblocks like this. But thanks for the suggestion.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 25, 2021, 8:07am UTC](https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945/4 "2021-05-25T08:07:01Z")

</div>

Well, then you’re stuck with writing everything out I’m afraid… 😉

Having said that, once you know this is how it works, a lot of stuff then needs to be in the save game, can just be stored there rather than in the game instance etc.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 25, 2021, 8:47am UTC](https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945/5 "2021-05-25T08:47:00Z")

</div>

Look into Blueprints equivalent of [structs](https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/index.html). A single struct variable can hold a LOT of user defined data - everything there is to know about the player, for example. Then you save / load just that one variable.

Conversely, everything there is to know about _an enemy_ could be held in the _Enemy struct_, and if you need to save / load a whole bunch of those, you add them to an array - still only one variable to load / save. Unless you have arrays of arrays of arrays of… - which you will almost always have anyway 🙂

There is _ **some** _ upfront work to be done, of course, and working with structs will be finicky - they’re fussy at times.

Operating on structs is often done with SetMembers node:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/9/49354c1d7c94bc19db0a7414ec166dc1be1cc820.png)

You expose what’s needed, modify it, and that particular float spends its life inside the struct rather than as a separate variable. And you can nest structs inside of structs (it does complicate iteration, though):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/f/9/f9089ef059097a4ad1557779c68c696cb205faa6.png)

Technically speaking, you could save the entire game inside a single struct. But that’s not really feasible for anything beyond tiny in scope.

When it comes to displaying stats, widgets take advantage of structs:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/e/1e94d110c3d12681bdb0d6ad9601cfb230b85c08.png)

Above, a widget’s text block fetches values from a nested struct. This would also work if you provided the widget with a reference to the player - this way you do not need to manually copy / update the struct. Blueprints copy enough data as is.

The native system is as straightforward as it is limited. That’s why such plugins exist:

> **[Savior Auto-Save Plugin in Code Plugins - UE Marketplace](https://www.unrealengine.com/marketplace/en-US/product/savior)**
>
> Savior is a C++ tool designed to extend Unreal's save system, providing a more powerful serialization framework for complex Unreal projects.

---

<div class="post-metadata">

**Author:** ![midgunner66](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/midgunner66/32/466711_2.png) [@midgunner66](https://forums.unrealengine.com/u/midgunner66)\
**Post date:** [May 25, 2021, 8:55am UTC](https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945/6 "2021-05-25T08:55:29Z")

</div>

And also, savegame objects are still blueprints, so you can add variables, functions, event dispatchers, etc. to them:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/a/3a0d7c89172c1c21952b9e121bfaa2a77282ab15.png)

You can even use an event dispatcher to make all game objects put their data in the savegame object, then the savegame object saves itself. That way, you don’t have to manually save everything yourself.

---

<div class="post-metadata">

**Author:** ![hillofgold](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hillofgold](https://forums.unrealengine.com/u/hillofgold)\
**Post date:** [May 26, 2021, 2:58pm UTC](https://forums.unrealengine.com/t/what-do-save-game-to-slot-and-load-game-from-slot-actually-do/230945/7 "2021-05-26T14:58:24Z")

</div>

Thank you all for the detailed explanations! I’ll look into those!
