tschumann / sandbot

GoldSource engine multiplayer bot
GNU General Public License v2.0
35 stars 9 forks source link

Building #8

Closed xSkeletor closed 1 year ago

xSkeletor commented 1 year ago

Hey man, recently found out about this project and tried out version 0.4.2, and it works pretty great, although there were a couple of issues I encountered such as the inability to change the number of bots, bot skill 5 not working, etc. I saw that according to a 0.4.3 changelog that was posted in this repo, some of these issues are fixed, but when I tried to use the content from the Half-Life folder in the release folder of this repo, I still had the same issues, so I think that this release folder is the stable release. I tried to open up the project in Visual Studio 2019 and click the build button, but it looks like it created some debug folder with a bunch of C++ files, so I'm not exactly sure what to do. Can you guide or explain to me how to create a build with all the folders like in the release folder along with all the recent unreleased changes so that I can use them in my client/server? Again, great work so far, and I"m looking forward to the future of the mod!

tschumann commented 1 year ago

Yeah the .dll files in the repo are for 0.4.2.

When you build is there not a sandbot.dll in the Debug folder?

xSkeletor commented 1 year ago

I believe that there is a sandbot.dll file, but I'm not sure what to do with it or where to put it.

tschumann commented 1 year ago

Okay so copy that to steamapps/common/Half-Life/valve/dlls and copy https://github.com/tschumann/sandbot/blob/master/release/sandbot/half-life/valve/liblist.gam to steamapps/common/Half-Life/valve and it should load in Half-Life (for example).

xSkeletor commented 1 year ago

I tried doing that with Opposing Force (gearbox), along with the rest of the games that are included (I just replaced all occurrences of sandbot.dll), and my server would not start (I don't know what error it's giving me since the terminal window opens and closes instantly). I assume I don't have to replace liblist.gam though, since I already had sandbot installed.

tschumann commented 1 year ago

You need to replace liblist.gam so the engine knows to load Sandbot (instead of opfor.dll for example).

Can you run the server with -condebug or something like that to get the output in a log file?

xSkeletor commented 1 year ago

Oh, I assumed that since I had already installed sandbot 0.4.2 I could simply upgrade the dll file, since I thought the liblist.gam would not be different between these versions.

tschumann commented 1 year ago

Oh right - I assumed you were freshly installing. Yeah liblist.gam won't change between versions.

What operating system are you using?

xSkeletor commented 1 year ago

Using Windows 10. I enabled logging and this it what it says:

LoadLibrary failed on c:\server\steamapps\common\half-life.\gearbox\dlls\sandbot.dll (126) Host_Error: Couldn't get DLL API from c:\server\steamapps\common\half-life.\gearbox\dlls\sandbot.dll!

tschumann commented 1 year ago

Hm, that could be a few things. It's probably a missing .dll file (like a Visual C++ runtime .dll or something like that). Run dumpbin /dependents sandbot.dll (dumpbin will be installed somewhere as part of Visual C++) and it should hopefully tell you the required .dll files.

xSkeletor commented 1 year ago

Ran the command, for both 0.4.2 and 0.4.3. It looks like the only difference is that the old one (0.4.2) only has KERNEL32, whereas the new one (0.4.3) has both KERNEL32 and Microsoft.VisualStudio.TestTools.CppUnitTestFramework.dll. Do you know how I can get that new DLL, or check if it's installed?

image

tschumann commented 1 year ago

Ah... the unit test I've been working on it causing an issue by the looks of it. I'll have to take a look and see what's going on...

xSkeletor commented 1 year ago

Oh okay, do you have any ETA on when you expect to have this fixed..?

tschumann commented 1 year ago

Probably not this weekend but maybe next weekend.

On Sunday, 12 March 2023, Dennis Fomichev @.***> wrote:

Oh okay, do you have any ETA on when you expect to have this fixed..?

— Reply to this email directly, view it on GitHub https://github.com/tschumann/sandbot/issues/8#issuecomment-1465067600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA34IYX4OIRPO54YFRET4FDW3USVXANCNFSM6AAAAAAVTGQVKY . You are receiving this because you commented.Message ID: @.***>

tschumann commented 1 year ago

