forest0xia / dota2bot-OpenHyperAI

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

Case-sensitive LUA files, FretBots failing (Linux) #5

Closed Espionage724 closed 4 months ago

Espionage724 commented 4 months ago

script_reload_code bots/fretbots as-is from the Readme doesn't work:

[VScript] Script not found (scripts/vscripts/bots/fretbots)

script_reload_code bots/FretBots works, but reports inspect.lua missing:

[VScript] Script Runtime Error: scripts/vscripts/bots/FretBots/Utilities.lua:10: module 'bots.FretBots.inspect' not found:
    no field package.preload['bots.FretBots.inspect']Failed to read scripts/vscripts/bots/FretBots/inspect.lua
stack traceback:
    [C]: in function 'require'
    scripts/vscripts/bots/FretBots/Utilities.lua:10: in main chunk
    [C]: in function 'require'
    scripts/vscripts/bots/FretBots/Settings.lua:9: in main chunk
    [C]: in function 'require'
    scripts/vscripts/bots/FretBots/DataTables.lua:11: in main chunk
    [C]: in function 'require'
    ...dota 2 beta/game/dota/scripts/vscripts/bots/FretBots.lua:7: in function 'runscript'
    scripts/vscripts/utils/vscriptinit.lua:70: in function <scripts/vscripts/utils/vscriptinit.lua:58>

dota 2 beta/game/dota/scripts/vscripts/bots/FretBots/Inspect.lua exists with a uppercase I


I installed this by git pulling to the vscripts folder and moving the bots folder from OpenHyperAI one directory back to the vscripts folder.

Bot names and mention of !pos imply Open Hyper AI gets loaded and work fine without involving FretBots.

I'm running Dota 2 in probably the most unsupported config, but I'm wondering is FretBots supposed to work today fine? Or is it a case-sensitive filesystem ordeal? Or perhaps using the files as-is from GitHub isn't ideal?

forest0xia commented 4 months ago

You are cool man. I've never tried to run dota2 in Linux so honestly not sure what's the limitation.

But Fretbots works fun today with Windows OS, and the command to enable Fretbots is case insensitive in Windows. I think it probably has to do with your system/disk settings as well not just the OS itself.

The script works alright without enabling Fretbots. Fretbots is only for making it additional challenging that's all. You do not have to enable Fretbots.

forest0xia commented 4 months ago

You can replace the Fretbots keyword in the command and use Buff. That's a lighter way to give bots bonus gold/exp so to ensure bots can get will farmed to give more gaming experience throughout a game.

I don't plan to dive deep into this case issue as it's not a common issue to most players. But I'd appreciate if you can share your workarounds if you found anything useful to mitigate the issue

Espionage724 commented 4 months ago

It worked fine from Windows as-is with lowercase

sepulzera commented 3 months ago

To give a useful answer, what other failed to do:

Just fix the typo in the file /steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/FretBots/Utilities.lua (see https://steamcommunity.com/workshop/filedetails/discussion/3246316298/4520010047766285327/ if you don't know where that is)

fix line 10 local inspect = require('bots.FretBots.inspect') to the proper filename local inspect = require('bots.FretBots.Inspect')

and as mentioned, use the proper casing for the console command: script_reload_code bots/FretBots

Though you might want to move away from this bot script, as Linux (or bugfree casing) seems to be not supported and that really makes me wonder if the script quality would be good or useful in long-term...

Have a nice day!

forest0xia commented 3 months ago

Thanks for sharing @sepulzera . I never think about Linux support but I will update those good points you mentioned. TBH you don't need to think about long-term at all, as Valve keeps breaking the bot lower level logic apis, no proactive bug fixes, no new api support such as for the facet, neutral item selection/usage, aoe zone detection, etc. Valve is ruining the bot games. And there is no hope that they will come back to prioritize a fix for us. No much value to talk about long term as the official support for bot dev work is stopped. And how long can Dota2 exist before it become a dead game is a concern.

forest0xia commented 3 months ago

besides this script, there is currently no good code quality bot script exist today that's still being updated to support latest 7.37 and that's challenging enough for 2k+ players to have some continuously intensive experience. Bots are too underfarmed in laning phases and too weak/poor after laning phase. Any player who's able to get the simple bot playstyle pattern can win the game 100% easily with maybe 0 death and that's boring, and that's why Fretbots provide a better experience. I was a 5k player myself and I only started to improve the bots because the other existing ones are just too weak or broken or no much heroes supported.

In long term, look forward to Valve to release a ML version of the improved AI bots like this https://openai.com/index/openai-five/. This is the only best option for long term bot experience, but we probably won't be able to get it. so before it's there, let's do what we can to make the current bot script better piece by piece as we still have the interest to do so at the moment just with the love we have for dota2.

Espionage724 commented 2 months ago

On Windows if you have Git, I made a similar one-liner to pull in/update these bot scripts to the default Steam Dota 2 folder:

RMDIR /S /Q "%ProgramFiles(x86)%\Steam\steamapps\common\dota 2 beta\game\dota\scripts\vscripts\bots" && git clone --branch "main" --depth "1" --recurse-submodules "https://github.com/forest0xia/dota2bot-OpenHyperAI.git" "%Temp%\OpenHyperAI" && MKDIR "%ProgramFiles(x86)%\Steam\steamapps\common\dota 2 beta\game\dota\scripts\vscripts\bots" && XCOPY /E /Q /Y "%Temp%\OpenHyperAI\bots\" "%ProgramFiles(x86)%\Steam\steamapps\common\dota 2 beta\game\dota\scripts\vscripts\bots\" && RMDIR /S /Q "%Temp%\OpenHyperAI"

Separate commands:

RMDIR /S /Q "%ProgramFiles(x86)%\Steam\steamapps\common\dota 2 beta\game\dota\scripts\vscripts\bots"
git clone --branch "main" --depth "1" --recurse-submodules "https://github.com/forest0xia/dota2bot-OpenHyperAI.git" "%Temp%\OpenHyperAI"
MKDIR "%ProgramFiles(x86)%\Steam\steamapps\common\dota 2 beta\game\dota\scripts\vscripts\bots"
XCOPY /E /Q /Y "%Temp%\OpenHyperAI\bots\" "%ProgramFiles(x86)%\Steam\steamapps\common\dota 2 beta\game\dota\scripts\vscripts\bots\"
RMDIR /S /Q "%Temp%\OpenHyperAI"