Here's a very rough concept of what my AI should do and perhaps makes more clear why I want it. Beware the typos...

:
Main aims of fbot:
- Everything that needs resources in one queue of entity/condition pairs
- Gather existent resources close to the deposits rather than collecting by type (A growing 'gatherRange' can do that reset when a new deposit is finished)
- What entities are build should depend on the available resources rather then be fixed
- Expand by territory rather than senselessly attacking
- Add conditions to give up (e.g. no civil center and (in sum 500 resources missing to build one OR no deposit for the missing resource), has to be tweaked...)
- Force units to return resources if enemies near and if close enough to be attacked by CC garrison if this adds damage to CC. Otherwise walk to the opposite side of the CC as the enemies are as long as some amount of hit-points. Otherwise garrison to safety.
- Re-decide what a unit should gather when it returned resources
- Develop an easy_ai_api (build as far as possible upon common-api-v2) that only requires fixed code (shown in a demo bot) and a custom list of entity/condition pairs (and attack conditions)
Abbreviations:
CC: Civil Center
CF: Citizen Female
CS: Citizen Soldier
More detailed:
----- Cover CC/food/wood/gatherers/popcap -----
- Civil center (CC)
(Without CC the game will be lost so this is the first priority even if you have drop-sides for all resources and enough resources and a builder)
(Edge case enough resources/popcap and barracks)
(Edge case drop sides/barracks/enough resources/popcap for CS but not enough resources for CC (hard...))
- Enough popcap to build units (If CC/enough resources for a gatherer but no gatherers/enough popcap to build gatherer -> force attack with all non-citizen soldiers)
- Food gatherer (citizens females (CF) if non-running food source near, else if resources for farm/farm available build farm, else if running food source and enough resources for CS build CS, else if wood near and farm available prefer gather wood)
- Wood gatherer (citizen soldiers (CS) if enough wood, else CF until enough wood)
- Field (Still prefer non-running Gaia resources in gather range)
- 10 CF and 10 CS
----- Food/wood/gatherers/popcap covered, before that don't do anything else! -----
- Build house(if not already present)
- Build mill
- Build farmstead
- Advance to T2
- Build 2 markets
- Build trade units (TU) for all non-food resources (5 each starting with wood if no wood in gatherRange, no wood if most of the entities in gatherRange grant wood and start with metal)
- 20 CS
- Add stone to be gathered (CS)
- 30 CS
- Build a tower in front (towards the enemy) of all markets if stone in gatherRange, else if enough metal otherwise 5 more stone trade units
- Build temple if stone in gatherRange
- Build barracks
- Build temple (if not already)
- (Maybe defensive structures right now but don't think so)
----- T3 -----
- Advance to T3
- Build a building crew (10-20)
- Build 5 fortresses at the border to the enemy
- Build non-preasant production buildings (for heroes, elite, siege)
- Build a defense force garrisoning in buildings good versus siege weapons that can be garrisoned anywhere(10-20, heroes/elite(unmounted?), CS (unmounted?))
- Build one of all non-present building types
- Expand territory with CCs near fortresses
- Build a hunting force of 5-10 ranged mounted citizen soldiers
- Further expand territory with CCs near fortresses
- Build 3 fortresses at the border to the enemy
- Build an attack force depending on civilization (Preferring ranged mounted/siege towers, heroes, catapults and rams)
- Further expand territory with CCs near fortresses
- Reinforce attack force until current pop-cap
...
- If popcap is reached -> Attack with all soldiers but foot citizen soldiers
In between sometimes check if markets could be placed better and raze unneeded fortresses (IMO the number shouldn't be limited but fortresses should be balanced though they are about to be balanced already)
Edited by FeXoR, 26 April 2012 - 12:37 PM.