.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Sandbot (http://forums.bots-united.com/forumdisplay.php?f=85)
-   -   Sandbot v0.3.1 (http://forums.bots-united.com/showthread.php?t=10047)

tschumann 25-02-2017 04:05

Re: Sandbot v0.3.1
 
I gave it a go today and it didn't work with Gunman Chronicles - there's a late precache of sprites/muzzleflash3.spr which causes the game to exit but this only happens with MetaMod. Any ideas?

The Storm 25-02-2017 21:01

Re: Sandbot v0.3.1
 
Could you give me a link to download working version of Gunman Chronicles for Steam?

Edit: I downloaded http://www.moddb.com/games/gunman-ch...-steam-version and installed Metamod-p 1.21p37 with Sandbot metamod branch and the game is running just fine.
Edit2: Oops, it seems that only the debug version is working. The release version is crashing the game lol.
Edit3: After some debugging I found out that it is a memory corruption issue. I actually located it. It is in the weapon message processing system for Gunman Chronicles - function BotClient_Gunman_WeaponList().
The bug is array overflow in bot_client.cpp:353, when accessing weapon_defs with bot_weapon.iId == 32. The array max index is 31, you are going out of bounds and some other memory gets modified which then causes undefined behavior. This is reproducible in both Metamod and non-metamod mode with the exception that in non-metamod mode the game is not crashing, because it seems that the invalid accessed memory is not critical at this state. As I said - this is undefined behavior.

The easiest fix here will be to increase the weapon_defs[] array from 32 to 33 but I cannot recommend that because 'MAX_WEAPONS' is from the HLSDK and is set to 32. Perhaps there is other way to parse the weapon messages for Gunman Chronicles?
Unfortunately you will have to find a proper fix for that yourself. :)

tschumann 26-02-2017 11:36

Re: Sandbot v0.3.1
 
Hm, the debug version worked for me but I didn't try a release build but I was using the original MetaMod not MetaMod-P.

Thanks for tracking down the issue anyway. I'll try and figure out what's going on next weekend.

tschumann 04-03-2017 06:42

Re: Sandbot v0.3.1
 
So, I updated MAX_WEAPONS to 48 (which seems to be what Gunman Chronicles uses) but that still didn't fix the issue, but updating to MetaMod-P did, so I've made MetaMod-P a requirement.
I try on Linux now and the game freezes when I start it with MetaMod-P - not sure what to do at this point. On Windows I get a nice crash-dump but I'm not too familiar with debugging on Linux and I've never had to use gdb with a dynamically loaded library.

The Storm 04-03-2017 12:21

Re: Sandbot v0.3.1
 
Metamod and Metamod-p should be interchangeable. Tomorrow I will have more time and I will check out what is going on. Also I think you should improve your debugging skills. :P

tschumann 04-03-2017 22:37

Re: Sandbot v0.3.1
 
Yeah I thought it was odd that they would be different.

I probably could have worked it out if there was a crash dump but I couldn't find any crash dump. I tried searching and I saw one place say that crash dumps were in /tmp/dumps but there were no dump files there.

The Storm 05-03-2017 00:36

Re: Sandbot v0.3.1
 
Just attach gdb to the process and wait for the crash directly there. If you really want to have crash dumps you should first enable them. Each distro has it's own way so go check out the reference. :)

Edit: OK, I found the issue with the original Metamod - it does not export all entities that are required for Gunman Chronicles regardless that on the metamod.org site it says that the mod is supported. Some entities are not spawned because of that and so "sprites/muzzleflash3.spr" is not precached on time, the engine tries to use it later when the bots begin to fight but it cannot find it, so it tries to precache it by himself but because of bug in the engine itself you get this error. So basically you will have to make Metamod-p a requirement. I will check later the Linux issues.

tschumann 05-03-2017 06:21

Re: Sandbot v0.3.1
 
Ah that would explain the problem then.

Anyway, I did some more investigation and I got the game to load once in Linux and meta list showed that MetaMod was running. Every other time the game seemed to freeze up, even if I didn't load Sandbot in plugins.ini - hl_linux was still a running process though so I guess it didn't crash. I suspect my under-powered Linux VM is the problem (I have a dual boot to Linux setup but my Linux install corrupted).
Anyway, I've seen it working so I've released a new version with MetaMod support. Many thanks for the help again.

The Storm 05-03-2017 13:54

Re: Sandbot v0.3.1
 
Nice. Great to see that everything is finally in place. :)


All times are GMT +2. The time now is 22:32.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.