So, I’ve been scratching my brain about how the Save/Load feature in Ue5 works. And if I’m understanding this correctly you need to keep track of everything that you wish to reload in a SaveGame BP?
I’m doing some fairly complicated scripted sequences and I don’t want to have to keep track of every little detail, the color of lights, what sounds are playing, and the position of countless moving objects. Adding each one of those manually seems like it’d be doing things the wrong way, even partitioning the effort with interfaces would still require I add all those variables to the save game manually, and the interfaces to every single blueprint, including things I just drop into the editor (Pointlights, ambient sounds, etc) and change via level blueprint.
Is there a better way? Or at least a corner or two I could cut here?
So you don’t need to save ALL data, just data that is necessary for the continuity of a game, that the rest of a load sequence can be based on.
For instance, with these sequences… no you don’t need to keep track of all of that stuff. You could just keep track of a bool “Cutscene 1 watched”, at the end of the cutscene set it to true, and only allow Cutscene 1 to play if “Cutscene 1 watched” bool is false, blocking it out forever. If some things are different after the cutscene, have them check for that variable after load and change a variable based on that.
That way you’re not saving a TON of stuff, you’re just saving one 1/0 value. Most of a savegame is actually going to be booleans (in my experience).
So lets say we’ve got a door. I have a boolean isClosed (Stored in save game) that’s set to true when the door closes. The player reloads the save to when isClosed was false, does the door reopen?
Or, do I also need to have a check that reopens the door when isClosed is false?
You’ll store states for things that aren’t in their default state. For example say all doors in the map are default to closed. As you play you will open a few here and there. The only thing you should store in save game is the states of doors that are open.
For each of these actors you will also want to have a begin play function that gets & sets the desired state of the actor.
I see, so there’s no way to do this without modifying every blueprint then, to include the Get/Set logic. As well as making modified versions of every built-in actor (Such as point lights, ambient sounds, etc) or effectively a “reset sequence” for every scripted sequence. It’s a lot of work no matter which way you cut it. Just wanted to make sure before I spent countless hours modifying every one of my blueprints that it was as unavoidable and completely insane as I thought it was.
I can’t be the only one who thinks that’s crazy, no? Like, completely bonkers? We have Nanite and Lumin but have to take a brute force approach to saving and loading? Please tell me I’m not the crazy one here.
Also, any chance I could shell out some coin to make this any easier on me? Is something like “Easy Multi Save” any better in this regard? I think I’d still need to add the interface to every BP and duplicate/modify any built-in actors I use, but would it allow me to bypass having to write custom logic for every single blueprint, for every state that a blueprint can be in?
Can I do this within level blueprints? The “LoadData” event in my Savable interface doesn’t appear to be firing, but it works fine in my character controller.