Where to store things, per OS

Started by knucracker, April 22, 2016, 01:52:12 PM

Previous topic - Next topic

steelwing

Your last proposed Linux location looks good.  If you're using Unity to make the game, though, Unity has another location for where it puts things.
On Linux, that location is:  ~/.config/unity3d/<publisher name>/<game name>/
Some unity games (not all, by any means) store gamedata and/or settings there.  I'd rather you kept it someplace else, but up to you.  Just putting another alternative out there. :)

knucracker

That location for unity is where it will store 'prefs', and some other new things.  http://docs.unity3d.com/ScriptReference/PlayerPrefs.html

It's a facility Unity provides for some rudimentary persistent storage.  Some engine related settings are also there (like default monitor to use in a multi monitor setup).  It's in an oddball enough location on each platform that it isn't super appealing as a place to put other stuff.  But yeah, that's yet one more location stuff is shoved per game.

As for the final decision on where to put stuff (especially on windows), it's a no win scenario. :)  There is no place that will make everyone happy or be the expected place.  That's part of the problem and why it is all a mess.  Best I can do is pick some location that is at least in good company (some other games use it) and also provide a way in the game to change it. 

That said, putting the SETTINGS under the same directory and then allowing someone to change the directory location opens a channel for user failure.  For someone using the non steam version of the game the key is stored under the SETTINGS directory.  If the user changes the directory location and then doesn't copy or move the old location to the new, the game will start and prompt for the key to be re-entered.  Some of those people won't have their email with the key, and then will send me a support request for their email (yeah, such is an indie game developer's life that he has to think about stuff like this :) ).

If I don't make the directory location in game settings too visible, warn, prompt the user to move, etc... that should  cut down on some frivolous changes.  Of those that do change, most might be informed enough to move their stuff over.  If not, some of them will still have their key.  And of course these days most people are on steam anyway and the key isn't an issue.  I bet I'll still see a statistically significant increase in support requests, though :)

knucracker

Here's an old post with an interesting stat.  Out of 300 games, 25 use "My Games" under Documents (on windows).
http://www.ocmodshop.com/how-to-keep-game-saves-from-overwhelming-my-documents-folder/

For anyone on windows that has a lot of games installed, how many are saving in "My Games" out of the total you have installed?
It looks like the "standard", if you can call it that, is to just put stuff directly under Documents like I did for CW1,2,3.  It creates a giant mess, but it is a mess that existed before my games and will exist afterwards.  On the other hand, "My Games" is used as well, just in a minority of cases....

Also, for anyone with a "My Games" folder, what games are storing there?

J

Quote from: virgilw on April 23, 2016, 12:24:53 PM
Out of 300 games, 25 use "My Games" under Documents (on windows).

Also, for anyone with a "My Games" folder, what games are storing there?
For me it's 2 out of 30 (Rocket League and Railroads!). Please do not use both 'My games' and 'knucklecracker' as folder, one of the two is enough. I'd prefer 'My Games' then (which would be a good contribution towards making it the standard).

knucracker

And here is why you only see this kind of stuff in indie games... just read all of that text that says "please don't change this, please don't" :)

TLFP

I would have a "Reset to Defaults Button" to reset that to the defaults because some people (like me  ;)) will mess up a few times before getting the learning curb figured out.  :D Should help people some.
Currently ghosting, don't mind me.
Christian, my list of various content creation groups can be found here

knucracker

The checkbox next to it toggles it on or off.  So if unchecked, the default is used.  What is in the field only gets used if the checkbox is ticked.  The default is also always shows in text under the field.  And on top of that you can't enter a non-existent directory.  It gets checked when you try to apply, and if not present the checkbox gets unticked.

hbarudi

I don't understand why no games save in C:\user\saved games\game\files
Why not use the saved games folder, xp compatibility?
I want my games to be saved there, cw123 and particle fleet and also other titles from other developers.

GoodMorning

Is it practical to have the:
Default location store a small file that points to the actual location (this could be in the game's installation dir., as some form of config file)?
Game regenerate everything but the key automatically?
Key stored with the settings location file?
Game offer a "change data directory" option, which moves all the files that need to move, safely and properly?

Suggestions only. The last might cut down on support requests.
A narrative is a lightly-marked path to another reality.

Fireball14

#24
Quote from: virgilw on April 22, 2016, 01:52:12 PM
Latest Proposal
Windows
SETTINGS: c:\Users\USER\Documents\My Games\particlefleet\settings\
GAMEDATA: c:\Users\USER\Documents\My Games\particlefleet\
Note - Unity have a problem with chines paths.

PS Maybe JSON to PlayerPrefs?

knucracker

Quote from: hbarudi on April 24, 2016, 04:51:06 AM
I don't understand why no games save in C:\user\saved games\game\files
Why not use the saved games folder, xp compatibility?
I want my games to be saved there, cw123 and particle fleet and also other titles from other developers.

I can only speculate, but I can imagine that when it was introduced in Vista nobody used it because XP compatibility was paramount.  And since it was directly under the USER account (A peer to My Documents) there might have been permissions issues and such trying to create it.  This same logic carried over well into the windows 7 epoch since XP remained popular.  These days you could argue that XP compatibility no longer matters, but "Saved Games" has turned into that restaurant that nobody goes to.

It also isn't named particularly well.  "Saved Games" might make some devs hesitate since what they are storing is more than "saved games".  And of course if your app isn't a game, you for sure aren't going to store your settings in "Saved Games".

knucracker

Quote from: GoodMorning on April 24, 2016, 05:42:47 AM
Is it practical to have the:
Default location store a small file that points to the actual location (this could be in the game's installation dir., as some form of config file)?
Game regenerate everything but the key automatically?
Key stored with the settings location file?
Game offer a "change data directory" option, which moves all the files that need to move, safely and properly?

Suggestions only. The last might cut down on support requests.

The default location is basically hard coded per platform. It's a #ifdef in the code per platform build.  That takes care of knowing where to go by default per OS.  The setting you can specify that overrides this lives in Unity's PlayerPrefs.  On windows that lives in the registry, and in small files on OSX and linux.  The location in the registry/small files doesn't change.

As for auto migrating the directory over...
I always hesitate whenever I do anything that involves the file system and a recursive operation (even a copy, much less a delete).  Those of us who have been around long enough have all had that gut wrenching experience of "oh !@#$".
So I don't like to build in features that move or delete files.  If I do have anything, it will always be file specific not directory or recursive based.

I've actually taken a step in the opposite direction.  If you specify a custom data path, you have to make sure the directory already exists.  The game won't create the directory for you... it insists you go do that separately, then only lets you apply the setting once it sees it exists.

GoodMorning

Just a thought.

The problem seems to be unsolvable, and so the best course seems to be to pick something that you know will work, and use that.

(I would estimate that 9/10 players don't care where the files are, as long as the game runs properly. Of the remainder, many will probably want to know where to find them, but not necessarily move them.)

I could easily be wrong, but it seems to me that it must work first, and be customisable later.
A narrative is a lightly-marked path to another reality.

thepenguin

If you're going to have a linux/bsd installer, just make sure that people can change the install path (not everyone has a .local folder.  Also, because linux...)
We have become the creeper...

Nebulous

Is there anything else that you you want to run by us before the release of Particle Fleet? The people here probably have ideas for everything...