Age of Empires II (2013)

Age of Empires II (2013)

Logbot v1.11 - Custom AI Script
76 Comments
Asu Maciuc 30 Jun, 2018 @ 3:33pm 
can beat BruceForced Ai ?
Loggy  [author] 22 Dec, 2015 @ 3:13am 
This is the most recent version. I'm not really sure how well it works any more.
Johnj_es 21 Dec, 2015 @ 9:01pm 
please update this one for the latest aoe 2 hd forgotten patch ?
CheeseOnToast  [developer] 24 Jul, 2015 @ 1:17pm 
In UserPatch its possible tho, AI's like Barbarian are able to do.transport villagers to other Islands, even on maps like Migration!
Loggy  [author] 24 Jul, 2015 @ 9:01am 
That's impossible with AoE2's AI system sadly.
Ruuqo sudo rm -rf / 24 Jul, 2015 @ 8:38am 
Ive yet to see any AoE AI do this, but on Islands, they should know to send a few villagers to other islands to start growing more and more rapidly. This would make things far more interesting! Will be trying this AI in conjunction with BF in an FFA Islands match today
CheeseOnToast  [developer] 31 Oct, 2014 @ 3:31pm 
np Loggy <3
Loggy  [author] 31 Oct, 2014 @ 3:30pm 
Weird. But then again, there are a number of things in AI and RMS scripting like that which make absolutely no sense sometimes.

I'll give it a go and see if it helps, thanks!
CheeseOnToast  [developer] 31 Oct, 2014 @ 3:21pm 
I find that (idle-farm-count == 0) breaks the farm building, (idle-farm-count < 1) doesn't.
Loggy  [author] 31 Oct, 2014 @ 3:20pm 
Thanks for the farm paste by the way, it feels like everyone's farm building is more complicated than mine [pastebin.com]...
Loggy  [author] 31 Oct, 2014 @ 3:15pm 
Watch towers have been notoriously buggy ever since the game's release. There's no way to accurately count them, watch-tower-line is bugged and guard-tower and keep don't work. In the end i just attached the build command to my minute timer.

If you want to see how broken it is now (apparently it was this way in AoK even) make a scenario and a test script to try counting them using various values. I gave up trying in the end, and instead rely on their arrows and up-get-threat-data to see what's attacking me.
CheeseOnToast  [developer] 31 Oct, 2014 @ 2:04pm 
I've noticed this issue with BruteForce and the current new AI can't detect game modes correctly. (for example, Wonder Race) and BruteForce likes to get stuck when using escrow resources and spams towers cus it thinks (up-pending-objects c: watch-tower < 1) is always 0 so I had to remove it.


Your farm issue sounds more like a scripting issue indeed, my AI no longer does it.
http://pastebin.com/tKcckvLp prehaps this might be insightful.
Loggy  [author] 31 Oct, 2014 @ 9:39am 
Hmm. I haven't ever noticed anything going wrong with that, actually.

The only peculiarities I've seen has been my resource counter producing negative values for one pass, but I think that happened whenever it freed escrow which messes stuff up.

