Page 1 of 1

AI modifications

Posted: 11 Feb 2019, 14:05
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!

Re: AI modifications

Posted: 11 Feb 2019, 18:32
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)

Re: AI modifications

Posted: 11 Feb 2019, 22:38
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.