For the AI routines for this game I used a hive mind style AI. There is not smart general anywhere thinking for the colony but the colony behavior is dictated but each individual.
There are three states the units can be in: Harvest, Attack and Defend. Each mode is only a simple goal oriented pattern. For example an attacking unit moves around randomly until an enemy comes in range. It will then chase it and attack it until it's dead.
The group intelligence come from the way each unit talks with each other. When a harvesting unit finds resources it broadcasts a message telling others where they are. Other harvesters, if close enough or not busy, will head to this location and even attackers might change to harvesting duty if not fighting. Each unit has a mood that can be swayed but messages. These messages can be seen as sprays of particles (red stars for attack, green gears for harvest and blue shields for defense)
The messages have limited range and it is each units duty to rebroadcast them to allow the messages to propages to the rest of the colony. Factors like distance and repeat count affect the efficiency of the message and may be ignored by other parts of the colony.