DUC Tutorial AI

Upload your latest creations here.
Please note that by posting comments to posts in this forum you forfeit your personal copyright on whatever you post. AI Scripters reserves the right to re-use objective comments in script reviews without requiring the posting author's permission. Credit, where appropriate will be given in such cases.
Post Reply
User avatar
Leif Ericson
Posts: 1274
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

DUC Tutorial AI

Post by Leif Ericson »

This very short script is intended to be a demo of how to use DUC. It orders all of the AI's military soldiers to attack the nearest building if it has at least 7 military population. Essentially, it replicates TSA, though it has the benefit of using formations. I created it for my DUC guide (still in progress, lol), and I figured it might be helpful to upload it here. It's heavily annotated so that someone can understand what each line does.

Note that this script only includes the code to launch attacks, so you'll need to give the AI at least 7 military units and explore enemy buildings before the attack code will execute. I've included a demo scenario where you can watch the code in action.

If you are new to DUC, I suggest reading the script alongside my DUC guide (again, still in progress): https://airef.github.io/duc/articles/le ... intro.html

Whenever you come across a command that you don't recognize, I recommend looking up the command in the AI ref: https://airef.github.io/commands/commands-index.html. It's important to understand what each step is doing, because forgetting a step in your DUC code can mess up your AI's behavior if you aren't careful.

This demo doesn't cover everything that is possible with DUC, such as using control groups, but it should be a good start.

Installation Instructions:
  • Put the .ai and .per files in your AI folder.
  • Put one of the scenario files in your Scenario folder. The .scx file is compatible with all game versions, while the .aoe2scenario file is DE-compatible
DUC Demo.zip
DUC Demo AI and scenario files.
(60.32 KiB) Downloaded 23 times
Currently exploring the vast oceans and intelligence of Age of Kings.

Happy Scripting!

Post Reply