forest0xia / dota2bot-OpenHyperAI

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

Customized hero selection can get random results since 7.37 #53

Closed hetong007 closed 1 month ago

hetong007 commented 1 month ago

The specific context: I usually play with another friend with this bot script filling all the other 8 slots. We sometimes go different sides and pick our own lineup heroes to play against each other. This is supposed to be configurable in general.lua. One sample code from our customization:

Customize.Enable = false

-- Set the heroes you DON'T want the bots to pick. Use hero internal names.
-- Hero name ref: https://steamcommunity.com/workshop/filedetails/discussion/3246316298/4848777260032086340/
Customize.Ban = {
    'example_npc_dota_hero_internal_name_to_ban',
}

-- Set the heroes you want Radiant bots to pick. You have to use hero's internal name.
-- Hero internal name ref: https://steamcommunity.com/workshop/filedetails/discussion/3246316298/4848777260032086340/
-- Don't need to provide a value for all 5 bots, any empty/missing value will fallback to a Random value.
-- The position is ranked by the order of the names you put in the below list, pos 1 - 5, from top to down.
-- There are sample team picks in Appendix section below.
Customize.Radiant_Heros = {
    'npc_dota_hero_luna',
    'npc_dota_hero_dark_willow',
    'npc_dota_hero_terrorblade',
    'npc_dota_hero_shadow_demon',
    'npc_dota_hero_ancient_apparition',
}

-- Same notes as for Radiant_Heros above
Customize.Dire_Heros = {
    'npc_dota_hero_phantom_assassin',
    'npc_dota_hero_shredder',
    'npc_dota_hero_medusa',
    'npc_dota_hero_sand_king',
    'npc_dota_hero_silencer',
}

By definition we create the local lobby and each player join a specific slot on each side, and we'll occupy the slot for that hero, and the rest slots are taken over by the bot script. A concrete example: I take Radient 2nd slot and my friend takes Dire 4th, then we expect that I'll pick dark willow for midlane and he'll play sand king as pos4, with other heroes picked and laned by the script.

However, we observe some random behaviors in bot's hero selection and laning, including:

Without changing code, these behaviors happens randomly by re-starting the lobby game. It's a bit annoying because we can only hope that by restarting the lobby it'll behave as expected for once.

This also happened to Sirious AI as well, after 7.37, actually this is part of the reason that drove me to search for a more customizable bot script. I'm opening this issue to check if the dev & community are aware of this behavior, and would like to know if this is a bug on Valve's end or if there are solutions/workarounds by scripting.

forest0xia commented 1 month ago

Some heroes are considered weak for bots in my opinion so I limited those heroes to get picked no more than one in a team. If there are more than one of those heroes to be picked in the selected names, the rest of names will be randomized so you see sometimes bots won't pick the one you want - this is to protect your gaming experience because more than 1 weak heroes in a game is even more annoying and just hard to win if the other side is with all strong picks.

See the appendix notes in Customize/general.lua file. You can allow bots to pick more than one of those heroes by changing the flag Allow_Repeat...

Real Players are on the top of the team list while picking so bots may not follow the pick order strictly. This option was to designed for a full bot team. As you can see there is no notes for how players can choose their pos if they mix with bots. Please try out combinations and add notes if you can find a workaround, or feel free to help me to add the support that's in your mind

forest0xia commented 1 month ago

I've been playing with a 5 men team lately for the past months so didn't really know what's happening to the mix scenario where human and bots are in a customized team. Let me find some time later to see what actual is going wrong. Thanks

hetong007 commented 1 month ago

Thanks for the response, I confirm that Customize.Allow_Repeated_Heroes = true fixes the hero picks. Still, the random positioning & laning issue happends, and it does almost only for Dire. I'll see what patterns I can find and update here.

forest0xia commented 1 month ago

The position shouldn't be random, nor the laning. Are you using the latest of my script?

It's a tricky bug from Valve to resolve it for Dire and can take a lot of mental energy, good luck if you want to resolve it yourself on a different use case tho

forest0xia commented 1 month ago

Try the new version I just released in Workshop

hetong007 commented 1 month ago

With the latest workshop version I very briefly checked the hero selection/position w.r.t. Dire lobby slot, seems to work. Will have time to check more later and update here. Appreciate the quick fix!

I'm curious to learn about the code change as well, so it would be great if you'll also bring the changes to github.

forest0xia commented 1 month ago

crack the buggy Valve bot script when you still have some patient. I will merge the changes probably when I feel bots reach another level later. right now I have mixed testing stuff and dont want to bother messing with my workspace.