Sign in to follow this  
VanKurt

AUtomatic XML generation

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this