Monday, March 28, 2011

Mac OS X: Where should I store save games for a game delivered as a bundle?

Hi,

I'm porting a windows game to Mac OS X. I was wondering where I should store game data such as saved games, user profiles, etc and how I can retrieve that path programmatically in C++?

The game will be delivered as a "modern bundle" as specified here

From stackoverflow
  • ~/Library/Application Support/GameName
    

    You can access Cocoa objects using Objective-C++, this can be done by changing the suffix of to source code to .mm This enables you to combine both Objective-C and C++.

    There are several file system classes you can use.

    Ferruccio : should that be .mm?
  • Save it under ~/Library/Application Support/Your Game Name/

    where "~" stands for the home directory of the user playing your game.

    You may want to give this a read: http://cocoadevcentral.com/articles/000084.php

  • I know you've already accepted an answer, but let me file a complaint about the previous answers: ~/Library/Application Support is not one of the places non-technical users will look for data files. You might want to at least consider putting them in a new folder in the Documents directory; i.e., ~/Documents/MyGame.

0 comments:

Post a Comment