How to change the Saved folder location?

A game packaged in Shipping configuration saves its stuff to C:\Users\UserName\AppData\Local\GameName.

How do I change it to, say, Documents\My Games\GameName?

2 Likes

Bumpā€¦

Bumpā€¦

I want to know that one too

Waiting for answerā€¦

Having the same issue with Windows Shipping Builds, but figured it out.

I followed it back to the function where the UserSettingsDir is set for shipping games.

On Windows, it calls UserSettingsDir() in WindowsPlatformProcess.cpp.

If you change the following at around line 785:

HRESULT Ret = SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, UserPath);

to:

HRESULT Ret = SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, UserPath);

and add a ā€˜My Gamesā€™ folder to the final string at around line 789:

WindowsUserSettingsDir = FString(UserPath).Replace(TEXT("\\"), TEXT("/")) + TEXT("/") + TEXT("My Games/");

It will create the Saved folder in My Documents/My Games/GameName/Saved/, which is similar behaviour to a number of UE titles. In there right now alongside our game on my machine is /SpecOps-TheLine/ and /The Vanishing of Ethan Carter/.

Whatā€™s weird is this comment above the line that sets the user folder in appdata, which says to me this is either an oversight or a change of plan:

// get the My Documents directory

You can also look into Paths.cpp, in the functions ShouldSaveToUserDir() and GameUserDir() if you donā€™t want to modify the WindowsPlatformProcess.cpp, but modifying just the windows one will stop anything weird happening with other platforms.

Hope this helps!

  • aguycalleddave
1 Like

Is there any official way of doing this I wonder? Any Epic dev care to comment?

2 Likes

Bumping thisā€¦ Curious about this situation for windows 10ā€¦ since My Documents have now changed to just ā€œDocumentsā€ Using this method, it wouldnā€™t work if you distributed to a user who isnā€™t using one or the other. I might end up using APPDATA to store save games because of this problem.

Bumpā€¦

Bump. But how about solution that uses blueprints instead? Please? Why hasnā€™t Epic staff chimed in on this question?

I also would like to here is there any proper way to do this.

I also would like to know if there is any proper way to do this.

Yup yup, would love to see a blue print node or console command that lets us set this.

Bumping this too. Would love a Blueprint or Packaging option to do this.

bumping ā€¦

bump, itā€™s crazy that there is no configuration option to change this!

1 Like

Buuuuump. Canā€™t believe still no Epic staff answering this.
And I donā€™t want to build the engine from source.

Bumpā€¦

Bump! Bump! Bump! Config option please.

Just ran into this issue when I have a saved game but deleted the packaged folder and remade it to find that same save game still there. Now Iā€™m sure Epic has good reason to place it inside the appdata but being able to change it with blueprints or an options menu would be helpful.

1 Like