Saving and loading not working in packaged build and I NEED help if anybody has a solution

I’ve gotten decently far into development for a game of mine in the past five months and I’ve recently come across an issue that’s proving to be a major hinderance for me when testing the games packaging.

For saving and loading variables in the game, I’m using a very simple save structure that I’ve seen every tutorial go over. Using the create save game from slot, save game to slot, and load game from slot. I’m not saving anything in my game but boolean and integer variables, and some other very simple values.

I use this when the player first opens the game to create the save slot:

And then at any point when I need to load a variable or change/save a variable from any bp or widget or anything I use these nodes:

Now this setup worked to PERFECTION every single time I ran a test run in editor, with both PIE and standalone game, so I thought it was all just clockwork. But then I decided to test out packaging a beta build of the game and it all falls apart. It creates the save slot just fine but barely anything’s loading from it. Some things are saving, but it seems like it’s a diceroll on what.

I’ve seen so many other forum posts and pleas elsewhere asking for help but I haven’t seen ANYBODY give a straight answer that pertains to my situation. It seems like noone knows how to properly fix this. I’m begging somebody to give me a hand with this, it would mean the world to me to give any course of action I could take.

(I’ve also done some troubleshooting and whenever I save or load the cast to the SaveBP isn’t failing so god knows what’s going wrong)

Can I check a couple of things:

  1. Are you using async nodes anywhere?

image

  1. Can you try the same experiment with a save game name >= 4 characters?

There is a lot of save game related forum stuff, because most people, for some reason, just don’t get it. :rofl: You seem to understand it, from what I see here.

PS: The location of the save game is not the same in a packaged version. So don’t do experiments where you save things in editor ( or standalone ), and then expect to see that data in the packaged version ( or vice versa ).

Thanks for your response.

  1. No I actually haven’t been using Async nodes at all. Like I said, the whole system was working fine in editor so I wasn’t aware of the effect they’d have. Maybe you could help explain what difference they’d make?

  2. Tried your suggestion, setting the save slot strings in all the save nodes to “SaveGame” and it didn’t seem to have any effect.

To try and paint a better picture of where exactly the problems are coming up for me I made this screenshot of an area where a variable isn’t loading. (Mind the code spaghetti)

The basic idea is I want a cutscene to play when the player FIRST loads into this level and then never again. So I’m effectively using a boolean in the SaveBP as a ‘Do once’ node to check whether the cutscene has triggered before.

However in a packaged build of the game, the code simply seems to stop dead in its tracks at the cast to SaveBP. The cast doesn’t fail, but it doesn’t seem to succeed either. None of the events coming out of the branch true or false trigger, and the player just loads into the map unceremoniously.

Hopefully this can somehow help you understand what’s going wrong?

PS: I’m aware that the packaged build saves to a different location than the in editor program. I’m fairly sure it’s under local user app data?

Yeah, don’t :wink: They’re not ‘thread safe’ and will lead to strange behavior like this if you’re not on top of it.

The code you have here looks fine, but it is spaghetti :slight_smile: May I recommend

https://www.unrealengine.com/marketplace/en-US/product/blueprint-assist

Something else that’s very different in a packaged game is the load order. You can’t rely on things like ‘begin play’ / game instance / game mode / player / blah blah blah loading in the same order as they do in the editor. Could that be related?

Well, that could actually be where my issues are coming from then! The example I sent is hooked up to the beginplay node. Do you think you could elaborate a bit on how the load order is different and what I can do to get the result I want with it?

1 Like

You can basically never rely on any particular initialization order. You need to have a way of checking at runtime.

Here’s something about ordering, which can change…