Content storage and game saving in my project

Apprentice
Posts: 18
Joined: 2010.07
Post: #1
I've gotten to the point in my project where I need to start thinking about level generation and storing data pertaining to the player's progression in the game. The levels in my game are generated at run time based on a few input parameters, and probably will never amount to more 100 numerical values. This allows for quick level creation with a corresponding level creator, and the possibility of user created maps in the future. My question is, what's the best way to store these levels? Putting all the data into header files would be quick and simple, but that doesn't leave room for expansion (or some I'm led to believe). I'd like to be able to add more levels in without the constraints of using header files (or, the constraint I believe is there), and as I mentioned earlier the possibility of user generated levels.

Also, the only information that needs to be stored pertaining to game progress is the last level the player has beaten, and perhaps a basic high score list, so I'm wondering what others think the best option for this information is as well.

Thanks in advance!
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
Unless I'm missing something in your post, this sounds like a relatively basic resource management problem. The standard answer is to store built-in level files in some sort of serialized form (binary or otherwise) in the Resources directory inside your application bundle, store user-created levels in the same format in a user-specified location, and to store user progress in a preferences file, possibly by using NSUserDefaults.
Quote this message in a reply
Apprentice
Posts: 18
Joined: 2010.07
Post: #3
Nope, I think you hit the nail on the head. I'm new to iPhone dev, so I wasn't quite sure about the best course. Thanks again.
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #4
Ooh, didn't realize that was for iPhone. That changes my answer a bit; replace "a user-specified location" with "the Documents folder, as retrieved by this snippet of code".
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  CrystalEngine server solution for any game project Aldex 0 3,261 Sep 1, 2011 01:45 AM
Last Post: Aldex
  StorageRoom - Include content in your games sashthebash 0 2,333 Jun 13, 2011 05:39 AM
Last Post: sashthebash
  Help with opening/saving FlamingHairball 5 3,558 Jan 21, 2008 08:09 PM
Last Post: FlamingHairball
  Xcode project template for Game Developers Carlos Camacho 0 3,563 Oct 27, 2006 02:33 PM
Last Post: Carlos Camacho
  Saving a Place for Networking Roosterhouse 3 3,901 Aug 6, 2004 02:05 PM
Last Post: FCCovett