Jump to content
  • Advertisement
Sign in to follow this  
VanKurt

AUtomatic XML generation

This topic is 3078 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

Hi guys! I'm having a simple problem and am sure that you can easily point me in the right direction. What I'd like to do: I'd like to create some game content in form of a database/excel sheet/whatever. For example unit names, their hitpoints, their texture, what faction they belong to etc. Then I'd like to export these information to an XML file, using my own format. What do you think, how can that be done? Can I use Excel for that? Or some sort of database + a third party tool to export to XML? Or some sort of scripting language? Thanks :-D

Share this post


Link to post
Share on other sites
Advertisement
Google TinyXML.
It is a pretty lean but good XML parser that is easy to learn. There are a few tutorials for it floating around the web also.

Share this post


Link to post
Share on other sites
Look into Google's protocol buffers library. It's a much better alternative than XML when it comes to interaction with code, at the expense of losing human-interaction because it's a binary format - so if you need to be able to edit the data files by hand, then it won't be of much use to you.

Share this post


Link to post
Share on other sites
Actually, any spreadsheet will probably save to CSV format (comma-separated values), which is really easy to parse. Just take individual lines, tokenize them on commas, and use the tokens.

This is what I use for my level files. It might not be exactly as clear for describing units as it is for array data like my levels, but that's not a big deal if you design the format right.

If you don't like that, I guess you could use a script of some sort (probably Python or Ruby) to convert CSV or whatever to XML.

Then there's always SQLite, for which there are a number of generic graphical editors.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!