Having way too much fun with profilers.
I
will make the PD AI fast-yet-good, somehow, lol.
It's the most expensive single piece of AI code, because so many of the little pew-pew guns are PD, natch.
I've made it roughly 3X as fast as it was, roughly on-par with the regular, non-PD, which is pretty good.
The biggest issue with the PD AI is that when there are hundreds of missiles on the battlefield, things get pretty painful; SS wasn't ever really designed for Macross Missile Massacres on epic scales. This comes up mainly with the Glaug, where the Flyter remains a lag-inducing thing.
Sure, I can just change their weapon, but why not work on fundamental issues?
I think I'm going to try something out; there's probably a way to iterate through the ships once every few frames and build an array for that ship that's public; then the individual weapon AIs can check that list, instead of maintaining private lists. If that's doable, it'd speed up weapon AI performance enormously; one ship's list can get used for all of the weapons on that ship, reducing the number of distance checks by a huge amount. For ships with just one weapon, there wouldn't be any speedup, of course... but for stuff with more than 1, it'd be a huge savings, since it's necessary to do a huge amount of distance checks per update.
Buuut... interestingly enough, the most expensive single calculation in the whole shebang is WeaponAPI distanceFromArc(); I've been thinking that I should write a rough approximation that uses two triangles instead, as I think it'll result in considerable speedups with no really obvious loss in fidelity.
Anyhow, got through a chunk of the writeups; will try to get the rest done and kick out a release tomorrow if at all possible