Location for save files

Whats the general preference for a save location these days? I have to save a users progress in a few files that they may potentially want to share between other players, but where should I put them?

Previously I’ve used System.getProperty(“user.home”) but on windows that usually returns something like C:/Documents And Settings/UserName which, frankly, nobody ever looks at (and past experience tells me that people have a hard time finding it even when it’s spelled out for them). Is the user.home property actually useful on Mac and linux, or is it equally bent there too?

For windows-only .zip distribution, a subdirectory of the game’s dir would probably make sense. But what about webstart? I don’t particularly like the idea of sniffing around trying to guess at a suitable location, and hardcoding something like C:/GameName is pretty dire.

Suggestions?

depending on the type of game… online saving? with sharing and all, Google Base or something might work out for you

Ideally I’d have a custom webserver where people can upload and share, but I don’t have the skillz or the time to do that really. So for the time being I’m sticking with the low-tech way of manually sharing files.

how about using the default System.getProperty(“user.home”) to store the files, but to share the files why dont you programtically zip up the contents and the ask the user where they would like it saved? i.e. user presses a “Share saved games” button which will bring up a file chooser dialog where the user selects a directory/file and then the contents of “user.home” are zipped and copied to this specified location.

Heh, FileChooserDialogs don’t mix very well with fullscreen LWJGL windows :stuck_out_tongue: I suppose I could always write my own, but that might be quite a bit of work.

I think Woogley answered this wish before it was even uttered. Google Base may well fit this bill. There’s a Java API, it’s not going anywhere anytime soon, unparalleled uptime and bandwidth.
Downsides are: Users would have to have their own Google logins if you want to avoid astonishing opportunities for mischief for malicious users, and AFAICS there’s no way to upload files to Google Base through the API, so you’d have to split the data into the contents of several attribute tags. I don’t recall the exact limit on the length of each attribute, but I’m pretty sure it wasn’t cripplingly miserly.

If I were in your shoes I reckon I’d go with Moogle’s suggestion - store the data invisibly (maybe java.util.prefs?) as a matter of course, but give the user the option to export it to a nice simple file somewhere obvious like the desktop. Presto! No filechooser needed.

user.home on linux works as expected, giving you the /home/user directory. Linux users will expect anything saved there withour their explicit consent to be in one of them hidden directories like /home/user/.game_data

After some poking Google Base might be a good idea after all. I didn’t realise they’d actually released a Java API now, which makes it a lot more appealing.

Now I just have to find time to write my own version of MySpace inside my game (again). ;D

According to the standards for Windows XP, you’re supposed to use the C:/Documents And Settings/UserName directory to avoid saving in the Program Files directory, which might be unwritable to non-administrators.