The expanses of WolfWings' land
scratched on the wall for all to see

May 4th, 2003
May 4th, 2003
May 4th, 2003
May 4th, 2003
May 4th, 2003

[User Picture]03:38 pm - Well, polygonal trails are in... now to fix the blasted things...

Not much else to say, really. The trails are constructed with a linked-list currently, though I think I may have to change that to specifically support perfectly-smooth trails behind objects.

Also, need to figure out a correct matrix-math sequence to handle the transformation of width to 3D coordinates better. The second screenshot, especially, you can see errors in the transformation at certain oblique angles.

The original math for it in the Q3A codebase... is horribly broken, and it took me much fiddling to even get it looking this good. Bleah. Still, it runs beautifully, with the aura trails being smoother the higher your framerate, automagically. So in a way they automatically get choppy if your framerate gets choppy, scaling down as needed.

Looking over my code, I'll probably have to gut and rebuild it AGAIN to handle properly-smoothed aura trails, but that'll be a final, complete revision. Have to make a linked-list of arrays of vertices that entities can draw from, like a pool. I.E. Instead of storing every single pair of vertices as a seperate entry in the linked-list, store groups of 16 or possibly 32 vertices, and allocate those as needed. This may actually reduce memory usage for the structures.

I use linked-lists and binary trees far too easilly, considering I learned how to program them first in ASSEMBLY for crisakes. I still have a fragment of code I wrote recently in fact. How'd you like to see a block of around 700 bytes of assembly that supports wildcard searches across millions of individual strings in near-linear time based on comparison-string length, and that includes multiple locations to tag additional information to any individual entry being searched against?

I.E. Hand it Cat, Dog, Apple, and a million other strings. Now, do a search for '*at' and get Cat, Bat, brat, 2134t148n90at, whatever matches it. It returns the first-found, and can continue the search from there for the second-found and further if wanted, and each of those Cat, Dog, Apple, and other-such entries can have ~16 opaque data-tags attached to it. I.E. Hand it ANYTHING, if in doubt it will stick it on as a pointer, automagically.

And searching for *at is relatively inexpensive, and if I kept developing the code, I could make *at be as cheap as Ca*, and *a* almost as cheap as either of those by auto-culling anything that had no chance of matching.

And the data structure I used for all this?

typedef struct opaque_s {
  struct opaque_s *opaque[128];
} opaque_t;

Yes, LOTS of typecasting, but not a single warning from GCC or anything else when it compiles. No, not a single warning.

Sorry, I'm just feeling a little egotistical when I really find a nice fragment or nifty trick in coding to pull off. :-) And as linked-list and binary-tree-friendly as I am... I'm STILL a low-level programmer. I've been creating and destroying objects and classes since before the 286 was around... allocating, copying code in, and using it until I no longer needed that instance, then sweeping it out of memory again, compacting memory myself, paging unused segments out to disk to support more code in memory in DOS 2.11...1 commentLeave a comment

Log in

No account? Create an account