Download

Game save load problem at runtime

Hi everyone,

When I save and load my game running it in the editor everything is going well without any error in the log. But when I make a build using development packaging configuration game saves are just not loading of saving at all. And when I make the build using shipping configuration I get “Fatal error” when I save the game and I get nothing when I load the game from its slot.
What should I do to implement game saving and loading in my game in the build version? the main idea is that there is no any single erro and it works perfectly in ide, but totally doesn’t work when the game is built.

Function that has all save slot names in its array:

In very first widget I load that save slot list:

On another widget I try to save current game to the slot:

And the slot saver function is long, but it resaves known game slots to the special slot and saves the current game to that new slot added to known slot list:

5.png

I haven’t read your code in any detail, but two things are coming to mind for me:

  1. Using a variable for the save game is always a bit of a dodgy practice. Thing is, it can end up as ‘null’ if you’re not careful, and that’s going to give you problems. The safest way to do it is:

Load = cast to SG and load

Save = cast SG and load, update, then save

  1. The save game location is different depending on which build type you use. If your code is somehow assuming the SG will be present, it may not in other builds.