Only other time I can think about this is the mysterious case of the farm-sticking where the AI suddenly forgets how to build farms until they are all gone (but I added a rule to delete them with excess wood). Then again, I have never observed the default AI suffer from this so it's probably something I'm doing rather than an engine issue.
CheeseOnToast  [developer] 31 Oct, 2014 @ 7:17am 
It also returns false values, say for example (building-type-count-total wonder >= 1) (even if it didn't have a wonder it would still set the value as 1) and (up-pending-objects c: house < 1) returns false values too which means some buildings don't build at all as that's set to 1. It's a weird bug but the devs are looking into solving the issue, I believe no cause has been found yet, it's quite irratating. I'm sure this includes (unit-type-count-total) values and such.
Loggy  [author] 31 Oct, 2014 @ 3:49am 
Hmm, I just saw your post on the Resonance4g. I haven't actually noticed this, but I have a lot of layers of indirection in my stuff: I tend to set something up that reads real quantities into goals and then just do comparisons on that for a fair number of things.

I haven't seen anything flat out fail to work correctly in that respect. The stuff I know that's messed up with the AI engine is...

- (up-remaining-boar-amount) is both == 0 and != 0 when there is no active lure.
- Using g:> and s:<= etc instead of normal comparison operators with non-up functions causes undefined behaviour. It seems to follow no pattern about whether it's true or false and randomly switches. Saying that, I haven't tried for a couple of patches and the default AI uses it so it might be worth giving it a go again.
- up-chat-data-to-self prints weird characters if you use "Some value: %d%" and the like.
Loggy  [author] 31 Oct, 2014 @ 2:45am 
What is the 3.8 AI bug? I know that something was going around, but beyond the freezing units (which I have yet to see) I haven't noticed anything playing up. I'm happy about the spectator fix though.

I've seen people commenting on the fact that the AI can't detect certain things, but nobody's actually posted any specifics anywhere as far as I know.
CheeseOnToast  [developer] 30 Oct, 2014 @ 8:19pm 
Also, are you aware of the 3.8 AI bug?
CheeseOnToast  [developer] 30 Oct, 2014 @ 6:52pm 
That's great :P
Loggy  [author] 30 Oct, 2014 @ 4:57pm 
After watching Logbot be destroyed so many times, this is so sweet. But if promisory advances a couple of minutes faster then it can't keep up with villagers as its percentages are all over the place. Ah well, I seem to have actually made some progress!
CheeseOnToast  [developer] 30 Oct, 2014 @ 4:41pm 
That really sucks, but all part of making a good AI :P
Loggy  [author] 30 Oct, 2014 @ 4:35pm 
Turned it up to double and it seems to have helped quite a bit. I'll need to try a few more times tomorrow though, and no doubt rebalance all my gatherer percentages again...
Loggy  [author] 30 Oct, 2014 @ 4:27pm 
When compared with the default AI, villager numbers are maybe a tiny bit behind. But regardless of deaths due to boar luring, resource counts are more or less equal until ~20 mins.

Time to explore the avenue of having loads of lumber camps...
CheeseOnToast  [developer] 30 Oct, 2014 @ 4:04pm 
It's not losing villagers for silly reasons is it? like failed boar luring? villagers getting stuck on resources or bad scouting?
Loggy  [author] 30 Oct, 2014 @ 2:46pm 
Still as stumped as I was over a week ago. I've tried all sorts of of things, I just can't seem to figure out how it's done, and trying to survive whilst being a few thousand resources behind isn't exactly possible.
Loggy  [author] 21 Oct, 2014 @ 3:05pm 
The default AI seems to gather resources 5-10% faster than Logbot once reaching Castle. I still can't figure out why. Similar villager counts, research progress... Dropoff distances don't look remarkably different, either.
Loggy  [author] 19 Oct, 2014 @ 3:17pm 
Update: I'm starting to find it difficult to track down the reasons why I'm falling behind the standard AI. For the strategies I've made Logbot can at least put up some kind of fight on hardest, but I still have to dabble in water maps and add difficulty levels... and it still loses most of the time.

(I'm tempted to forget water maps for the moment, and may leave that bit out at least for a first version)
CheeseOnToast  [developer] 25 Sep, 2014 @ 3:57pm 
Adding (up-retask-gatherers food c: 5) before or after (in userpatch version before works) (up-request-hunters c: 5) should make it more certain to add more hunters.
Loggy  [author] 25 Sep, 2014 @ 3:51pm 
Sure enough, (up-request hunters c: 5) helps a lot.
Loggy  [author] 25 Sep, 2014 @ 3:47pm 
The game seems to ignore sn-minimum-number-hunters when adding the hunt group, or rather it won't retask villagers to it as per the usual retask limit. Maybe that's what up-request-hunters is for...

I'll have a little play around and see if I can find something less harmful to my poor little villagers' health. Thanks!
CheeseOnToast  [developer] 25 Sep, 2014 @ 3:39pm 
Well I noticed when the AI sometimes garrisons villagers into the TC, It doesn't continue the boar hunt with that villager, instead it assigns it to something else, the extra boar hunter villagers seem to not garrison at all to protect themselves ending up in death. I'm pretty sure it would happen on 2.0 speeds too.
Loggy  [author] 25 Sep, 2014 @ 3:28pm 
I've never seen it lose quite that many before - though it's something I'm keeping an eye on. I'm not sure whether it's a product of running at 8x speed or whether assigning more lurers/hunters would help it.
CheeseOnToast  [developer] 25 Sep, 2014 @ 3:19pm 
I think it lost around 3 villagers on that lure which hurt it's dark age eco, assigning some extra boar lurers might be beneficial. This isn't a final planned strategy is it?
Loggy  [author] 25 Sep, 2014 @ 2:55pm 
Logbot is getting there - I'm relatively happy with this [puu.sh] game, but its slow castling and resigning in particular still need attention it seems...
Loggy  [author] 24 Sep, 2014 @ 2:36pm 
Well, it's here, and nothing exciting except the spectator command fixes. I'm not much further forward, and honestly not sure I'm going to be as real life is going to pick up in a few days...
Loggy  [author] 21 Sep, 2014 @ 2:01am 
Depends what they're going to add. If it's anything like the last smaller updates then they might enable a few new SNs and that's all there really is to change.

It's questionable whether I'll actually be ready to put anything on the workshop by then anyway...
CheeseOnToast  [developer] 20 Sep, 2014 @ 12:32pm 
Loggy, patch 3.8 is coming soon, maybe you should wait till then?
Loggy  [author] 20 Sep, 2014 @ 12:27pm 
I currently have a flushing Britons strategy which can put up a fight with the current hardest AI without cheating, but it can't handle water maps yet. I'm thinking of refining my fast castling strategy until I have something which can compete with the standard AI on land maps only and putting that up on the workshop sometime.

Compared to the standard AI, Logbot should offer far better adaptive tendancies. Or at least, I hope so!
I quit. Peace. 20 Sep, 2014 @ 6:44am 
Compared to the new standard AI computer, bruteforce and resonance bot, all on hardest, logbot is the lowest in skill. Still it's pretty good, but I hope you can better it.
Fion 1 Sep, 2014 @ 5:37pm 
This is definitely way more better then Bruteforce. This AI is far the best I have seen!
CheeseOnToast  [developer] 27 Aug, 2014 @ 11:42am 
That's awesome news, great to see that LogBot is still alive :)
Loggy  [author] 26 Aug, 2014 @ 2:11pm 
A little update: I'm still working on it, though I've taken quite some time away from scripting as I simply haven't felt like doing anything with it. I'm now more or less at the stage where I have one strategy that can compete with the normal AI on hardest and it doesn't cheat.

I'm definitely a lot further ahead than this version, but I'm not ready to release anything just yet!
DragonMaster8011 7 Jul, 2014 @ 6:55am 
mind if I add you as a friend ?
Loggy  [author] 7 Jul, 2014 @ 6:54am 
I don't know anything about AoE3 AI scripting, but seeing as they're so different they are almost certainly incompatible.

I'm not sure whether it's possible to create an AI that would assist a human, as the AI tends to task anything you try to move away rather quickly. You'd probably have to fight over the game for control of your units at times, and you'd have no control over where it decided to build things, but aside from that you could create units and maybe direct them without too many problems.
DragonMaster8011 7 Jul, 2014 @ 6:46am 
Or if it's possible , can AoE III's AI ( where you don't have to build lumber camps or mining camps and farms ) be used in AoE II ?
DragonMaster8011 7 Jul, 2014 @ 6:41am 
I would like to focus on building my military instead of having to micro-manage everything all at once , 5 per resource is enouph to me , that way it leaves room for a larger army to desimate my foes !
Loggy  [author] 5 Jul, 2014 @ 8:20am 
That seems wrong. Its wonder race was terrible when I was testing it.
I quit. Peace. 5 Jul, 2014 @ 8:03am 
Funny, Logbot was the fastest in a Wonder race.
Loggy  [author] 5 Jul, 2014 @ 6:33am 
What do you mean?

If you want an AI that only builds houses and gathers, it's pretty straightforward. But it's difficult to determine how many villagers to task on each resource if you have no strategy in mind.
DragonMaster8011 4 Jul, 2014 @ 9:49am 
can you reccomend any AI's that make the villagers auto build homes and resources ?
Loggy  [author] 30 Jun, 2014 @ 3:10pm 
Logbot is getting closer...

Slowly.