AI work – obstacle avoidance and turning

The big news is that I greatly enhanced obstacle avoidance, something I’ve been struggling with for years now. Did I ever tell you the time about my super crappy implementations of this? no.. well.. let me tell you they were super crappy. The previous method was (when an obstacle was in a ship’s path) was to simply tell the ship to go to a position above or below (depending on if the ship was nearer to the “bottom” or “top” of the obstacle) the obstacle until it could look at the destination without any obstruction, this worked most of the time unless the destination was positioned in such a way that looking at it from the above/below was impossible, in which case the ship would fly off into space. Pretty dumb and not anywhere close to release worthy.

Needless to say path finding is a huge issue and was a huge worry, this new system takes into account what is in the ship’s path, and intelligently plots a course to avoid it – based on math – figuring out the perpendicular to a vector, then projecting that vector outwards to find a safe position. Somehow the crazy thing works, even though my math skills are embarrassing.

The other neat thing that I worked on was giving larger ships different turning and speed parameters when their AI is active. Basically the larger the ship the more it will turn to face its destination before engaging its engines, also during these turns the larger ships will turn more so than pitch up or down, this makes them more very much different from small fighters and corvettes, further distinguishing them, giving them a more epic feel.