Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Location for save files  (Read 1286 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Posted 2007-01-26 20:43:04 »

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?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline woogley
« Reply #1 - Posted 2007-01-26 20:56:59 »

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

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #2 - Posted 2007-01-26 21:13:15 »

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.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #3 - Posted 2007-01-26 22:46:34 »

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?

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.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #4 - Posted 2007-01-26 22:49:47 »

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

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline ryanm

Senior Member


Projects: 1
Exp: 15 years


Used to be bleb


« Reply #5 - Posted 2007-01-27 02:08:08 »

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.

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
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #6 - Posted 2007-01-30 01:21:53 »

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). Grin

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline fletchergames

Senior Member





« Reply #7 - Posted 2007-01-30 03:51:14 »

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.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (25 views)
2014-09-21 02:42:18

BurntPizza (16 views)
2014-09-21 01:30:30

moogie (19 views)
2014-09-21 00:26:15

UprightPath (26 views)
2014-09-20 20:14:06

BurntPizza (29 views)
2014-09-19 03:14:18

Dwinin (44 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (100 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56

mitcheeb (71 views)
2014-09-08 06:06:29
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!