Can you try again? I pushed a fix (didn't test it) but the test .dll is no longer in the list of dependencies.

xSkeletor commented 1 year ago

Looks like it works now, but there are still some issues. Firstly, I can't change the number of bots. I try to use bot_count cvar 5, and instead of setting the bot count to 5 it deletes them all. This brings me to the second issue, you can't add bots using addbot. Thirdly, none of settings like botcount or bot_skill are saved.

tschumann commented 1 year ago

Hm okay, it's been a while since I've tested it in-game so stuff might be broken. What happens when you type addbot? Yeah I'm not currently persisting any of the options - I can flag the cvars as needing to be archived but wasn't sure if I wanted to dump extra junk into config.cfg

tschumann commented 1 year ago

@xSkeletor I just tried now and bot_count works, as does addbot, at least in Half-Life. What game/mod are you trying?

xSkeletor commented 1 year ago

I am using Opposing Force (gearbox). Nothing happens when I try to run addbot, but as explained when I try to change the number of bots, it always just goes to 0 and I can never change it without restarting the server itself.

tschumann commented 1 year ago

Okay and are you running a dedicated server? What operating system are you using?

On Mon, 27 Mar 2023 at 15:46, Dennis Fomichev @.***> wrote:

I am using Opposing Force (gearbox). Nothing happens when I try to run addbot, but as explained when I try to change the number of bots, it always just goes to 0 and I can never change it without restarting the server itself.

— Reply to this email directly, view it on GitHub https://github.com/tschumann/sandbot/issues/8#issuecomment-1484530938, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA34IYSSPEGIJB6C6G7HIVTW6ESTNANCNFSM6AAAAAAVTGQVKY . You are receiving this because you commented.Message ID: @.***>

xSkeletor commented 1 year ago

Yep, using a dedicated server hosted with Steam CMD on Windows 10.

tschumann commented 1 year ago

Add okay, yep if it's a dedicated server then addbot is disallowed (so that it can't be abused). Are you using MetaMod? Can you send me the commands you're running so I can set it up and test? I only develop using a listen server.

xSkeletor commented 1 year ago

Not sure if I'm using MetaMod, I think it comes preinstalled with Sandbot though. My installation is vanilla, apart from installing Sandbot. Also, which commands are you referring to? My server start-up commands?

tschumann commented 1 year ago

Okay - MetaMod comes bundled but with Sandbot but isn't installed by default. Yeah what commands do you run to start up your server? I assume you're in the SteamCMD console and have typed something to install Opposing Force then something else to start a dedicated server.

xSkeletor commented 1 year ago

Yeah, so I install the dedicated server the typical way and set it to be the gearbox mod before I install the app. Then my start-up command is hlds.exe -console -game gearbox +map crossfire +maxplayers 24 +hostname testing +ip <IP here> +port 27015

tschumann commented 1 year ago

Okay I'll see what I can figure out.

tschumann commented 1 year ago

Okay sorry for the delay in getting back to this - I've eliminated a few IS_DEDICATED_SERVER checks since April and I tried running on a listen server with the IS_DEDICATED_SERVER check in dll.cpp swapped and the bots were added in Opposing Force.

xSkeletor commented 1 year ago

Hey, tried to build the updated solution but I got these errors. Also, do I build using debug or release?

image

tschumann commented 1 year ago

Debug or release should be fine. Ah those errors are probably from the new unit testing I added. I think you'll need to run git submodule update --init --recursive to get it to build.

On Monday, 4 September 2023, Dennis Fomichev @.***> wrote:

Hey, tried to build the updated solution but I got these errors. Also, do I build using debug or release?

[image: image] https://user-images.githubusercontent.com/58961555/265276169-81599623-9985-44eb-a75c-d630c7de590e.png

— Reply to this email directly, view it on GitHub https://github.com/tschumann/sandbot/issues/8#issuecomment-1704345010, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA34IYQ5OUVK2GVPPZTEAKDXYSUPHANCNFSM6AAAAAAVTGQVKY . You are receiving this because you commented.Message ID: @.***>

xSkeletor commented 1 year ago

Looks like the add_bot command still doesn't work, but at least I can set bot_count and it changes it properly now. Is there a way I can save these variables, like bot_skill and bot_count so that I don't have to enter them every time a server stars?

tschumann commented 1 year ago

Okay nice. And yeah the add_bot command will only work for listen servers. I don't know of a good way to allow this on dedicated servers - obviously HPB Bot blocked it because you don't want to let any user just keep adding bots.

Does setting those cvars in autoexec.cfg or something like that work?

On Mon, 4 Sept 2023 at 15:22, Dennis Fomichev @.***> wrote:

Looks like the add_bot command still doesn't work, but at least I can set bot_count and it changes it properly now. Is there a way I can save these variables, like bot_skill and bot_count so that I don't have to enter them every time a server stars?

— Reply to this email directly, view it on GitHub https://github.com/tschumann/sandbot/issues/8#issuecomment-1704629170, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA34IYU7OHRHICUQSSMTFSDXYVQSXANCNFSM6AAAAAAVTGQVKY . You are receiving this because you commented.Message ID: @.***>

xSkeletor commented 1 year ago

Sadly it doesn't look like having those cvars in any of the cfg files like autoexec made a difference. With that being said, that's not something that can addressed directly and not that big of a deal anyway. I'll close this issue for now, seeing as how my primary problems were resolved (6 months later, lol). Thanks for the help and good luck with the future of the project!