Lunar Flight > Technical Help > Topic Details
RetroBlast Feb 19, 2013 @ 5:57pm
Bug: Hard-coded save game path
Just noticed that the save game path (C:\Users\<username>\Documents\Saved Games\) is hard-coded into the game. Unfortunately, this doesn't help when a user has moved their documents folder (like I have, as I have an SSD for my boot drive, but keep my documents on a different hard drive partition).

Is it possible to query the system and use the virtual path to the documents folder for game saves (even better, to use the designated "My Games" folder within)?
Showing 1-8 of 8 comments
< >
sh0v0r  [developer] Feb 22, 2013 @ 4:25am 
The path is derived from the System so I'm not sure what is happening here?
RetroBlast Feb 22, 2013 @ 5:08am 
Hmm...that's strange. I've moved the documents folder to d:\documents\ , and other apps find the My Documents folder just fine. Could it be a Unity issue? Anyone else have a moved documents folder?

Only reason I noticed it was I went into my user folder on the C: drive, and found a second documents folder, with just the Lunar Flight game saves. It's obviously not a killer bug, but it'd be nice to have the game saves in the "My Games" folder.

Of course, if you add Steam Cloud saves, this all becomes moot, anyways. ;-)
sh0v0r  [developer] Feb 22, 2013 @ 7:24pm 
Yeah Steam Cloud is something I would like to support. How exactly did you move the MyDocuments folder, is that a windows supported feature?
RetroBlast Feb 23, 2013 @ 12:22pm 
Originally posted by sh0v0r:
Yeah Steam Cloud is something I would like to support. How exactly did you move the MyDocuments folder, is that a windows supported feature?

You just need to right-click the folder, select "Properties", then click the "Location" tab. Allows you to put the folder anywhere.

The way to access the correct path in programming environments is "%USERPROFILE%\My Documents\"

http://en.wikipedia.org/wiki/My_Documents
sh0v0r  [developer] Feb 24, 2013 @ 3:23pm 
This is how I derive the path, I wonder if its because the folder names are different, they both end up in My Documents though.

userProfilePath = System.Environment.ExpandEnvironmentVariables("%USERPROFILE%/Documents/Saved Games");

"%USERPROFILE%/Documents/

vs

"%USERPROFILE%\My Documents\"
RetroBlast Feb 24, 2013 @ 4:50pm 
Hmm. Not sure, but I do notice that your method creates a "Documents" folder under the user profile, but it's not necessarily a designated "My Documents" folder. (Windows knows that my "Documents" folder on the D:\ drive is the proper My Documents folder, and that your Documents folder under my user account is just a generic folder, for example).

For most people saving to the "Documents" folder under the user profile just so happens to go into the "My Documents" folder, as that's the default location. But it looks like you're just designating that you save into a folder named Documents located in the user profile, rather than the OS-blessed "My Documents" target (which can be anywhere).

Of course, I'm not a programmer, so take anything I say with a big grain of salt. I'm just thinking out loud.
Zorlac May 28, 2013 @ 8:01pm 
Originally posted by sh0v0r:
Yeah Steam Cloud is something I would like to support. How exactly did you move the MyDocuments folder, is that a windows supported feature?

SO how's that steam cloud coming along?
raron Jul 26, 2013 @ 1:18am 
I just noticed that Lunar Flight puts the "Saved Games" folder at the wrong place, inside the Documents folder. It should be "outside" the Documents folder (at the same level).
Probably like "%USERPROFILE%\Saved Games", but I'm not sure if that is the correct way, I have to say.

It's kind of no biggie, but it adds to the already increasing mess of all the other save game folders scattered all over, usually in the Documents folder.

In short, there is at least these:
a "My Games" folder - with ofc save game folders inside
<publisher name> \ <game name> folders
<simply game names> folders

inside the Documents folder, and now also another "Saved Games" folder.

Note for "publisher name" folders, there are ofc multiple publishers, so one might have multiple folders. Same with the "simply game name" folders yet again. So in the end it might be a lot of folders scattered around. Most likely other places too.


Oh, btw, I also have a SSD for boot drive C: and another HDD drive D: for games etc, and I moved the "Documents" folder to drive D:. There was no issue with that, the Lunar Flight's "Saved Games" folder moved along with it (except of course it should be in the official one (I presume) as mentioned above).


EDIT: probably should mention that I have Windows Vista Ultimate 64 bit, don't know about Windows 7 or 8.

EDIT 2: Found out there is a hole bunch of savegame folder outside of the (My) Documents folder also, in "roaming" and local folders in apppath or somewhere like that, for some games.

I would also like to add, I like the "My Games" folder inside Documents best, as it keeps it somewhat tidy and in one place (even if I dislike the "My" prefix that followed windows until Vista). Also easy to find and back up.
Showing 1-8 of 8 comments
< >
Per page: 15 30 50