Binary

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.
01010100
Forumer
Posts: 96
Joined: Thu Dec 12, 2019 3:32 pm

Binary

Post by 01010100 »

Requires UserPatch 1.5. Runs on WololoKingdoms or AOC, does not run on DE.

The repo is over here: https://github.com/01010100b/AoE2. Specifically see the Script folder for the AI source files and the Releases folder for releases.

v0.5

Removed duc again, and fixed a breaking bug in previous version.

v0.4.1

Fixed a bug where it would keep searching for sheep with vills even when there are no sheep on the map.

v0.4

Some DUC used during attacks (specifically it'll try to defend its siege)
In team games it will help out its allies by tribute if it has a lot of a resource

v0.3

Plays all civs a bit better with more specific unit choices

v0.2

Plays all civs. There might be some issues playing meso civs in AoC though, as it's assuming the WK situation having eagle scouts in feudal.

v0.1

Should work with any civ that has access to knights. It can only play land maps.
Attachments
Binary-0.5.zip
(56.87 KiB) Downloaded 430 times
Binary-0.4.1.zip
(76.89 KiB) Downloaded 338 times
Binary 0.4.zip
(95.01 KiB) Downloaded 349 times
Last edited by 01010100 on Thu Jul 23, 2020 4:48 am, edited 25 times in total.

User avatar
Esty
Waheguru
Posts: 1159
Joined: Wed Dec 30, 2015 7:37 am

Re: Binary

Post by Esty »

just tested it. That's a really interesting AI, doing stuff different than any other AI, making Binary unique, not only by the way you have scripted it :).
You say that Binary plays with civs having access to the cavalry ; in that case, i'll need you to tell the 4 civs you want for the 1v1s 2v2s 3v3s 4v4s in davis cup.
In case you plan to add strategies for meso civs, just ignore my request and Binary will play rdm civs !
Author of TRiBaL_Warrior, Yggdrasil, PharaoN, WoodyWood Pecker and currently :o dette :dance

User avatar
Leif Ericson
Waheguru
Posts: 1423
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

Re: Binary

Post by Leif Ericson »

Ooh nice! Great to see a new AI.

User avatar
Promiskuitiv
Waheguru
Posts: 1364
Joined: Thu Nov 10, 2011 1:07 pm

Re: Binary

Post by Promiskuitiv »

Awesome, thank you for your work! It's great to have a new AI with new ideas. :)

01010100
Forumer
Posts: 96
Joined: Thu Dec 12, 2019 3:32 pm

Re: Binary

Post by 01010100 »

Esty wrote:
Sun Jan 26, 2020 1:44 am
just tested it. That's a really interesting AI, doing stuff different than any other AI, making Binary unique, not only by the way you have scripted it :).
You say that Binary plays with civs having access to the cavalry ; in that case, i'll need you to tell the 4 civs you want for the 1v1s 2v2s 3v3s 4v4s in davis cup.
In case you plan to add strategies for meso civs, just ignore my request and Binary will play rdm civs !
I'm planning to add other civs as well before the davis cup so it can play random civs. You can see the TODO file here: https://gitlab.com/01010100b/binary/blo ... y/TODO.txt. I should get to v0.2 and hopefully v0.3 before the tournament. I don't actually have to add a strategy for that though, the basic strategy (see BasicStrategy.per) is parametrized by unit choices like this:

Code: Select all

#defexclusive gl-my-scout-unit = scout-cavalry-line
#defexclusive gl-my-primary-unit = knight-line
#defexclusive gl-my-secondary-unit = spearman-line
#defexclusive gl-my-siege-unit = battering-ram-line
#defexclusive gl-my-primary-trash-unit = skirmisher-line
#defexclusive gl-my-secondary-trash-unit = spearman-line
So all that needs to be done to make it play other civs is to change those values at the top with a load-if-defined or something, it's next to no work but it's not at the top of the list right now. The AutoBalanceGatherers.per will automatically rebalance gatherers to fit the new army composition and the AutoProductionBuildings (in Buildings.per) will make sure there are enough production buildings to maximize unit production. This is of course strictly worse than hand-crafted strategies but it does an ok-ish job and I like that it's so general, and the framework is in place to make hand-crafted strategies down the road.
Last edited by 01010100 on Sun Jan 26, 2020 11:27 am, edited 1 time in total.

User avatar
CheeseOnToast
Yogi
Posts: 388
Joined: Sun Aug 31, 2014 5:48 pm

Re: Binary

Post by CheeseOnToast »

Does it work with WololoKingdoms?

paper
Forumer
Posts: 17
Joined: Thu Dec 19, 2019 8:17 am

Re: Binary

Post by paper »

All I know is that I couldn't run it on DE.
The script from the zip attachment crashes the game, and the script from gitlab (binary/Script/Binary.per) returns a bunch of errors.

01010100
Forumer
Posts: 96
Joined: Thu Dec 12, 2019 3:32 pm

Re: Binary

Post by 01010100 »

It requires UserPatch 1.5 so it doesn't run on DE. It runs on WololoKingdoms and AOC. I'll update the OP with this information. You can not use the script files from the Gitlab repo directly, they are written in an extended language that compiles down to the game's scripting language, you need to use the zip file in the OP or in the Releases folder in the repo.

TheMaximalBeing
Forumer
Posts: 91
Joined: Fri Jun 02, 2017 11:00 pm
Location: Australia

Re: Binary

Post by TheMaximalBeing »

Nice Work! Great to see an AI from you :)

