Age of Empires II (2013)

Age of Empires II (2013)

Advance to the Steam Age
Explore new maps, multiplayer scenarios, and user created campaigns. Or reinvent your game experience with new sounds, visuals, AI, units, and more! Ready to share your creations with the world? Upload right from the map editor, or collaborate with friends to create a masterpiece collection.
Dantalion 1 10 Feb, 2019 @ 5:35pm
Custom AI
So I never made an AI for Aoe2 before but due to AI problems on a new Scenario I am currently working on I figured out I have to.

Just for some information it is a big map with different AI Players. Some are set to max age to feudal age, some castle age. They all have unique pre built cities with all buildings they need already built.

There is a big wall which separates the main and secondary base of one particular AI player.



The Problems with the current AI are the following:

  • The AI players with max age feudal age are not building military units
  • The other AI players are building military units but they do not use all pre built buldings.
    Sometimes they only spam monks, etc.
  • None of the AI players attack any other AI player's city (maybe because there are no siege weapons buildable despite trebuchets?)
  • The AI player whose 2 bases are sperated by the big wall just take all their military units and walk against the big wall instead of attacking it....
  • All AI Players are starting to spam unwanted buildings, often ones they dont need f.e. they already have 4 stables and then out of random build 5 new ones which they never use....
  • These new buildings they should not even have built are in addition built in the most dumb places imaginable....

What I would need to do:


  • Create an AI that does not build additional buildings. It should however repair damaged and rebuild destroyed buildings.
  • The AI should built all available units in all pre built buildings.
  • They should attack relentlessly as soon as they have a medium sized attack group
  • The AI still needs to gather resources and build farms

Additional problem is that there are several factions to cover and of course AI players who are allowed to progress to castle age and some who arent.

Can somebody maybe point me towards a good up to date tutorial about how to create a custom AI?

Any help is appreciated, thank you!


Last edited by Dantalion; 10 Feb, 2019 @ 5:42pm
< >
Showing 1-4 of 4 comments
T-West 4 11 Feb, 2019 @ 5:31am 
Originally posted by satapathyomkar1:
Why don't you use barbarian ai on wololo kingdoms. It will do all the functions you want.
Note the Barbarian AI uses UserPatch features that are not supported by the HD Edition. Barbarian does not work on HD.
Unfortunately we can't just make everyone install WK. :' But if OP wants to try, they can follow the guide here: https://www.reddit.com/r/aoe2/comments/4ir16r/stepbystep_guide_for_setting_up_voobly/
Last edited by T-West; 11 Feb, 2019 @ 6:01am
Dantalion 1 11 Feb, 2019 @ 12:48pm 
Originally posted by TWest:
Originally posted by satapathyomkar1:
Why don't you use barbarian ai on wololo kingdoms. It will do all the functions you want.
Note the Barbarian AI uses UserPatch features that are not supported by the HD Edition. Barbarian does not work on HD.
Unfortunately we can't just make everyone install WK. :' But if OP wants to try, they can follow the guide here: https://www.reddit.com/r/aoe2/comments/4ir16r/stepbystep_guide_for_setting_up_voobly/


Thanks but I decided to write my own and I found some tutorials.
The AI creation seems to be a bit chaotic, writing all these constants and rules in one file.
Do you by any chance know if it is possible to split them into multiple files?
T-West 4 11 Feb, 2019 @ 1:15pm 
Yes it is. Just use

(load "<relative-path-to-per-file>")
Last edited by T-West; 11 Feb, 2019 @ 1:15pm
Dantalion 1 12 Feb, 2019 @ 11:32am 
Awesome, thank you.
< >
Showing 1-4 of 4 comments
Per page: 1530 50