adamqqqplay / dota2ai

Ranked Matchmaking AI: An improved Dota2 AI based on Valve's default AI. Has more than 3 million subscribers on Steam.
http://steamcommunity.com/sharedfiles/filedetails/?id=855965029
GNU General Public License v3.0
319 stars 85 forks source link

Hotfix - #49 Bot Match Extreme Slowdown #50

Closed bensusman closed 3 years ago

bensusman commented 3 years ago

Temporarily removing armlet while more robust implementation for usage logic can be worked through.

*Happy to write up / discuss the desired armlet usage.

bensusman commented 3 years ago

Fixes #49

adamqqqplay commented 3 years ago

Thanks for your contribution! What do you think the usage of the armlet should be?

bensusman commented 3 years ago

@adamqqqplay From what I can tell the root of the issue comes down to the fact that the armlet toggle has no effective cooldown - making it possible to toggle very quickly. This creates less of a functional benefit to the hero, but creates a ton of churn.

I'm not sure if it is the number actions that need to be processed, the loop in and of itself or the particles etc that functionally cause the slowdown.

My thought is to remove instances of:

if not IsUsingArmlet then            
   itemArmlet.lastOpenTime = nil            
   return        
end

and always check similar to: https://github.com/adamqqqplay/dota2ai/blob/master/util/ItemUsageSystem.lua#L624 not IsUsingArmlet and DotaTime() - itemArmlet.lastOpenTime >= 0.6 before any armlet toggle.

I'll create a follow up PR and can decide with above kind of logic if you think it sounds reasonable.

adamqqqplay commented 3 years ago

@adamqqqplay From what I can tell the root of the issue comes down to the fact that the armlet toggle has no effective cooldown - making it possible to toggle very quickly. This creates less of a functional benefit to the hero, but creates a ton of churn.

I'm not sure if it is the number actions that need to be processed, the loop in and of itself or the particles etc that functionally cause the slowdown.

My thought is to remove instances of:

if not IsUsingArmlet then            
   itemArmlet.lastOpenTime = nil            
   return        
end

and always check similar to: https://github.com/adamqqqplay/dota2ai/blob/master/util/ItemUsageSystem.lua#L624 not IsUsingArmlet and DotaTime() - itemArmlet.lastOpenTime >= 0.6 before any armlet toggle.

I'll create a follow up PR and can decide with above kind of logic if you think it sounds reasonable.

Hello, I think your ideas are very meaningful. Switching Armlet and similar items without cooling time is indeed an important reason for the crash of the game. Although it cannot fundamentally solve the logical problem of the infinite loop of item switching, it can greatly alleviate this problem.

Therefore, I hope you can submit this part of the code in the future to further improve our game experience. Thank you!