AIs use a priority system to figure out what to build. Say an AI wants to build a defensive unit. It compares all the units it can build, and the unit with the highest "defense" priority gets chosen. If you'd like to help refine the AI's decision-making, please change these to 1 in the options file: You can then see AI priorities ingame like:Archer 2 offense 3 defense 2 ranged Horseman 4 offense 3 defense 4 mobile The AI considers horsemen twice as powerful as archers for offense. The two units are equal for defense. Archers are useful for ranged warfare. Horsemen are useful for mobile warfare. The basic patterns I followed are: Strategic and Siege units are valued higher than non-strategic units. Each era is valued higher than the previous era. Ranged units have higher priority for defense. Strategic units have lower priority for defense. (pillagable resources) Comparing values is all that matters. The numbers have no intrinsic meaning. Units could have 10 and 20 priority, or 1 and 2, and it would mean the same thing. Each AI has the preferences listed below. These determine which type of priorities the AI focuses on. It then selects something from that category to build or research. For example, let's say Alexander is deciding what to build. We can see from the table he's twice as likely to get a Mobile unit (horse/tank) as a Ranged unit (archer). Let's say he decides on a Mobile unit. He now looks at the mobile units available in one of his cities. He can build Chariots or Companion Cavalary. The cavalry have a higher mobile priority, so he purchases a cavalry.