Why can't the AI cope with this cheese? Seems as though it could, so long as it took the threat as a priority.
I'm taking it for granted that we identify this situation, early tuns, low player city count, etc.
I'm also taking it for granted that the AI being caught out here has made a moderately risky start, and certainly hasn't decided to turtle.
I'm going to give to responses, one is my go at a counter AI and expects the AI to do a lot of work, the other is done through a game play mechanic with simpler AI strategies. I'll do the second one in a different post.
AI - Counter Attack
The counter attack strategy should work here, so long as the AI hasn't been to super risky in it's growth and has no force. This strategy implies that we consider the threat above all others.
There are 2 types of counter forces that the AI might use, the power counter stack, and the speed counter stack. The power counter stack works by being big enough to discourage/defeat enemy attack, the speed counter stack works by being very fast and/or numerous to avoid attack.
Feel free to amend, I don't really know the game that well, and TBH this is not something I've done before. Each Strategy should be able to (I think) run in parallel, although they do spawn each other.
STRATEGY 1 - Counter Stack Machine
1. Identify out next city along his attack vector. This is our frontier city.
1. All small cities begin building scout units, larger cities build shock troops (Move adds? Poison?) - These are heading for the frontier city.
2. 50% of our forces (in power - atk * hp, with a preference for movement adds and casters) need to link up outside the frontier city immediately - The the half closest to him (cap force depending on Power v ETA) - We cannot wait long. This is a power counter stack
3. Remaining 50% of forces need to move towards and start shoring up into the frontier city.
4. If we sight the player at our city borders before our counter stack is ready, the counter needs to add to the city, and we create a few new counter stacks with the fastest movement (this may be a single unit, or a combination of units if they have army move adds), this is the fast counter stack, follow Strategy 3
5. If not, power stack follows Strategy 2
6. Loop step 1, increasing the power stack in size each time, or until threat has diminished.
STRATEGY 2 (power counter stack)
1. Power stack moves directly towards the enemy city, if we encounter the enemy along the way (not in city) we check its power.
1.1. If it's < -20% or move than us, we attack
1.2. If its between +10% and -20% of us, we split 1 to 2 (max 15% or stack power) units off our army as separate fast counter stacks to follow Strategy 3, and the original stack pitches a tent and attacks if it attempts to pass. Loop to step 1
1.3. If its +10% - +30% of us we pitch a tent and attacks if it attempts to pass. Loop to step 1
1.4. If it's more than that, then we split 2 units off our army as separate fast counter stacks to follow Strategy 3, the original stack heads back to the city. (this step in effect waits until strategy 1 produces a bigger force).
2. Once within spot range of city
2.1 Attack (combined) if enemy < -20% power than all units within spot range.
2.2 If its more than that, we split 1 to 2 (max 15% or stack power) units off our army as separate fast counter stacks to follow Strategy 3, the original stack pitches a tent and attacks if it attempts to pass towards city. Loop to step 2.
STRATEGY 3 (fast counter stack)
1. Move in an perpendicular arc (with additional units spread equally over the opposite perpendiculars) away from any enemy stack and towards the nearest enemy city that is along the vector to the center of the enemy territory.
2. If unit is chased and cannot outrun, unit heads directly along the perpendicular away from the frontier city and the enemy unit. Loop to step 1 if he his distance between himself and the chaser becomes greater instead of smaller.
3. Once within spot range of city (or move to the edge if not already)
3.1 Attack (combined) if enemy < -20% power than all units within spot range (combined forces).
3.2 If enemy between -20 and +200% combined forces we have pitch a tent on ouskirts. Loop to step 2.
3.3 If enemy > +200% combined forces re target FURTHER along the vector and loop to step 1.