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: 1281
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 48 times
Currently exploring the vast oceans and intelligence of Age of Kings.

Happy Scripting!

User avatar
Posts: 1320
Joined: Thu Nov 10, 2011 1:07 pm

Re: DUC Tutorial AI

Post by Promiskuitiv »

That's a cool idea Leif, thank you for going through with this and uploading it for the community. :)
Original creator of Promi, which has now been taken over by Offwo.

My new project is Naga, any suggestions and feedback are greatly appreciated! :)

User avatar
Posts: 530
Joined: Mon Feb 21, 2011 9:31 am

Re: DUC Tutorial AI

Post by offwo200 »

This is great, thank you!
those hackers are just idiots, i spit on them :lol: - Mabuse

Post Reply