Sign in to follow this  
Metus

Another XML Thread

Recommended Posts

I know there are alot of xml threads, but i don't care :) I've just implemented a Fixed / Programmable pipeline in my engine using XML templates now, and since I do not have a complete exporter to my own .ETH format, i just simply generated an XML template for my model. Since XML files are relatively easy to parse the thought of actually use XML to save my models... I did a simple test with 30.000 vertices and the XML occupied around 4Mb on my disk and around 3Kb with normal RAR-compression. However, I only stored vertex data, no normals or texture coordinates. I'd guess that the uncompressed file will be approx. 10Mb in size with normals and texture coordinates. Uncompressed, this file would occupy around 8Kb. Is this acceptable? I know that binary files are smaller, but they could be a pain in the lower regions to parse. The only con. I can see is the fact that I have to uncompress my models, but text-files are pretty quick to uncompress, right? Should I bother to write a different way of storing / parsing my models or should I just go with compressed XML's? Edit: thought I posted this in the Game Programming Part, but I was obviously wrong

Share this post


Link to post
Share on other sites
If it works, great. Only worry about speed if it actually becomes a problem. IF you think that it takes a long time to load the models, run it through a profiler to make sure that's what the problem is.

Then decide if you want to use a binary format.

Share this post


Link to post
Share on other sites
Binary formats are _very_ easy to parse, I expect they may be easier than XML (at least in some cases). All you have to do is fwrite/fread your structs to/from the file.

Where XML kicks binary is when you want to actually change the format. So use XML if you already have it working, and switch to binary if nothing else will work for you, towards the end of your project.

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