Fixed some amazing bugs yesterday! Wow! There was an OBSCURE bug. Insane. Not relating to threading but, like, the levels I had to peel off to figure out what was going on. Well. I'm impressed with my debugging ability sometimes. This bug involved like 8 classes or something and turned out to be due to some optimization thing I had done, in order to write directly into an aggregate I had used a friend function, then later, I changed it from aggregate to ref but didn't rework the function (that was ok), then later on, I changed it again to delay the object buffer compile (to speed autogen) and this is where it got into trouble, because I was forgetting to set a flag in the friend function (to detect the delayed creation), so for these objects, most of the time it would think it was already generated which would mean normal behaviour, the rest of hte time, it would go an regenerate the object buffer which meant that later on when the physics class asked for a radius, it would get a big fat zero, which meant the physics class would cull the object... I think this bug was at least related in some part to the crashes I was seeing. Crazy.
Later last night I reworked the "cruise" targetter. I am now using a simplified progressive waypoint system. The idea is, suppose some ship wants to fly from some position to another. It can't fly in a straight line for a number of reasons, not because of moving targets so much but becuase it has to know how to fly around planets, leave the planet it's on if required, and so forth. The system as it's now coded has a number of cases, but what it basicaly does is say, "okay, where are we, and where do we want to get to? set a waypoint that will get us closer." It doesn't lay out the whole course, instead it just chooses the next waypoint. When the waypoint is reached, it picks another waypoint. The conditionals and so forth are laid out that hopefully, the ships will always be able to reach their destinations. At any rate, things are already looking quite a bit better in terms of enemy flight patterns, though it still needs lots of testing/tweaking/etc.
Today I will do that testing/tweaking/etc., and also maybe rework the players autopilot to use it (it's a good way of testing it, actually...) This is nice, I had meant to fix the autopilot for awhile. The drone AI system is actually rather easy and flexible to use, but the current cruise targetter has been a problem since it creates many bad-looking things (ships that fly too fast, try to fly into the ground sometimes, don't properly avoid planets, etc.)
I also have to work up a lo-rez version of the planetary terrain surfaces, for computing paths and such on planets that the player isn't on. That's just an organizational thing, more than anything..