Saved/Loaded Object Transforms Work in Editor, but Not in Shipped Package.

Hey guys, so I have a 3D first person platformer game that I recently started adding save and load functions to. I made it so that when the game loads, instead of positioning the player, a robot, and an invisible barrier (to block the player from going back) where they are by default in the scene, I instead grab the transforms from a Save BP variable and set a Game Instance variable of the same variable name and that sets the player, robot, and barrier transforms when the level is loaded. That way if the player, robot, and barrier transforms have been changed and saved, they are immediately updated when reopening the game.

So, everything works just fine in the Editor and in the Debugging and Development versions of the packaged game. However, when I select Shipping for the package, the player, robot, and barrier transforms make no sense. The player starts off on the second platform of the level (obviously he should start at the location I set in the variables, which would be platform 0 in the scene). The robot is in a random location, I think his world location is 0, 0, 0. And the barrier is randomly higher in the scene for no reason. I honestly have no idea why the transforms of these three things works just fine in the Editor and in the Debugging and Development versions of the packaged game, but not in the shipped version.

And yes, I’ve done lots of research on this from other people having build issues. I took a look at the DefaultEngine.ini file in the project Config folder and even the DefaultEngine.ini in the project Saved>Temp>Win64>[project name]>Config folder (which I doubt is as important as the first DefaultEngine.ini file I mentioned). The GameInstance has the correct file path and name. The GameMode is also the correct one. Everything is correct. I honestly have no idea why it doesn’t set the transforms properly in the shipped build.

I suppose I could just release the game on Steam as a Development or Debug build (unless Steam requires a Shipping build, in which I suppose I could just release the game on Gamejolt or a website I create) as a last resort.

Can someone please help me figure out why the shipped package doesn’t correctly set the transforms? Thanks.

1 Like

Are you aware the save game location is not the same in a shipping package?

So, the first time you run in the packaged game, you will need to save from scratch.

1 Like

How do I save from scratch? What do you mean by that? You mean I will copy a save file from the project folder and paste it in the shipped game save location? Also, where is that location?

1 Like

The save location in a shipped build is

C:\Users<Name>\AppData\Local<Game name>\Saved\SaveGames

You either need to know the savegame will be empty to start with. Or, if you want them to start with something already there, it needs to be placed in the new path.

1 Like

Well, I noticed that there was a save file already there in that file path you showed me. I do tell it to create a new save if one doesn’t exist. So, I just deleted the old save and replaced it with the project save and the shipped game now mostly works, although the barrier is still in an odd place. Aside from that, I’m concerned about how the game will handle all this when someone installs the game on Steam. Of course the person will not want to manually copy and paste a save file into the save location. But if I just rely on the actual game itself to create it (which I currently have in the blueprint code), the game doesn’t work correctly (as mentioned in the first post).

I just don’t get it. Why would the save file the game creates work just fine in the development packaged version but not the shipped one? Does the shipped version handle which blueprints are read first differently?

1 Like

Yes. Init order is totally different in a packaged game.

You have to code it not to rely on an assumed order :slight_smile:

1 Like

Okay, I figured it out! So, apparently the issue was that the game was not creating a fresh save file here (C:\Users\AppData\Local\Saved\SaveGames) because it still had the save file from the last time I shipped the game. So, by deleting the old one and then running the game, and opening level 1 (which will create a new file if one doesn’t exist), it creates a new save file and it all works now. The reason this was never an issue with the debug and development packaged games is because I would always delete the save file by virtue of deleting the Windows folder the package creates, whereas when deleting the the Windows packaged folder for the shipping build, it would delete everything except the save file stored outside of that Windows folder (again, here C:\Users\AppData\Local\Saved\SaveGames), hence why it wasn’t getting deleted.

Thank you so much ClockworkOcean for helping me!! I had no idea the shipping saves were put in another location fron the project. Thank you! You are truly a community hero!

So, for those of you who might be facing similar problems, just remember two things: First, create a new save game in the blueprint if one doesn’t already exist, and if it does exist, load it. I followed Beardgames’ save/load tutorial series on YouTube, I highly recommend that series! And second, if the package is debug or development, you only need to delete the Windows packaged game folder so you can package a new build (unless you change build locations), and that will automatically delete the save file, but if the package is shipping, you will need to delete the Windows folder AND go find the save file (C:\Users\AppData\Local\Saved\SaveGames) and delete it too!

Happy Gamemaking!!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.