AI modifications

Here you can post about your scenario's, mods, custom maps and YouTube channels!
User avatar
Hungary Dsy
Lancer
Posts: 994
Joined: Jun 27, 2015

AI modifications

  • Quote

Post by Dsy »

Hi guys!

I started modify base aoe3y AI since its fun to watch bots to improve.
Main goal is to make a stronger SUP AI. I checked the net and found Draurug AI which seems very cool, however i think its mainly for TR.
So luckily i could do some improvements like:
-Ai no longer build saloon and its units
-Ai spend it resources when reaches age 3 (dont stack for age 4 and 5 without making army)
-Messing with unit picker to be able to make more type of units

However it seems im facing a big issue: Ai shipments.
It seems not too easy to modifiy it. If anyone has idea where and how to start it'd be appreciated!
User avatar
Great Britain Panmaster
Skirmisher
Posts: 166
Joined: Jan 1, 2016

Re: AI modifications

Post by Panmaster »

Hello,
I use my reference http://aoe3.heavengames.com/downloads/s ... ileid=3750

Regarding shipments: The AI script needs a time delay to add cards and create it's homecity. It also needs to create it's deck (ID 0). You use a handler function to send shipments as an event when a shipment is ready. Programme as required using the various HC functions.
There is also an arrival handler so my AI script can build it's factories as soon as they arrive for example. There is a homecity card limit of 100 assuming the human player (you) has a homecity level that is high enough. You have to filter cards and select them in order which requires many hours.
You need to open the homecity xml files and order the cards to get their ID's. The card IDs, HCtech ID's and deck ID's are not the same.
TDLR:
make homecity (card ID's 0 to 130~ from xml)-> make deck (0 to 24) -> shipment rule / handler function (send shipments 0 to 24)
TAD AI Reference Guide
"Better to remain silent and be thought a fool than to speak out and remove all doubt." - Abraham Lincoln
User avatar
Hungary Dsy
Lancer
Posts: 994
Joined: Jun 27, 2015

Re: AI modifications

Post by Dsy »

I can make HC and i can make a deck. But i dont know how this handler works:
void shipGrantedHandler(int parm=-1) // Event handler
I guess its what we are looking for:
Ive found this:
aiHCDeckPlayCard(bestCard);

It so complicated with cardvalues and stuffs.
I thought just write:
if (kbGetCiv() == cCivFrench)
aiHCDeckPlayCard(1.ID);
aiHCDeckPlayCard(2.ID);

But i dont think it'd work. :D Im not an expert in this.

Who is online

Users browsing this forum: No registered users and 2 guests

Which top 10 players do you wish to see listed?

All-time

Active last two weeks

Active last month

Supremacy

Treaty

Official

ESOC Patch

Treaty Patch

1v1 Elo

2v2 Elo

3v3 Elo

Power Rating

Which streams do you wish to see listed?

Twitch

Age of Empires III

Age of Empires IV