Friday, March 18, 2011

DirectQ Update - 17th March 2011

It's just as well that I didn't release as planned yesterday as there were a few late-breaking bugs and areas in need of enhancement that came to light while I was doing a run through e1 to e3 (I'm not sure if I'll do e4 - all those Tarbabies - eeewww).

So I've got the memory saving and map loading speedups done. The items in question were edges, surfedges and vertexes in BSP models, which - if you've got your polygon building structured appropriately - can be taken directly from the on-disk versions instead of having to allocate memory, read them in, etc. They're only needed during polygon building, and once that's done they're never used again, so they went.

I also took the opportunity to sanity-check one element of polygon building, which was triangle strip conversion. DirectQ basically converts all world surfaces to a triangle strip layout at load time, which may be faster on some hardware owing to vertex reuse and less hopping around in the buffer. Popping the conversion into GLQuake (and using GL_TRIANGLE_STRIP instead of GL_POLYGON) confirmed that it's cool.

This is something that may be of benefit to GLQuake based engines in general; in theory it should be possible to add degenerate triangles and build a big chain of strips for drawing, which would enable them to get some of the benefits of batching without so much of the code restructuring overhead. MDLs in GLQuake could also benefit from it as the conversion code I have can convert any GL_POLYGON or GL_TRIANGLE_FAN layout to a strip.

This is all 1998-level optimization - indexed triangle lists rule on modern hardware (and are what DirectQ uses) - but I could see an engine that aims to still support hardware from that era reaping benefits for sure. I'm thinking that it's an area I'll most likely explore further in the near future, as I'm finding it tickling my interest a little.

What else is done is that I've fixed a nasty little bug that occasionally broke TAB autocompletion (this took far too much time to identify the cause of) and added a session-to-session command history. I've also tidied up the Finale (end of episode) screens so that the banner is aligned better with respect to the text.

Release on track for tomorrow. Look out!

0 comments: