Age of Empires 2 DE AI

Are you scratching your head about how to win Age of Empires against the different AIs?

Age of Empires 2 AI Difficulty

Is the constantly improved AI handing you your you-know-what time and time again? Did you ever wonder why that is and how you can gain back control over the AoE battlefield?

Age of Empires – it can seem so peaceful – but the AI lurks in the shadows

Depending on the AoE version you are playing, your inhuman AI opponent comes with hundreds or even thousands of (new) lines of code, outlining all its strategies and behaviors.

If you could take a peek at the code over the years, you would find everything from pre-programmed strategies per civilization, and tactics in deathmatch games to rules about the number of mills per farm the AI builds.

Age of Empires AI’s code fraction

Especially in the older versions of the AI, this could lead to very frustrating gameplay. The computer would build walls into nowhere or completely ignore your attack. The dumbest, oldest and closest to the original version of the AI shipped with AoE II DE is the so-called “CD” release.

Over the 20+ years since its first release, Age of Empires has been released in several versions and updated versions. Today the relevant AoE releases are Age of Empires II DE (DE=Definite Edition), Age of Empires III DE and since the end of 2021 the long-awaited fourth release – Age of Empires IV (4).

With all these releases, different versions of the included AI have been accompanying the game. And as the graphics have highly improved over time, so has the AI.

And: Celebrating the about first 20 years of Age of Empires the AoE II Definitive Edition features all prior generations of the game’s AI (ex AoE III and IV versions).

Age of Empires Definitive Edition AI

Next to featuring a new “Extreme” setting , making it very hard to beat, it also was taught how to counter your attacks more effectively, and the complexity of its strategies has also been enhanced.

Three different AI options in Age of Empires 2 DE

How does the AI in Age of Empires 2 DE work?

Up until the recent Age of Empires IV’s AI, calling the computer player’s engine “intelligent” meant giving it too much credit. In reality it was just following a script of rules given by human coders (see above).

For example, let’s say the AoE II’s AI owns more than 15 farms in a single town center with less than two mills, then it will build another one – with a small set of rules about where it should be built to minimize the distance to farms but not too close to another mill.

Or if the AI finds out that an enemy has three or more military units and has reached castle age, or has a plan to hunt boar and is unable to queue up a villager, it’ll either research loom or set it as a research priority.

Looking at the code you would see how using OR statements allow the AI to make a variety of decisions to reach the goal. The code would also employ AND statements, so that multiple conditions must to be met in order to trigger the same outcome.

The improvements in this code over time make the AI increasingly adaptive to your gameplay, and thus extremely hard to beat on the toughest difficulty these days .

Does Age of Empires AI cheat?

In Age of Empires IV the AI does not only lurk – it learns from you

During my 100s of hours spent in front of my screens playing various iterations of the AoE franchise, I remember accusing my PC of cheating multiple times. Definetly, you can easily get the impression that the Age of Empires AI is not playing fair. But from the publisher’s perspective, cheating (though technically easily doable) would ruin the player’s experience. So the newer AoE AIs do not cheat.

But: The original AI was caught cheating on the highest difficulty.

Age of Empires 2 DE AI as your Ally?

The AI isn’t necessarily your opponent: In games with more than 2 opponents, one or more AIs playing different civilizations, you can make one or more AIs your ally and even communicate and support each other.

When setting up the game, you can also build teams and team up with one or more of the AI players:

buddying up with the AI

The Definitive Edition AIs are also capable of being a more helpful ally than in older versions.

What is the difference in AI in Age of Empires 2 Definitive Edition?

Age of Empires 2 DE comes with three AI options when you choose to play a Skirmish in Single Player:

Age of Empires 2 AI CD vs HD

Age of Empires 2 Definitive Edition AI types

  1. CD-Version AI
    This is the original, oldest AI from the original game, the dumbest of them all. CD stands for Conquestors- or Compact Disc AI
  2. HD-Version AI
    This is the newer AI shipped with the later High-Definition (HD) graphics versions of the game
  3. AI
    This is the newest (pre-AoE IV), most advanced AI

In Single Player Mode you can choose the difficulty level each AI should use, but you cannot individually apply different difficulty levels per AI (see image above).

Age of Empires 2 Definitive Edition AI differences

These AIs differ in their level of “dumbness”. Especially the oldest AI (CD) has many bugs, building walls where no one needs them or ignoring your attack. With each release, it just got better and more “intelligent”. The Definitive Edition’s “AI” is pretty good (nearing too hard on “Hardest”).

AoE2 which AI is Best?

Because of the experience, time and effort put into the development of the AoE 2 DE “AI” without a doubt it is the best opponent – or ally – in any game.

Age of Empires 2 AI Difficulty Levels

AI Difficulty in Age of Empires 2 DE Campaigns

As mentioned above, single-player lets you choose from 3 different generations of AIs, but you cannot choose a difficulty level.

Interestingly, that’s totally different in the Campaign mode: When starting a Singleplayer Campaign you have three different options:

  • Standard
  • Moderate
  • Hard

How good is AoE2 DE AI?

I found that the difficulty jump from Standard to Moderate is a bit too steep and it’s definitely challenging for newbie players. The difficult jump from Moderate to Hard level is also quite noticeable and only experienced players will be able to navigate these jumps through extensive experience of playing the game. 

The “Hard” option does exactly what it says. Very few casual players will be able to beat it.

How do I change the difficulty in Age of Empires?

Warning: During a running game in Age of Empires II DE the AI settings cannot be changed.

Age of Empires 2 AI Builder

With all the flaws of the original (CD) version of the AI, it was only a question of time until the modding community started to create a solution. And Microsoft developed the game to be open to individual scripts.

So if you feel inclined to add your personal touch to the AI, there are ways to do it. A whole community exists to script custom AI for AoE.

One way to try this is by employing the “Forgotten Empire” script, which seems to require Python 2.7 (actual version 3.x). In the Age of Empires official forum, you find more information in case you want to code your own AoE AI. Burt: This AI builder script seems to have gone out of business though.

On Github, contributor “JakkelDragon” has recreated the original AI Builder and gives instructions on how to add your own AI code (written in Python) to AoE.

JackkelDragon / AoE2DE_AIBuilder on Github

Since this project is pretty recent (2020) it’s worth a look, if you feel inclined to script your own AI for Age of Empires 2 DE.

A plugin for Microsoft Visual Studio Code renders support for scripting your own AI:

Microsoft Visual Studio Code Extension for AI Scripting Support

Read on: How to Ally with the AI in Age of Empires

READ MORE

Tips on How to get better in Age of Empires II

Read our best tips on how to up your game

Similar Posts