AI and Gates – and potential refactoring.

This weekend was spent changing the way that the combat AI pursues targets. The issue was that often the AI would pursue targets forever, I’ve added some logic to prevent this – based on the new AI “postures” – they are very similar to the previous postures, except now there is a “Pursue” posture that means that the ship will pursue forever, this isn’t the default option, so most of the time ships will allow the player to flee, or won’t leave their bases to pursue enemies. I also added some triggers, and a “enemy to player” only faction – that will ignore anyone but the player’s ships, meaning that I can control the battle well. It can be awckward if you want the player to be attacked by 4 fighters, only to have a nearby base launch its fighters and intercept the attackers, sure sometimes I may want to help the player out, but when I don’t… I don’t.

Today I spent fixing the gate travel code – it was originally implemented a few months back – but never used. During the following months I’ve added features which broke the old gate travel system, but now its back in working order.

While looking at the game – I thought that I may re-factor the fundamental way that the “play areas” are setup. Right now everything is on a map (eg: multiple bases), and maps are connected via gates. But I may re-factor where only one or at most two bases are on a map, there are still gates, but adjoining sectors can be traveled to via the gravity drive. If you are confused as to what the difference between the two systems is – it is that the new method would have more potential for more “filled” play space. So for example in the old system I could have 100 asteroids, but because there are multiple bases (lets say 3) around each base would get 30 asteroids. With the new system of one base per “sector” – that base would get 100 asteroids. But let’s forget about asteroids for a moment, and consider assault platforms, or ships. Attacks would come from asteroid bases in other sectors, but the AI would only briefly live in the sector that the player is in, and nothing of other sectors would be rendered – thus letting the sector that the player is in – take more ships – in a more compact way. This would be a huge switch, but still the old system would remain, so for a more RTS battle you could have a play area like the current one, with multiple bases on one map, but for story purpouses the “less is more” sectors would come into effect.

Not sure that I’m making myself clear so I’ll stop now with this – today was fairly rough getting started coding, the weather is kind of grinding me down, still progress was made.