forest0xia / dota2bot-OpenHyperAI

A beta Dota2 Bot Script aims to provide better bot game experience
https://steamcommunity.com/sharedfiles/filedetails/?id=3246316298
MIT License
39 stars 8 forks source link

Fix weak sf and pb #14

Closed EfeDursun125 closed 1 week ago

EfeDursun125 commented 1 week ago

sf is so weak by default, he always wasting his souls and using ultimate with 5 soul. mid sf is now magical and mid sf can easily kill agility heroes now. (most of carries is agility) sf no longer wasting souls with feast of souls, some changes are made to pos1 sf too. pb is more tankier now, otherwise he can't survive in late game. (still struggles in early game)

mid sf mid sf2 mid sf 3 mid sf 4

groxindaflow commented 1 week ago

Im not sure if J.GetNearbyHeroes with radius more than 1600 works. J.GetHeroesNearLocation works just fine (tested) with more than 1600 which helps to "open bots eyes" a bit hah

forest0xia commented 1 week ago

GetNearbyHeroes won't work for radius more than 1600. 1600 is the max because it's what Valve caches in game engine for bots to use to minimize the performance impact. Despite there are ways to do it, we should avoid checking near by heroes with radius over 1600 every frame since it will have negative impact to the fps.

groxindaflow commented 1 week ago

Well if a PC has decent powers, we don't even talk about strong ones, it can work just fine. My files are set with radius of 2500 and it works without fps drops

forest0xia commented 1 week ago

Your pc might be good yes, problem is you are not the only one using this script and this is for many others to enjoy. I don't want to negatively impact anyone's experience for the changes that have little or no improvement in bot performance. I do not know how much it can impact the fps yet. maybe will have time to quantify this later.

ThirVondukr commented 1 week ago

Im not sure if J.GetNearbyHeroes with radius more than 1600 works. J.GetHeroesNearLocation works just fine (tested) with more than 1600 which helps to "open bots eyes" a bit hah

I think it's possible to get all enemy heroes and check how many heroes are in a specific range instead 🤔

forest0xia commented 1 week ago

Think my only blocking concern is you made pos4-5 sf buying pos2 items. Either remove some items like bottle, or define better items such as a list items like the real supports.

Note other player may change Custom/general file to pick sf in any position, or players can use !pick as well. In case sf is pos4-5, it will be poor and the item build won't make much sense.

I'm curious how much stranger are sf and pb now? Just give a rough estimate from your game tests, say the original version is 1, is it now 1.5 versus any heroes in general?

Anyways, I appreciate your updates, I've not been playing sf for a while.

EfeDursun125 commented 1 week ago

sf improvement can be around 10x as you see in the pictures, reason of this most of the bot builds are physical. physical sf can't beat anti mage, juggernaut or phantom assassin, for example terrorblade has over 30 armor because he is agility hero. even with armor reduction passive and lot of souls he can't fight against agility heroes. he must engage agility heroes (most carries are) with magical build and it works because agility heroes have lower magic resist but intelligence heroes have the most magic resist which makes him a great rival against zeus, invoker and other intelligence heroes. sf also increases his damage with intelligence points but physical builds don't really give much intelligence and only remaining thing to increase his damage is souls.

old sf bot was wasting souls with feast of souls, he can't go over 5 souls which causes low damage plus he ults with 5 souls which makes his ult completely useless.

sf is played on mid mostly with magical build because it has high really pressure on agility carries in early game with his high magical damage just like zeus.

pb is not really different but he's broken hero, acts so stupid and cannot benefit from his build.

pro builds might not work for bots because some builds require different stragety and playstyle but all bots play in the same way, so more simple builds might work better for bots. or just tweak pro builds with replacing some items.

(reason why physical sf wins in my opinion is, people when see sf they probably think he will go mid with magical build and they choose picks for it, i also checked dotabuff and sf players go mid with 78.51% chance which could confirm my opinion)

i also added pos4-5 builds now.

forest0xia commented 1 week ago

10x sounds amazing. It seems there are some conflicts blocking me from merging it. I will merge it later once the conflict is resolved.

About why PB, Wisp, etc are so dumb: https://www.reddit.com/r/DotA2/s/i1GdwJbgim

I will do manual game testing later after merging it.

EfeDursun125 commented 1 week ago

don't forget to test pos2 sf, pos1 one is better too but not as pos2 because pos1 is still physical.

forest0xia commented 1 week ago

Sell item list works in the way you need to pair items in that list. E.g. [item1, item2] means when sf gets item1, make him sells item2. So the list has to contain even number items, otherwise it can cause unexpected selling behavior.

ThirVondukr commented 1 week ago

Sell item list works in the way you need to pair items in that list. E.g. [item1, item2] means when sf gets item1, make him sells item2. So the list has to contain even number items, otherwise it can cause unexpected selling behavior.

That's really unintuitive, maybe it could be refactored later to use a mapping structure or some other format? e.g.

{
  type: "after_minute",
  minute: 25,
  sell: ["quelling_blade", ...]
}
{
  type: "after_item",
  item: ["vladimir", "something"],
  sell: ["magic_wand", "quelling_blade"],
}
forest0xia commented 1 week ago

Despite its unintuitive, it's easy to implement and does the work. I wasn't the one implemented it tho. And it's better than what you suggested in a way it won't accidentally sell items, for example if the bots are just so poor that they still keep some early items til 60mins, you don't want them to sell anything to make them even weaker.

The basic idea is "replace" cheap item with better items. But there are quite some corner cases that some items might be cheap as time goes by bots still shouldn't sell or replace them.

forest0xia commented 1 week ago

This part can be refactored later, since it won't improve any performance but it can cause hardware performance concerns for adding computations in runtime to iterate through nested loops.

forest0xia commented 1 week ago

Another idea is to make item a richer object or a mapping that contains a list of the items it can replace or for the owner to sell in favor of having it. So we'd only need to loop through 1 list only once when equipping the item.

forest0xia commented 1 week ago

In general, be super cautious with any potential nested loops especially when it comes to affect any bots in generic. The computation grows accumulatively to impact the fps piece by piece in different places. And it's much harder to improve/refactor later for this kind of performance.

If you still dont feel how bad the fps can be because your pc is too good, say about twice better than average players'pc, try playing 12v12. You can host a 12v12 custom bot game with this script by running a command or simply creating a custom 12v12 game with default bots (e.g. https://steamcommunity.com/sharedfiles/filedetails/?id=956357541&tscn=1723517470) . I don't think there's a pc that can host 12v12 with consistent 90+ fps for a game when using this script. There's a lot to improve in performance in both bots game play as well as system resource usage. We can worry about system resource usage later and prioritize gameplay, but let's try to reduce the computation while making any changes. Note that this script (OHA) already adds a lot of additional computations on top of default bot script, which is a legacy issue from all former contributors in the past years.

forest0xia commented 1 week ago

I just watched 3 games with the modified FS mid. But it doesn't seem to be stronger at all if we see the overall performance. It lost all 3 games and SF wasn't the top 2 bots carrying the game in the team.

20240908161158_1 20240908154951_1 20240908160008_1 20240908161136_1

forest0xia commented 1 week ago
  1. You might have improved it with the idea to save souls, but i rarely see him using the ability now which seems worse because that basically means SF now wont use that ability almost throughout the game.
  2. Bot SF can't do combo as efficient as human, as we know, but i rarely see him doing any blink, cyclone, ult combo at all. And the shadow blade is basically for retreating not for any kind of combo as far as what I've seen. This means the magical build SF is weak as it doesn't know how to apply the true power of it's items.
  3. Mid sf does not need to carry so many healings in the beginning. it needs bottle or anything to boost dmg to get the bottle.
  4. It's not your fault that magical sf doesn't know how to combo better. It's in general not ez to do for bots. Especially for heroes like SF that's ez to get killed with no escaping skills. And that's the primary reason why physical build SF was a better choice.
  5. I'd say in general this magical SF at the moment is weaker than original. But I'm just trying to be honest and please don't feel discouraged about it. We can make it better.
  6. The next step is probably to figure out how to combo better. such as: invisible + ult, cyclone + ult. And cast all skills after using it's ult.
  7. let me know if you have question in general how to make changes to bot behaviors.
EfeDursun125 commented 1 week ago

you should test this by adding them on both sides (cannot be outplayed by hero/team diff). first, no one uses this ability named feast of souls because it eats your 35 damage for little bit speed, if you select +2 soul damage talent you will have 140 damage if you have 20 soul and you can go over 20... plus you also have shadowraze apply attack damage talent too. feast of souls is literally not worth it but some players use it because it lets you ult faster with yasha and kaya so you can ult before getting stunned but for faster attack speed its useless. if you do basic math it cannot be weaker than before. before this sf was walking with only less then 5 souls which makes his ultimate completely useless plus no damage gain. if you have script before the merge test it too.

i didn't give him these because of combo, eul makes him move faster and it gives damage too. he uses eul to prevent enemies to tp and he can save himself with eul, blink is for chase enemies. shadow blade is also for escape as well, but silver edge is for apply break which is so effective heroes which has passive abilities.

i gave him many healings because he will buy it later as always, reason of this keeping the aggression level at high. so courier's slowness not will stop him to engage lane.

sf in my games is improved, i don't use buff or fretbots. you might check if hero is sf after the blink usage to apply combos if possible. there's a vulft (full takeover, broken heroes play very well too) bots with dotabuff parser, might it helps to keep builds up to date.

forest0xia commented 1 week ago

Okay, I use fretbots with diff 5+ all the time. diff 2 for bot vs bot testing. maybe thats why sf is weak somehow since bots get items quicker. But sf also gets item sooner, which is still an indicator there are quite a lot of rooms for improvements. I just took a quick look at vulft, it's in C! Don't worry. we will have a script in typescript. but maybe im not going to be the person implementing it. hopefully some good dev friend will help out;