Seems to do alright once it gets going but struggles with dark age.

Some suggestions
  • Don't send support boar hunters until the current boar is closer to the TC - often it is killed in the middle of nowhere
  • Lure the second boar earlier (to help prevent having no food under tc)
  • Build extra farms if you have too many foragers
  • Don't keep trying to go up to castle when under pressure - train more units
  • Build farms if you fail to meat the food % requirements - one time it just stopped
  • Abuse the market to help going up to castle

01010100
Forumer
Posts: 96
Joined: Thu Dec 12, 2019 3:32 pm

Re: Binary

Post by 01010100 »

TheMaximalBeing wrote:
Mon Jan 27, 2020 8:39 pm
Nice Work! Great to see an AI from you :)

Seems to do alright once it gets going but struggles with dark age.

Some suggestions
Thanks for the suggestions.
Don't send support boar hunters until the current boar is closer to the TC - often it is killed in the middle of nowhere
Lure the second boar earlier (to help prevent having no food under tc)
Yes the FoodEconomy code needs to be rewritten, it was quickly cobbled together to get something half-working going. You might also see the peculiar behaviour of only sending male foragers to the sheep/boar and not female ones :). This was on my TODO list in my head but I notice I haven't actually added it to the TODO file. The early extra support boar hunter is because I'm checking the boar's tasks-count to see if I'm already luring it, if the tasks-count = 0 then I send a boar lurer. But as it turns out, the moment the first lurer has fired the two arrows and starts retreating the tasks-count goes back to 0 and so the script sends out a second lurer. Do you have a suggestion of how to do this properly? I'm assuming the lurer's target-id also gets reset once he fires the two arrows.
Build extra farms if you have too many foragers
Thanks, added to the TODO list. Edit: Wait a second, it should already be doing this. The required number of farms is the number of food gatherers, -8 if there is sheep/boar and -4 if there are forage bushes. So every forager above the 4th should be getting a farm. I'm guessing this is because it doesn't have the wood to actually build the farms, or rather the wood it has is in escrow for buildings.
Don't keep trying to go up to castle when under pressure - train more units
I was planning on improving the basic strategy to handle being feudal rushed, it's under "Improve basic strategy" on the TODO list. I've only been testing it so far against The General which only goes FC so there hasn't been much attention paid to the feudal age yet.
Build farms if you fail to meat the food % requirements - one time it just stopped
This sounds like a bug, this shouldn't happen. Do you have a rec or more information? If there are more than sn-farm-boom extra farms required (which I've set to 5) then it should even build them with escrow. The only thing I could think of here is that if its town is under high threat then it caps the number of builders at 1, but even that 1 builder should still be (trying) to build the farms. I'll try to set sn-farm-boom to 0 so it should build every farm with escrow at high priority, this should probably solve the other issue of too many foragers as well.
Abuse the market to help going up to castle
I'm already buying food to help going up to castle. Do you mean also sell wood to then buy food with that gold?

A quick fix you may try for the farming issues is looking for sn-farm-boom in the script where it's set to 5 and change it to 0. If you do that, does it solve those issues?

Post Reply