Save game state using Property list or Text File?

Posts: 23
Joined: 2007.12
Post: #1
What is the best way to save a games state Property list or Text File?

In "iPhone Application Programming Guide" it says

File Access Guidelines
When creating files or writing out file data, keep the following guidelines in mind:

Minimize the amount of data you write to the disk. File operations are relatively slow and involve writing to the Flash disk, which has a limited lifespan. Some specific tips to help you minimize file-related operations include:
Write only the portions of the file that changed, but aggregate changes when you can. Avoid writing out the entire file just to change a few bytes.
When defining your file format, group frequently modified content together so as to minimize the overall number of blocks that need to be written to disk each time.
If your data consists of structured content that is randomly accessed, store it in a SQLite database. This is especially important if the amount of data you are manipulating could grow to be more than a few megabytes in size.
Avoid writing cache files to disk. The only exception to this rule is when your application quits and you need to write state information that can be used to put your application back into the same state when it is next launched.

The data I am looking to save is Game Struct (Object Position,Speed,Size) all 2 vectors

So what would be my best choice?
Quote this message in a reply
Posts: 613
Joined: 2004.09
Post: #2
I have always written out to a plist if I am working with a small amount of data that would neatly fit into a dictionary, once you start getting out of those bounds look at custom files.

Accessing the file when the player exits the app and launches the app isn't really going to cause a lot of i/o you should be fine unless you feel compelled to update the save every frame or something.

Kyle Richter
Twitter: @kylerichter
Quote this message in a reply
Posts: 23
Joined: 2007.12
Post: #3
Well basically I am going to be saving/loading 15-50 Objects & the games High Scores when the App starts an closes. An just wanted to know if saving to the plist was better for the flash memory then using a txt for the games data.

an Thanks for the Help.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Game State Management Mattonaise 6 6,870 Apr 16, 2011 10:18 AM
Last Post: Mattonaise
  How do you create enums for state charts in ObjC? riruilo 7 6,581 Mar 27, 2010 11:50 PM
Last Post: AnotherJake
  Problem with reading bundle text file momostu 4 3,065 Feb 24, 2010 02:05 PM
Last Post: momostu
  Taking Pictures of Game State inside an app Bersaelor 7 5,034 Nov 3, 2009 05:07 AM
Last Post: Bersaelor
  IBOutlet on Field or Property? Nick 12 7,971 Oct 2, 2009 01:08 PM
Last Post: SethWillits