AI for Star Wars RTS game

https://github.com/Bulletdrone/CultFiction

 

For this game I took a scene from the Star Wars film and decided to make a small game out of it, in this game you control 10 units and you need to kill the AT-AT in the middle of the map, this is more a showcase of AI then anything else.

 

Player AI

The player AI for this game is simple, you click on a space and the AI walks to it. However I wanted to give it a twist that you have 2 groups of 5 units. So every time you order the AI to walk somewhere, the rest of the group follows him. Every group has a leader that everybody follows, when the leader dies someone else is appointed.

When the AI sees someone, it will automatically shoot towards it. An obstruction like a wall will stop the AI from shooting against it.