Artificial intelligence

The Artificial Intelligence or AI, is the computer orders on how the enemy and ally computer player and some units react in the environments of a game.

The AI in the Age of Empires series has improved greatly on many aspects since its implementation in Age of Empires.

Age of Empires
The AI in Age of Empires and The Rise of Rome has several notable traits, including: In these circumstances the AI will send all of their villagers to attack the threat.
 * AI will rarely, if ever, build walls.
 * AI will often send their villagers to scout the map early in the game, even if doing so puts their villagers in jeopardy.
 * AI will continue to build villagers/fishing vessels until they have about 30 or so.
 * AI will send their villagers to repair damaged buildings/towers/walls, even if it would be foolish to do so .
 * Later in a game AI will not build storage pits/granaries next to resource sites, but will gather resources from miles away.
 * AI do not hunt elephants.
 * AI will generally train a few specific types of units, and rarely have a diverse army.
 * Once AI military units are attacking a target (such as a building), they will never stop attacking it for any reason unless directly threatened.
 * AI will sometimes use military units that are outdated, for instance, they may use clubmen in the Iron Age
 * AI will build their army based on their civilization's strengths, for example, an AI who is the Choson civilization may train only swordsmen.
 * In the Rise of Rome expansion, the AI seem to like training slingers regardless of their civilization and age, perhaps because of their ability to inflict full damage against buildings and towers.
 * AI will never attack with their villagers unless one of the following circumstances occurs:
 * They are attacked early in the game, such as in the Stone or early Tool Age.
 * Their civilization is being crushed and defeat seems imminent.
 * If an enemy starts building a tower in AI's base, sometimes AI will send everything including villagers to attack the tower.

The Age of Kings
The AI in Age of Empires II is much more advanced than the AI in the previous installment. The Computer Player Strategy Builder Guide lists what each difficulty of the AI will do and what not:

Note that the hardest AI does not only get resources at the start, but upon reaching any Age, including the Dark Age. They get 500 of each resource every time for a total of 2,000 each when they reach the Imperial Age.

The Conquerors
In The Conquerors, the AI has been improved slightly, being more aggressive.

The Forgotten
In The Forgotten, the AI has made a huge step forward, being a challenging opponent in higher grades of difficulty. Some aspects of the Computer Player Strategy Builder Guide do not apply anymore. The resource bonus, for instance, was removed. Also, the AI uses the trade heavily now, thus generating more gold. But the aggressiveness they play with is the biggest difference, though. The AI either rushes or booms with heavy attacks in the early Feudal Age or late Castle Age, respectively. If an army is outnumbered, sometimes it even retreats. But still, when being besieged and mostly destroyed, they do not rebuild their base.

The difficulty of the campaigns is much higher than it was in the previous versions.

The African Kingdoms
In The African Kingdoms, the AI was barely modified. The campaigns can be compared those in The Forgotten in terms of difficulty.

Trivia

 * Regardless of difficulty, the AI often dodges projectiles of ranged units. Also, it uses hit-and-run tactics with ranged units itself, making it hard especially for infantry using players.
 * Interestingly, the AI will sometimes cancel the construction of a building if it is only built by a single Villager and that Villager is attacked.

Random Map AI Personalities

 * Standard: the most balanced AI, balances economy and military pressure. Usually attacks starting from the Classical Age, but only sends two waves per Age. Rarely walls.
 * Attacker: attacks early and raids frequently. Spends a lot of time in the Classical Age but will advance to the Heroic Age if their military pressure fails. Does not spend resources on Walls or Towers.
 * Conqueror: begins training a massive army in the Classical Age but does not attack until the Heroic. Is vulnerable to rush strategies.
 * Builder: focuses entirely on its economy in the early game, building and training the bare minimum. Will advance to the Heroic Age as quickly as possible and will follow up with heavy attacks.
 * Protector: will attempt to secure a large section of the map by first walling themselves and will then build many towers in the Heroic Age over a wide area. Will make a modest army in the Classical Age but will not attack until later in the Heroic Age.
 * Defender: will focus on defending the area closest to its immediate area with walls and towers. May attack in the Classical Age as resources permit and will advance to the Heroic Age at a much later time.
 * No AI: does absolutely nothing
 * Random: selects randomly from the above

Random Map Quotes
Introduction Casts God Power AI Ages Up First Player Ages Up First Captured Relic Prepares to Attack Player Caught Building Walls Player claims Town Center Player or Ally loses Town Center Note that the enemy may also quote these if the player casts the Citadel God Power Enemy Loses Last Town Center Enemy Loses Wonder/Titan Gate Offers to Surrender The enemy AI will usually offer to leave the game whenever the player has done severe damage to them, such as destroying their Town Center or killed most of their worker units. The player can choose between Yes or No
 * Just keep your armies in your own lands, and we will get along fine.
 * Good luck! You're going to need it!
 * Build many, many walls. You'll need them when I arrive.
 * My gods have a gift for you! I hope it hurts.
 * The gods have given me great power.
 * Take that!
 * You cannot possibly expect to win with your limited technology.
 * Your people have yet to discover fire or the wheel.
 * You may have technology, but we have numbers
 * Even though you are more advanced, it will not save you from defeat.
 * Your gods have showered you with blessings.
 * Perhaps you would like to share some technology with me?
 * If you want this Relic, you will have to pry it from my Temple.
 * Look ma! I found a Relic!
 * I shall present this Relic to the Temple of my Gods.
 * It won't be long now. Soon you will see my banners in your lands.
 * I toy with my prey.
 * You are in my way. You shall be removed.
 * Walling yourself in? That won't help you.
 * I will soon take from you what is mine.
 * I know where you are expanding.
 * You prey upon the weak.
 * Do not think you can challenge me.
 * Oh, did you need that town?
 * You have removed all of my cities from the map.
 * Hey! I needed that!
 * Curse you! I spent a lot of resources on that Wonder!
 * Perhaps you would allow me to leave with some dignity?

Age of Empires III
The AI also have their own preferences, copying defenses in each game. The group below presumes that the player is not playing on a post-industrial or imperial gameplay as the towers will already be on Fortified level.


 * Queen Elizabeth, Napoleon, and Suleiman the Magnificent always upgrade Outposts to Frontier level.
 * Maurice of Nassau always upgrades Outposts to the Fortified level.
 * Queen Isabella does not make Outposts but does use the Outpost Wagon card, but replaces it as her level increases.
 * Ivan the Terrible builds Blockhouses due to serving as both a defensive and infantry production building. He does not upgrade them at all.
 * Prince Henry the Navigator and Frederick the Great never build Outposts.