Unity Forcing local saved games in Unity

yesplznothx

Newbie
Jan 28, 2018
43
79
Hi everyone, and especially those with Unity engine knowledge.

I had to format my C: - so *all* my unity game saves are now gone, this sucks...
To prevent this in the future, is it possible for an end user to somehow force Unity to make saves locally, i.e. the game folder?
And does this need to be done to every Unity game?
Alternatively, is there a better way than creating a .bat file to simply copy over saves (which you then need to execute after playing each game)?

Thanks, I hope this discussion will help others, because I cannot stress enough how frustrating it is to loose progress in *all* unity based games...

-YPNT
 

overlord5

Newbie
Sep 8, 2017
34
34
so the game will proberbly have a folder it is allowed to write to, usually in the user folder, this is to prevent things such as anti virus making a big deal about it
you can make a small script that back-up the file else where, the same way steam does
 
  • Like
Reactions: yesplznothx

yesplznothx

Newbie
Jan 28, 2018
43
79
My tech knowledge is broad, but rather superficial when dealing with scripts, but I foresee a few issues with grabbing stuff via script from C:\Users\.....\GameSaveBackupfolder as its within either Roaming or Local/Locallow and I presume those are protected folders?

Also is it possible to tie this in with game execution, as a form of endscript - kinda like how you'd run a .bat-file back in the day? :)

Btw, speaking specifically about Windows based systems.
 

overlord5

Newbie
Sep 8, 2017
34
34
you can do a bat file that starts the game, then wait for it to terminate, upon termination it back ups the save files, you could also make your own little launcher that works like steam and keeps track of which processes are running and upon termination it copies the files

this is not my area of expertise though
 
  • Like
Reactions: yesplznothx

60Points

Newbie
Game Developer
Nov 1, 2019
57
92
Most Unity games save their saves in this directory:

C:\Users\"YOURUSER"\AppData\LocalLow\"DEVNAME"\"GAMENAME"

Some with custom plugins may change the folder according to the developer. But by default, Unity only grants access to that.
You can create a bat file to copy specific folders and restore them, or even consider adding them to a backup system like Google Drive.
Some also save data in UserPrefs, a less common and somewhat bothersome technique, but it's done (especially when there are few variables, like level, points, etc.).
HKEY_CURRENT_USER\Software\"DEVNAME"\"GAMENAME"
 
  • Like
Reactions: yesplznothx

yesplznothx

Newbie
Jan 28, 2018
43
79
Great input guys, and hopefully it will help others to at least consider making backups, C: is often the most exposed as windows complications and/or infections are often rooted there. Funny how RenPy games usually save both to Appdata\.... and to the /Game folder.