• Advertisement
Sign in to follow this  

Resource file format? C++

This topic is 3877 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've created a nice set of core components for the rpg i'm writing and am slowly adding more advanced functionality, such as item slot restrictions and so on. The problem I am having is that I need a file format to load item, effect, npc data from that is extensible and nicely functional. I like tab delimited for being able to open it in Excel, and browsing cells is very nice, but I also like XML for being able to put multiple items in to each node (cell). I have tab-delimited files currently implemented, and have experience with XML readers also. Would you choose XML, TDL or a different option?

Share this post


Link to post
Share on other sites
Advertisement
If you've already implemented a file-loader for tab-delimited files, then I'd modify the file structure rather than using XML. For example, treating a row as a node, rather than each cell, or using comma-separated values within cells. You'll probably need to tweak this game data a lot later on, and writing a specific editor for XML files is going to take some time.

However, it depends on what's most important for your game, and on how much time you still can spend on this.

Share this post


Link to post
Share on other sites
Now, from my point of viey, the parsing of a tab-delimited file is a headache - what happen if you forgot one column on one line? You guess it - that's going to hurt you. XML is really better in that respect, because if you forget a particular tag, this will not have much effect on the init of the other variables.

There are simple ways to load a XML file (TinyXml is probably the best solution I could propose).

Unfortunaly, the edition of an XML file is a bit more daunting - Excel can't help you much here, so you'll have to resort to your favorite text editor. But in the end, it also quite rewarding - an XML file can be easily extended.

Edit: stupid stupid stupid qwertz German keyboard...

[Edited by - Emmanuel Deloget on July 15, 2007 2:44:38 PM]

Share this post


Link to post
Share on other sites
Interesting... I could use Emmanuel's suggestion and use CSV inside TDL cells. That would allow easy browsing through excel, but within busy cells it would be a nightmare. On the other hand, I just did a search for XML editors and some of them have worksheet-grid type editing interfaces... I'm not sure if there is one out there that is freeware and thin (I don't like installing monstrous suites of software that I don't need). What do the commercial companies and development houses use to store and import game data?

Share this post


Link to post
Share on other sites
Quote:
Original post by chaospilot
Interesting... I could use Emmanuel's suggestion and use CSV inside TDL cells.

Did I say that?!?! I'm fighting for XML man, not for CVS embedded in TDl files - I'm not that crazy [smile].
Quote:
Original post by chaospilot
That would allow easy browsing through excel, but within busy cells it would be a nightmare. On the other hand, I just did a search for XML editors and some of them have worksheet-grid type editing interfaces... I'm not sure if there is one out there that is freeware and thin (I don't like installing monstrous suites of software that I don't need).

You also know that you can edit XML with a text editor, don't you?
Quote:
Original post by chaospilot
What do the commercial companies and development houses use to store and import game data?

Depends on their need... Binary files, TDL files, CSV files, XML files... One thing important about all these: they can all be generated very easily from a XML file.

Share this post


Link to post
Share on other sites
Right, I meant Captain P's suggestion. My bad. :p

Hand editing an XML file is a pain though. You know us newfangled programmers, don't want to do the work by hand, want parsing and collapsible viewing... :)

Yeah, probably XML. Thx.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement