ryndrb / dota2bot

DotA 2 Bot Script: Tinkering ABo(u)t
19 stars 5 forks source link

Improve rune logic #28

Closed dmknght closed 1 month ago

dmknght commented 6 months ago

Problems:

  1. Bot mid doesn't pick up rune during laning phase. A mid player has huge advantage because of this
  2. Similar to 1, it's unclear that if bot can pick up water rune
  3. Likely current version doesn't support pick up Wisdom rune (since the script based on the version before Major update)
  4. Sometime enemy bots stop picking up rune if they see human player (closer to rune or something like that).
  5. If bots get attacked by long range spell (usually very long range, and no sign of attacker), bots likely stop picking up Bounty rune

Of all the problem, 1st and 2nd are highest priority IMO. The others requires sort of game play change (3rd requires support bot move away from lane. 4nd might need logic to contest rune which could end up feeding)

Solution

dmknght commented 6 months ago

Update result (I downloaded replay to do double check): Bot mid still doesn't pick rune before 7 mins. It didn't pick any water rune at all (can't blame anyone except Valve. I checked Valve's API and there's no Water rune in it). Meanwhile Power rune was picked by Enemy's support (I downloaded replay to check). It's not what I expected but this is the first move. I'm keeping digging the code to see if I can fix this :D

dmknght commented 6 months ago

An other line should be if X.IsNotPowerRune(runeLoc) then return false end (https://github.com/ryndrb/dota2bot/blob/master/mode_rune_generic.lua#L560). However likely it will compromise the logic (bot mid pick up bounty rune)? So yeah I have to test this one. P/s: actually the function IsNotPowerRune checks location of Power rune instead of rune type so it's not the case

dmknght commented 6 months ago

I have a good news: Bot does pick up rune. I commented the block from https://github.com/ryndrb/dota2bot/blob/master/mode_rune_generic.lua#L365 to https://github.com/ryndrb/dota2bot/blob/master/mode_rune_generic.lua#L365 The bad news: Supports tried to pickup runes water too. And bots get stuck if being attacked (being attacked bot ended up in moving circle) The ugly news: I tried to do a block of code like

if runStatus == RUNE_STATUS_AVAILABLE
then <this is old code block> end
elseif runStatus == RUNE_STATUS_MISSING
then <bot chat run missing>
elseif runStatus == RUNE_STATUS_UNKNOWN
then <bot chat run status unknown>

OFc none of those messages were triggered (ofc I set chat all to true). At least we know the location that made everything wrong. NOTICE: during this test, I removed the block of code mentioned in SOLUTION.

dmknght commented 6 months ago

@ryndrb after today test, I can confirm that remove code block I mentioned above (https://github.com/ryndrb/dota2bot/blob/master/mode_rune_generic.lua#L212 to https://github.com/ryndrb/dota2bot/blob/master/mode_rune_generic.lua#L219) fixed the bot doesn't pick up rune issue. The result was even better: Bot randomly picked up Wisdom rune. I don't know why it didn't work at my first test but at least it's working fine now. I assume pick rune logic uses default logic. Further info: I found out that all before 10 mins, mid and offlane check rune logic goes to this condition (which i commented) image

about after 10 mins, support's logic jumps to here too. It would be nice if you can give this logic a test :D

p/s: The latest match (with latest commits) of mine, which bots picked up runes, is 7733463555

dmknght commented 6 months ago

I tested the latest pull and bots still picked up rune. However, I do agree that for some reason, bots didn't pick up rune after script was modified after some matches.That's the weirdest thing I've seen. IDK if it has something to do with cache