I want to store user profile’s data and saved games in Users directory for Windows platform and in the data directory for Android (IOS).
What is the correct way to do this with UE4? Is it right to keep the profile’s data in Saved directory?
Anyway, I would probably save profile specific information there or in the Game Config and load it into a custom game instance.
However, this is only useful if you’re only allowing one profile.
I have seen that functions. GameUserDir() returns subdir inside Saved/. Where is the Saved directory if I installed my game to “Program files/MyGame” or to sdcard1/Android/MyGame? Which directory I need to use if I want to create many userprofile files and save large binary files?
Well, really, Unreal doesn’t have a “specific” folder for this stuff like Unity does. Atleast not that I know of. So, it is up for you to decide where you’d like to put it. That is why I recommended the two FPaths functions which seem to be the most reasonable as both of those functions look at FApp::GetGameName() to find the game’s installation directory. So, more than likely FPaths::GameDir() returns “Program Files/My Game/” or “sdcard1/Android/My Game/” and it seems FPaths::GameUserDir() returns the same thing as FPaths::GameDir() for me.
Here is just a suggestion:
Use FPaths::GameSavedDir() and create subfolders inside of it. One for profiles and one for the binary data.
It should end up looking like: “Program Files/My Game/Saved/Profiles” or “sdcard1/Android/My Game/Saved/Profiles” and “Program Files/My Game/Saved/Binary_Data” or “sdcard1/Android/My Game/Saved/Binary_Data” you’d then just have to load it as you see fit.