My insight into tactical AI:
- swarm mechanic - i would like to make point, which can clearly be seen in fights of one against many (though applies to other battles as well). Let's presume a single dragon fights my army of 6 units. My units surround a dragon and start to hit him, but damage is low and it will take time to kill. Now, the dragon any time he attacks he should move out of the circle (if possible) and THEN attack. The optimal move is to move in such a way that dragon will have contact with one unit only, and preferably the one that moves next. In this case, instead of having 6 units attacking and having swarm bonus, we will have series of attacks, each one without full bonus (first unit - no swarm bonus, second one moves and has now +1 swarm bonus, third follows with +2 swarm etc.).
This example shows the problem with AI - due to new weapons and skill positioning became more, and more important. However, once AI unit is in the zone of enemy unit it NEVER moves to reposition itself, but ALWAYS attacks.
Instead i propose:
Before attacking unit checks if a better position is available. However, only those positions that end up with attack are considered (this to avoid running around and doing nothing). Priorities should be: avoiding being swarmed, finishing wounded unit, and finally, the maximization of damage.
In general, however, units that are swarmed should always move and attack, and not just attack whatever is close at hand.