View Full Version : Mac OS X : Storing user files (saves, levels)
ggambett
07-15-2004, 03:03 PM
Where would be the "right" place to store user's savegames, and more importantly, custom levels made by them?
I'm thinking of placing them in /Users/<user>/Documents or /Users/<user>/Documents/<game>. What do you think?
radiance
07-15-2004, 06:04 PM
If you don't think the users have any reason to access the save files directly in the Finder, then I'd recommend:
/Users/<user>/Library/Preferences/<game>/<saveFile.001>
Looking at my computer most games seem to be saving all their info there. I can't find a game that's putting save files specifically though.
My documents folder has almost nothing there that wasn't placed there by me, and I find those few things a bit annoying :eek:
Sillysoft
07-15-2004, 08:44 PM
I believe the Apple recommended place for such things is
/Users/<user>/Library/Application Support/<your-app-name>/...
Take a look inside your Application Support folder and you will probably see stuff from other applications.
radiance
07-15-2004, 09:12 PM
I believe the Apple recommended place for such things is
/Users/<user>/Library/Application Support/<your-app-name>/...
Take a look inside your Application Support folder and you will probably see stuff from other applications.
Ah yes, you're right. That's even better!
aldacron
07-16-2004, 05:23 AM
What's wrong with using a subdirectory in the game folder? Personally nothing annoys me more than application data being written to a directory outside of the app's tree. It makes no sense! If the data belongs to the app, it should be local to the app. What happens when the uninstaller doesn't remove the extra data? Now rather than zapping it in one shot by deleting the app folder I have to go hunt through my documents folder to find it. It's one of the reasons I don't use Linux regularly (apps write files all over the place on Linux). And I know there are many Windows/Mac users out there who have no clue that a common application data directory exists on their machine. Or is there some benefit I'm just not seeing?
ggambett
07-16-2004, 05:26 AM
What's wrong with using a subdirectory in the game folder?
Readonly disk images?
Sillysoft
07-16-2004, 11:32 AM
On Mac many applications are packaged into an application bundle. This means that the user just sees a single application icon. It is possible to save stuff inside of the bundle, but this breaks on read-only partitions, and the the user would have to go snooping through the app bundle to see the data. That is why lots of Mac apps have a separate place for such data.
For the Windows version of my app I store stuff in a subfolder of where it was installed.
milieu
07-19-2004, 11:33 AM
What's wrong with using a subdirectory in the game folder?
On Windows, games are generally installed under Program Files. Program Files usually requires admin to access, so your users end up needing to be admin to save a game. This prevents a parent (as admin) from installing the game, and letting their children run it without worrying about them trashing other apps by accident.
Also, there is a nice benefit to saving under the user data directory. Every individual user of the system can save their own options, keyboard configs, save games, etc. and not interfere with other people's options.
What happens when the uninstaller doesn't remove the extra data? Now rather than zapping it in one shot by deleting the app folder I have to go hunt through my documents folder to find it.
This is just a bad uninstaller, not a problem with using the docs folder. A good uninstaller should ask if the user wants to remove saved games, regardless of where they are stored.
aldacron
07-19-2004, 10:56 PM
On Windows, games are generally installed under Program Files. Program Files usually requires admin to access, so your users end up needing to be admin to save a game. This prevents a parent (as admin) from installing the game, and letting their children run it without worrying about them trashing other apps by accident.
Also, there is a nice benefit to saving under the user data directory. Every individual user of the system can save their own options, keyboard configs, save games, etc. and not interfere with other people's options.
Hmm. I never considered that people would set up different user accounts on a home system. I'd be interested in knowing how common it is. Personally, I have no idea how to manage multiple accounts on XP (I'm using the Korean version of XP when my Korean does not extend to the realm of Windows) :)
Aside from that, it is not uncommon for gamers to install not to Program Files but to a different directory (often on a different partition/drive). Granted, I can see the benefits of having different configurations for different users. However, I really think that in order to get the best of both worlds one we should get the option at installation time to select a path for application data the same as we get for the install path.
This is just a bad uninstaller, not a problem with using the docs folder. A good uninstaller should ask if the user wants to remove saved games, regardless of where they are stored.
I understand the root of the problem. But the end result is that I can't delete the files remaining without first searching for them - and there are many bad uninstallers out there. How many times have you had to go through and delete an app's root directory (and even clean out registry entries) after uninstalling? Now I have to browse through my application data directory as well? This is another reason that all installation programs should make the path configurable.
For single-user systems a separate app data path provides no benefit that I can see. And I'm willing to bet that the majority of cutomers who buy our games have their systems configured for single users (whether one person uses it or not). I was unaware of how things work on Mac, so I suppose there it makes more sense.
Nutter2000
07-20-2004, 01:35 AM
This is just a bad uninstaller, not a problem with using the docs folder. A good uninstaller should ask if the user wants to remove saved games, regardless of where they are stored.
The only problem with saving in My Docs is that you have to be aware that pre-2000 windows doesn't have a My Docs so you need to save it elsewhere :rolleyes:
Which can be a bit of a pain, and it's ugly software design to have two entirely different possible save directories imho, but you just have to remember to store the save directory location somewhere for the uninstaller, like in the registry.
And I'm willing to bet that the majority of cutomers who buy our games have their systems configured for single users (whether one person uses it or not).
possibly, but it's not too much hastle to set it up to store in the user's data directory and then you're catering for everyone.
So does anyone know where the best place is to learn all the intricacies when programming for Mac? (apart from here obviously ;) )
radiance
07-20-2004, 09:10 AM
So does anyone know where the best place is to learn all the intricacies when programming for Mac? (apart from here obviously ;) )
The best parallel to Dexterity's forums on the Mac:
http://www.idevgames.com/forum/
The iDevGames site as a whole is in the process of being brought fully back online after being down a few months due to hard-drive problems and before that being hacked. Overall it's a good starting point when looking for information and resources for developing games on the Mac.
And Apple's Mac-games-dev mailing list is good:
http://www.lists.apple.com/mailman/listinfo/mac-games-dev
Nutter2000
07-21-2004, 12:40 AM
Great thanks, I'd had found iDevGames but didn't know if it was the best place to go.
thanks for the mailing list link as well, I'll sign up now :)