.:: Bots United ::.  
filebase forums irc server wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps waypoints yapb

Go Back   .:: Bots United ::. > Cyborg Factory > Sandbot
Sandbot A bot for Gunman Chronicles and They Hunger - by tschumann

Reply
 
Thread Tools
Re: Sandbot v0.3.1
Old
  (#21)
tschumann
Moderator
 
tschumann's Avatar
 
Status: Offline
Posts: 100
Join Date: Apr 2011
Location: Australia
Default Re: Sandbot v0.3.1 - 25-02-2017

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?
   
Reply With Quote
Re: Sandbot v0.3.1
Old
  (#22)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,545
Join Date: Jul 2004
Location: Bulgaria
Default Re: Sandbot v0.3.1 - 25-02-2017

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.

Last edited by The Storm; 03-03-2017 at 14:28..
   
Reply With Quote
Re: Sandbot v0.3.1
Old
  (#23)
tschumann
Moderator
 
tschumann's Avatar
 
Status: Offline
Posts: 100
Join Date: Apr 2011
Location: Australia
Default Re: Sandbot v0.3.1 - 26-02-2017

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.
   
Reply With Quote
Re: Sandbot v0.3.1
Old
  (#24)
tschumann
Moderator
 
tschumann's Avatar
 
Status: Offline
Posts: 100
Join Date: Apr 2011
Location: Australia
Default Re: Sandbot v0.3.1 - 04-03-2017

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.
   
Reply With Quote
Re: Sandbot v0.3.1
Old
  (#25)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,545
Join Date: Jul 2004
Location: Bulgaria
Default Re: Sandbot v0.3.1 - 04-03-2017

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.
   
Reply With Quote
Re: Sandbot v0.3.1
Old
  (#26)
tschumann
Moderator
 
tschumann's Avatar
 
Status: Offline
Posts: 100
Join Date: Apr 2011
Location: Australia
Default Re: Sandbot v0.3.1 - 04-03-2017

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.
   
Reply With Quote
Re: Sandbot v0.3.1
Old
  (#27)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,545
Join Date: Jul 2004
Location: Bulgaria
Default Re: Sandbot v0.3.1 - 05-03-2017

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.

Last edited by The Storm; 05-03-2017 at 04:31..
   
Reply With Quote
Re: Sandbot v0.3.1
Old
  (#28)
tschumann
Moderator
 
tschumann's Avatar
 
Status: Offline
Posts: 100
Join Date: Apr 2011
Location: Australia
Default Re: Sandbot v0.3.1 - 05-03-2017

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.
   
Reply With Quote
Re: Sandbot v0.3.1
Old
  (#29)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,545
Join Date: Jul 2004
Location: Bulgaria
Default Re: Sandbot v0.3.1 - 05-03-2017

Nice. Great to see that everything is finally in place.
   
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com