Sunday, November 26, 2006

Day 317 : Good ole Damocles

Just when I thought my collision system was going to work fine, it revealed a great big giant hole right into my XML parser code. Something you need to know about that XML parser code : It's one of the first thing I've coded when I started this project. It came after about a year of C++ break (I was doing actionscript 2.0). So it's probably the most crappy code you've ever seen. Ever. But I kept it because it would do the job. I knew a couple of things that wouldn't parse and I avoided them. But when I came up with my collision tree XML, it collapsed. Instead of patching this horrendous code I decided to trash it and pick up tinyxml to replace it. Still using my old XML and XMLIterator classes as wrapper. But then I found out that a lot of my classes unwillingly (unwittingly?) exploited a bug inside that crappy XML class. In other words, lots of stuff never should've worked but it did. That's the kind of pillar class that when it stops behaving like it used to, everything collapses. So it took a full day to rip the XML class apart and re-build most parts of it. So now the collision tree will work. My XML class still looks like crap, but at least now it points to something stable. I'll have some rewriting to do, especially in the editor, to make my XML loading and saving clean, but the hard part of this port is done.

The collision system I came up with is pretty adequate. I'm happy with it. A combination of AABB tree and spheres. No complex OOBB or collision meshes. For a rail shooter that'd be overkill I think.

No comments: