AUtomatic XML generation

Started by
2 comments, last by theOcelot 14 years, 2 months ago
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
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.
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.
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.

This topic is closed to new replies.

Advertisement