RSS Forums RSS
Please support our Game Development advertiser: Programming Forums

Saving Game Data - Plaintext vs. XML

Join Date: Jul 2006
Location: Deptford, London
Posts: 987
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 6
Solved Threads: 52
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: Saving Game Data - Plaintext vs. XML

  #2  
Jul 25th, 2007
I'm working on an XML game engine at the moment ^_-.. I'm allowing as much as possible ( objects/object traits, map layout, hopefully objectives [ basically everything except binary graphics and sound ] ) to be defined and linked up using XML.. In this case; the XML becomes a sort of 'pseudo source code' and it's thus important for it to be structured and easily interpretable at a glance. The interface should be elegant, the implementation should be quick ( and optionally dirty ); and both should be as portable as possible. In my case, a part of the interface is the structured input..

But if you're just considering save games; as in a player's postition and status in the game at any given point in time; you may WANT to keep those files unreadable - otherwise you'll encourage cheating =P.

Certainly don't worry about time-taken-to-load when considering an option; whether you're opening the game and loading in resources based on an XML manifest, or reading in a players position to re-enter the game :- the load time will usually be a one-off; which becomes irrelevant when compared to optimizations you can make elsewhere; say in the game cycle; physics engine, AI, redraw code, or anything else that has to be done repeatadly..

It might even be faster if you use a good XML parser ( I'd advise looking at an existing one rather than custom building, Apache's Xerces project is very full featured, and pretty stable, and quite fast ); than interpreting a custom file format; which may end up developing a complicated structure out of neccessity rather than any forward planning...
Plato forgot the nullahedron..
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:02 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC