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.
TheMaximalBeing
Forumer
Posts: 91
Joined: Fri Jun 02, 2017 11:00 pm
Location: Australia

Re: Binary

Post by TheMaximalBeing »

Do you have a suggestion of how to do this properly?
use up-find-resource AND up-filter-status with status-ready to find the live boar. You can use predator-animal-class, 910, to find it (up-find-resource will never find wolves). Then check if the boar has a target. object-data-target-id will be -1 if there is no target. :)
I'm guessing this is because it doesn't have the wood to actually build the farms
Possibly, I just remember it having a shit ton of foragers
This sounds like a bug, this shouldn't happen. Do you have a rec or more information?
Note that this happened while trying to click 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?
It happened while it was trying to click up while under some pressure, after it trained some scouts. It was floating like 1000 gold and 1000 wood, but <600 food. Does you AI only buy a fixed amount of food?

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

Re: Binary

Post by 01010100 »

TheMaximalBeing wrote:
Fri Jan 31, 2020 4:25 am
use up-find-resource AND up-filter-status with status-ready to find the live boar. You can use predator-animal-class, 910, to find it (up-find-resource will never find wolves). Then check if the boar has a target. object-data-target-id will be -1 if there is no target. :)
This solves it elegantly, thanks for the tip. I've already added a proper system but it requires saving the lurer's id to a goal, which I really don't like as it introduces a dependency on saved state which can give issues if something goes wrong during the lure. But your suggestion solves that problem.
It happened while it was trying to click up while under some pressure, after it trained some scouts. It was floating like 1000 gold and 1000 wood, but <600 food. Does you AI only buy a fixed amount of food?
No but it does only buy if the price is under 200 (for going up to castle age, normal eco balancing has various price levels depending on situation). So it's possible that it had been buying food to try go up to castle but then building scouts with it (units will "steal" escrow if its town is under high threat), continuing on like that until the food price became too much.

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

Re: Binary

Post by 01010100 »

I've uploaded v0.2

- Plays all civs. Take care with meso civs on AoC though, as they might be bugged because of having no eagle scouts in feudal.

- Unit upgrades are formula-based, inspired by the SpiritOfTheLaw Paladin video (https://www.youtube.com/watch?v=RpJd6RN0VwA). This means that it also should automatically work with modded games, as long as you're just changing unit stats and not adding new units.

- It fights of feudal rushes first before proceeding to go to castle. In test games it tends to succeed in beating off Promi's flush and then out-booming it in castle, but then loses in imperial age because of the lack of any unit micro and getting horrendous kill/loss ratios as a result.

- Numerous other tweaks and fixes.

Credits also go to interlepus of the EZ clan for helping with the civ-specific stuff. This should be fully done in time for v0.3 for the tournament.

User avatar
marathon
Waheguru
Posts: 1984
Joined: Fri May 14, 2010 2:30 pm

Re: Binary

Post by marathon »

This AI is special. It does things I always dreamed of.
It can be significantly stronger simply if you change a couple things. Like sn-consecutive-idle-unit-limit, which is at default 15" instead of zero. Or the coordinates for sheep that can be improved. Please do these 2 things before tourney, too little fuss for a significant reward.

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

Re: Binary

Post by 01010100 »

marathon wrote:
Thu Feb 06, 2020 4:28 pm
This AI is special. It does things I always dreamed of.
It can be significantly stronger simply if you change a couple things. Like sn-consecutive-idle-unit-limit, which is at default 15" instead of zero. Or the coordinates for sheep that can be improved. Please do these 2 things before tourney, too little fuss for a significant reward.
Thank you for the suggestions. I didn't know about sn-consecutive-idle-unit-limit or what it does, I've put it to zero now as you said. What exactly do you mean about the coordinates for sheep? I will put out a new updated version for the tournament anyway, but it's just bug fixes, for example I just found a regression in the 0.2b version that stopped it from doing civ-specific unit choices and completely botched meso civs in the process.

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

Re: Binary

Post by 01010100 »

marathon wrote:
Thu Feb 06, 2020 4:28 pm
Like sn-consecutive-idle-unit-limit, which is at default 15" instead of zero.
This seemed to make units less responsive, what is this supposed to do?

User avatar
marathon
Waheguru
Posts: 1984
Joined: Fri May 14, 2010 2:30 pm

Re: Binary

Post by marathon »

When your DUC unit finishes its whatever task (your scout exploring for example) it stays idle for X seconds before moving with auto pilot (tasked as explorer or TSA unit). Setting sn-consecutive-idle-unit-limit to zero, it eliminates this useless time. I believe it is set at 15 for lower difficulty vs novice humans.

I don't know about your improved sheep collecting code. I noticed that the sheep that villagers gather from does not move under TC but rather next to it. Also the rest of the sheep seem exposed.

I will copy some stuff from your AI. Still fixing my messy dark age and your tricks will help me.

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

Re: Binary

Post by 01010100 »

marathon wrote:
Fri Feb 07, 2020 3:02 pm
When your DUC unit finishes its whatever task (your scout exploring for example) it stays idle for X seconds before moving with auto pilot (tasked as explorer or TSA unit). Setting sn-consecutive-idle-unit-limit to zero, it eliminates this useless time. I believe it is set at 15 for lower difficulty vs novice humans.
Ah ok, thanks, that's useful indeed.
I don't know about your improved sheep collecting code. I noticed that the sheep that villagers gather from does not move under TC but rather next to it. Also the rest of the sheep seem exposed.
I used to move it directly under the tc but this was sometimes causing pathing issues with 7-8 vills eating the sheep because the tc building itself got in the way. So I moved their gather point 1 tile in the -x direction to give them a bit of room around the sheep, which is still mostly under the tc (most of the vills eating it are still under the tc) but they don't get in each other's way as much. I've now moved it back under the tc though, as the 2-3 vills who had to walk a tile to drop off their meat are almost as bad as sometimes having some pathing issues anyway.

The rest of the sheep were moved a bit out of the way because I used to only DUC the vills every 3 seconds and sometimes when a new vill pops out he immediately kills another sheep before being DUC'd to the current sheep. Hence why I moved the sheep out of the way a bit. I later changed the villager DUC to run every rule pass instead of every 3 seconds so this isn't strictly necessary anymore, but I've left it in as it doesn't harm either and I kind of like it this way.
I will copy some stuff from your AI. Still fixing my messy dark age and your tricks will help me.
Serve yourself, it's open source for a reason ;) I wouldn't copy the boar luring code though, a couple of posts above in this thread TheMaximalBeing suggested a much better way of doing it than I'm doing right now.
Last edited by 01010100 on Fri Feb 07, 2020 3:47 pm, edited 2 times in total.

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

Re: Binary

Post by Leif Ericson »

You could experiment with sn-target-point-adjustment. This allows you to choose the location within the tile you send units with up-target-point. That could help your sheep gather locations.

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

Re: Binary

Post by 01010100 »

Leif Ericson wrote:
Fri Feb 07, 2020 3:45 pm
You could experiment with sn-target-point-adjustment. This allows you to choose the location within the tile you send units with up-target-point. That could help your sheep gather locations.
Thanks Leif, that's a great idea. Added to the list for the next big FoodEconomy rewrite :)

Post Reply