Wes Bunn is back to talk about a highly requested topic: Saving and Loading. Together we’ll walk through how to allow your players to make changes to the game world and have those changes retained every time the game is loaded. Check out more about saving and loading in the documentation!
Feel free to ask any questions on the topic in the thread below, and remember, while we try to give attention to all inquiries, it’s not always possible to answer everyone’s questions as they come up. This is especially true for off-topic requests, as it’s rather likely that we don’t have the appropriate person around to answer. Thanks for understanding!
Great topic, I hope C++ approach will be covered.
In addition to the APIs, it would be good to discuss about the saving strategies that can be applied depending on various game styles. Some may have simple needs such as saving player location and inventory, others will need to save a much broader world state. Any advice on the saving stategies would be appreciated.
had a follow up question about save / load times. since amount of data changes the time in which the game saves or loads, how/why does checking for success in a save or load blueprint node return a bool instead of a 3 output (exec, success, fail) latent blueprint node?
have had some issues with loading a game and allotting enough time to make sure the game is fully loaded before executing the rest of a begin play logic sequence, especially in game mode.
any advice in the matter or best practices is appreciated.
In the Stream Wes used a variable “Door Unlocked” and accessed it within a Door Blueprint.
Guess what? If you place another door in the level, it won’t work anymore or to be more precise: Both doors would be loaded the way first door was saved.
Not to mention that the door accesses the game mode. I find this a bad design.
The GameMode or the GameInstace should decide what properties should be loaded and access the actors in the world. not the other way round. (This is my opinion. I find it weird to access GameInstance/Mode in every Blueprint I want to save)
It won’t work with a different map either. Wes answered my question “How to save dynamically spawned actors” with “Save the array in the GameMode”.
But this won’t work either since the Actors may be of a different Type. You would need to save the type-specific data and the actor-data separately.
Having two separate arrays is not a good practice.
Sorry you didn’t find this stream useful, we can do a more advanced version next time. This was meant as an intro to Saving and Loading and the examples I cited were one off examples meant to be used as a place to start. The way I would approach saving/loading content would vary based on the project and type of data I’m working with. I might expand the usage of my struct to include all the things I want to save (object type references, numerical values, transform information, etc) or might work with data tables instead if I’m working with large quantities of information.
Thanks, I will look at this document to learn more. I’m already using a data
table for storing all of the text dialog to my project as I have thousands of lines of dialog in my game as its a sci-fi rpg game. I would also like to know how to do Party Group Switching without disabling them because I found when switching the pawns like I did when switching from my commander pawn to the flycam pawn that it disabled my commander’s pawn and I couldn’t move him, and I could only move the flycam around until I switched back pawns to control the commander again, but in a party group you want the party group to be active and following the main party leader around when doing the switching to a different party member in the group but I don’t know how to set it up yet so that when you do switch over to a different party member in the group it won’t disable the rest of the group but that the group will still tag along and
follow you no matter what party member in the group that you switch over to
If you have a lot of variables or large arrays (up to 5,000 indexes) will that cause a stutter when loading or saving?
Also in the video he mentioned you could save actor references; you can save them but if you try to use them, after loading the actor reference, to call a function or whatever your get an error and I think it happens because all actor reference IDs changes when you restart the game so it’s basically useless I could be wrong tho. The only workaround I found was to save a location of the actor at event begin play and when I load the game use a line trace to get a new reference to that actor and go from there, if you plan on saving multiple actors of different classes and different locations. However I feel like that’s a sloppy method maybe someone could help me out
I get using data tables for storing static data, but what’s this about saving? There’s nothing on that page about saving and all my googlefu has resulted in that data tables can not be used to save to from a built game.
Saving data in the way shown on stream - getting each variable like the characters health and mana and energy etcetcetc and passing them to the save file object is, I don’t know what to call it, a slow method that is repeated for each variable that needs to be saved.
But in order to pick up from where you left off, a huge amount of information needs to be saved. In an RTS it would be that each unit saves their order queue, mining progress, building progress and whatnot.
In an fps each nearby character needs to save their current animation stance and probably so much more.
If it’s some character talking and you save in the middle, they will pick up in the middle of the sentence.
So if all of this data needs to be saved in the way shown on stream, it seems like a massive amount of labor to create variables for each data.
So my question is, the games that do manage to save these huge amount of information, is that done though this slow, meticulous method?
is there any info on keeping actors permanently destroyed on save and load? I heard it can be done with unique IDs for each actor or with gameplay tags , but I have not seen a detailed explanation for this yet.
Hey UE, it’s now 2021 and have just completed your save/load tutorial! First of all, thank you for your work (the above posters don’t seem very thankful for some reason! Ingrates!)
So, question: My door remains shut upon BeginPlay, I have looked over and over this many times, even repeated the tut 3 times. I am missing some tiny detail and it’s getting under my skin.
I hope this thread gets seen 4 years after the stream!, can anyone help?
Hopefully the screen shots make it more enticing to revisit this tut and help out a very passionate late-starter?
THERE’S NO_ONE MONITORING THIS THREAD ANYMORE!!! I WANT TO LEARN and DON’T WANT TO GET DISCOURAGED!!!
Would I need to put any other info on here???
I hope someone replies…