Keep save games without a new package build over writing them?

Is there a way where a player can keep his save games without a new package build over writing them?

Thanks.

1 Like

When you do a shipping build the save game lives in your windows files, not in the project folder hierarchy. If you want to keep making development builds, it will keep replacing the save game unless you preserve it first.

This is the default. Unless you coded it so that it overwrites the save game…

I should have been a little clearer, I mean in a shipping build. For example say I release a new version of the game and I create a full package of the game but want the customers to keep game saves when they install the package.

I’m going to re-test this with windows, but as far as I’m aware, the save game doesn’t get touched by a packaged build.

Can you ensure your save game is excluded from the build?

EDIT: Doesn’t happen with win. What about just binning the save game before packaging?

I tested this with an package build for Android:

  1. Create a shipping build package for an Android phone
  2. Install the build by running the bat file in the build folder
  3. Run game and save some vars
  4. Test game to ensure vars are saved
  5. Repeat steps 1 and 2 and create a new shipping build package and then install on phone from the bat file
  6. When I run the game I find the vars are overwritten and back to default

This process is what I expect a customer would be doing if downloading an update from Google. I have no specific coding for the save games except via the standard BP nodes

This is what I can’t figure out, what setting (if there is one) I need to set on the package build to ensure the saves are not initialised/deleted when the customer installs the package

You just have to bin the save game you have in the project folder hierarchy before building.

1 Like

Yep tested that where I ensure the saved games folder is empty before creating the build. Maybe its an Android thing where the install of a package deletes any save games when the customer installs a package. I gather for Windows it doesn’t touch the saves and leaves them intact

I don’t know what you have going on there. If Android was binning save games like this, it would come up in a google search. I don’t see anything.

Hey!

Going through the same, but on a quest 2 project.

Just to make sure,
What I take from this, is that if I do any changes to a project, before building it back to quest 2 and make sure I don’t override the Save Game already created in the device, I need to delete the save game file from the unreal project folder?

Is this confirmed or is there any new way to proceed about it?

Thank you!

Hey!

How do I proceed, if in this case, everytime I try to build to quest… It gives me an error that only lets me complete a build and run if I delete my project app from the quest folders completely…

Therefore, making it impossible to update the app, without having to basically re-install it completely and losing savegames in the process…

Also, before this… I rebooted unreal engine and the oculus quest several times, and everytime i boot up again and build it back (if the build and run doesnt fail and I have to delete it manually from the quest), it ovverrides the savegame once again and everytime.

Hs this happened to anyone else? If so, how do I proceed from this?

Thank you!!

It might be a good idea to do a fresh post on this, you’re more likely to get varied help that way.

I don’t have a Quest, so can’t really comment. Does the quest store the game?

As far as save games go, the save game in the project is not in the same location as the save game in the installed product. They shouldn’t conflict.

1 Like

Hey! Yes thank you!

Here’s the link.

You’re right, they are not in the same folder, but if I have to delete the game completely from the oculus, in order to be able to build and run to it again… The save game goes with it…

And it basically ends up having a fresh install.

1 Like

For future travelers. Here’s the reason why this happens on android specifically.

On Android, savegames are stored in %STORAGE%/UE4Game/%Project Short Name%. So say your project name is MyGame, then on a typical android device like Quest/Quest 2 that would be /sdcard/UE4Game/MyGame.

If you open up the engine-generated Install-*.bat and look around line 16 you’ll see:
%ADB% %DEVICE% shell rm -r %STORAGE%/UE4Game/MyGame

The batch file literally blows away the folder containing the save games before installing the new package.

Easy Solutions:

  • Modify the batch file and remove the offending line
  • Modify AndroidPlatform.Automation.cs and modify the line that adds the offending line to the auto-generated batch file (search for GenerateInstallBatchFile)
1 Like