Properly compiling RCBot2 |
Properly compiling RCBot2 |
Lambda |
Sep 28 2009, 11:36 AM
Post
#1
|
Member Group: Members Posts: 11 Joined: 28-September 09 Member No.: 1,700 |
I've been trying to recompile RCBot2 from the SVN since my servers crashes after 10 minutes with bots, I've checked the minidump and it crash at a random location of the RCBot dll so recompiling it should give me a new dll and a pdb so it will be easy to fix.
The problem is, i've recompiled the project under VS2008 (only in release, i cant get around the linker errors in the debug version), but when i load the DLL in the srcds (i'm using dedicated server) the server just hangs and crashes in about 20 seconds after the total hang and i have no idea why is this happening. Im using the same OBSDK as i use for my metamod plugins which works fine (The one reverse engineered from allied modders), so it shouldnt be a SDK problem. Is this a problem related with VC2008? have anyone managed to properly compile RCBot2 under VS2008 or should i use 2005 instead? |
bir3yk |
Sep 28 2009, 11:55 AM
Post
#2
|
RCBot Fan Group: Members Posts: 107 Joined: 4-June 09 Member No.: 1,566 |
Read this, changes must be done in the SDK, well, and should compile release.
http://rcbot.bots-united.com/forums/index.php?showtopic=1291 |
Lambda |
Sep 28 2009, 05:56 PM
Post
#3
|
Member Group: Members Posts: 11 Joined: 28-September 09 Member No.: 1,700 |
Read this, changes must be done in the SDK, well, and should compile release. http://rcbot.bots-united.com/forums/index.php?showtopic=1291 Yeah, im aware about those changes, that's not the problem, the problem seems to be the VS2008, i've compiled it with 2005 and works like a charm. |
Cheeseh |
Sep 29 2009, 12:20 AM
Post
#4
|
Admin Group: Admin Posts: 3,055 Joined: 11-September 03 From: uk Member No.: 1 |
Yeah, im aware about those changes, that's not the problem, the problem seems to be the VS2008, i've compiled it with 2005 and works like a charm. there must be a linker problem in the release, in terms of version, are u using the latest steam source as the base SDK for rcbot2 ? (With the above addition of course). I'd try to sort out the linker problems in debug, if it doesn't work in debug, it won't work in release. |
Lambda |
Sep 29 2009, 01:58 AM
Post
#5
|
Member Group: Members Posts: 11 Joined: 28-September 09 Member No.: 1,700 |
there must be a linker problem in the release, in terms of version, are u using the latest steam source as the base SDK for rcbot2 ? (With the above addition of course). I'd try to sort out the linker problems in debug, if it doesn't work in debug, it won't work in release. No, im using the Allied Modders reverse engineered SDK (which haves the fixes of the SendProp class) and works fine under VS2005 but not in VS2008 Also, im intensively using RCBot2 in one of my servers and it have crashed sometimes, it crash at CClassInterface :: getTF2Class in the pointer dereferencing, so i've made a safer version of it, you can add it to the SVN if you want. CODE int CClassInterface :: getTF2Class ( edict_t *edict ) { IPlayerInfo* pPlayerInfo = playerinfomanager->GetPlayerInfo( edict ); if( pPlayerInfo ) return pPlayerInfo->GetTeamIndex(); return 0; } EDIT: Another crash happened, this time is a integer division by 0 it happens here. CODE bool CBot::wantToFollowEnemy () { return ((m_pPlayerInfo->GetHealth()/m_pPlayerInfo->GetMaxHealth())>0.5); } Im not sure to how to fix this one since i dont know what are the repercussions of this function if i make a "hard fix" Call Stack. QUOTE HPB_bot2.dll!CBot::wantToFollowEnemy() Line 1693 + 0x1d bytes C++ HPB_bot2.dll!CBotTF2::getTasks(unsigned int iIgnore=0) Line 1701 + 0x9 bytes C++ HPB_bot2.dll!CBot::think() Line 536 C++ HPB_bot2.dll!CBots::botThink() Line 2042 + 0x5 bytes C++ HPB_bot2.dll!CRCBotPlugin::GameFrame(bool simulating=) Line 393 C++ QUOTE Unhandled exception at 0x0ec83dc0 (HPB_bot2.dll) in Steam__273447__2009_9_29T2_38_57C1380796.mdmp: 0xC0000094: Integer division by zero. |
bir3yk |
Sep 29 2009, 05:13 AM
Post
#6
|
RCBot Fan Group: Members Posts: 107 Joined: 4-June 09 Member No.: 1,566 |
I have everything working svn 115 properly with VS2008 in DEBUG mode, release did not try. read http://developer.valvesoftware.com/wiki/Co...ng_under_VS2008
svn 115 debug VS2008 http://www.megaupload.com/?d=VNI6GC2Q |
Cheeseh |
Sep 29 2009, 01:25 PM
Post
#7
|
Admin Group: Admin Posts: 3,055 Joined: 11-September 03 From: uk Member No.: 1 |
change the follow enemy function to this,
CODE bool CBot::wantToFollowEnemy () { return getHealthPercent() > 0.5; } I'd need to know the exact line of the "getTF2Class " crash and the call stack, if possible. |
Lambda |
Sep 30 2009, 01:07 PM
Post
#8
|
Member Group: Members Posts: 11 Joined: 28-September 09 Member No.: 1,700 |
change the follow enemy function to this, CODE bool CBot::wantToFollowEnemy () { return getHealthPercent() > 0.5; } I'd need to know the exact line of the "getTF2Class " crash and the call stack, if possible. Thanks for the fix, i dont have the dump crash of getTF2class right now but if it happens again i'll tell you the details. Also, i've read in the RCbot2 forum that there's a crash related with the attacker when a bot takes damage from the world, is fixed in the svn? if not, what is the fix?. |
Cheeseh |
Sep 30 2009, 07:43 PM
Post
#9
|
Admin Group: Admin Posts: 3,055 Joined: 11-September 03 From: uk Member No.: 1 |
Thanks for the fix, i dont have the dump crash of getTF2class right now but if it happens again i'll tell you the details. Also, i've read in the RCbot2 forum that there's a crash related with the attacker when a bot takes damage from the world, is fixed in the svn? if not, what is the fix?. it should be fixed, the fix is in the Bot Event for player death |
Lambda |
Sep 30 2009, 08:56 PM
Post
#10
|
Member Group: Members Posts: 11 Joined: 28-September 09 Member No.: 1,700 |
it should be fixed, the fix is in the Bot Event for player death Ok, thanks, im running 2 servers with 12 bots on each one, i'll tell you if something strange happens. Also, there's problems when adding engineers bots? Since most of the people complains about bot of other classes my idea is just to add medic & engineers bots since they do not require a high skill to be useful, but i've readed that engineers bots may cause problems. There's also a strange thing related with the scout stun, when you stun a bot with the sandman the bot get the stun logo above the head but they can still move and shoot, its funny to see a heavy stunned but you dead because of his minigun xD. |
bir3yk |
Oct 1 2009, 06:18 AM
Post
#11
|
RCBot Fan Group: Members Posts: 107 Joined: 4-June 09 Member No.: 1,566 |
Cheeseh help deal with VS2008. When compiling DEBUG it works, but when you compile in RELEASE TF2 crash when loading Rcbot2. You can not lay on the forum HPB_bot2.map, I get the file size svn 116 HPB_bot2.dll 825 344, up to 10kB of your approximate.
returned to VS2005 |
Lambda |
Oct 1 2009, 01:05 PM
Post
#12
|
Member Group: Members Posts: 11 Joined: 28-September 09 Member No.: 1,700 |
getTF2Class happened, information.
Line: CODE return *(int *)((char *)pEntity + offset); Call Stack: CODE HPB_bot2.dll!CClassInterface::getTF2Class(edict_t * edict=0x100f5290) Line 977 + 0x9 bytes C++ HPB_bot2.dll!CBotFortress::wantToFollowEnemy() Line 1490 + 0xf bytes C++ HPB_bot2.dll!CBotTF2::getTasks(unsigned int iIgnore=0) Line 1705 + 0xf bytes C++ HPB_bot2.dll!CBot::think() Line 533 + 0x14 bytes C++ HPB_bot2.dll!CBots::botThink() Line 2046 C++ HPB_bot2.dll!CRCBotPlugin::GameFrame(bool simulating=true) Line 393 C++ engine.dll!0badd91e() Local Variables: CODE offset 0 unsigned int pEntity 0x1e35e008 CBaseEntity * + pUnknown 0x1e35e008 IServerUnknown * I have 2 servers running, one on dustbowl and the other on badwater, the badwater one has been running for 10+ hours without a crash, the dustbowl crash every 4-5 hours, both servers with 12 bots. The last time i've checked the dustbowl server was 2 humans playing on it. Here you have the DLL + PDB + Crash dump so you can check it for yourself. http://rapidshare.com/files/287341724/bin.rar.html |
Cheeseh |
Oct 1 2009, 09:09 PM
Post
#13
|
Admin Group: Admin Posts: 3,055 Joined: 11-September 03 From: uk Member No.: 1 |
okay, make the following change,
CODE bool CBotFortress :: wantToFollowEnemy () { IPlayerInfo *p; if ( !m_pLastEnemy ) return false; if ( hasFlag() ) return false; if ( getClass() == TF_CLASS_SCOUT ) return false; if ( (m_iClass == TF_CLASS_SPY) && isDisguised() ) // sneak around the enemy return true; // incase enemy was a sentry gun, do a check here, make sure it is a player p = playerinfomanager->GetPlayerInfo(m_pLastEnemy); if ( p && p->IsPlayer() && (CClassInterface::getTF2Class(m_pLastEnemy) == TF_CLASS_SPY) && (thinkSpyIsEnemy(m_pLastEnemy)) ) return true; // always find spies! return CBot::wantToFollowEnemy(); } might explain why there are more crashes when there are engies playing, (I've also updated the SVN) |
bir3yk |
Oct 2 2009, 12:12 PM
Post
#14
|
RCBot Fan Group: Members Posts: 107 Joined: 4-June 09 Member No.: 1,566 |
server crash!
like a sniper sets m_iClass -310316751 TF_Class CODE if ( p && p->IsPlayer() && (CClassInterface::getTF2Class(m_pLastEnemy) == TF_CLASS_SPY) && (thinkSpyIsEnemy(m_pLastEnemy)) ) 00000000() HPB_bot2.dll!CBotFortress::wantToFollowEnemy() Строка 1500 + 0xd байт C++ HPB_bot2.dll!CBotTF2::getTasks(unsigned int iIgnore=0) Строка 1713 + 0x9 байт C++ HPB_bot2.dll!CBot::think() Строка 536 C++ HPB_bot2.dll!CBots::botThink() Строка 2042 + 0x5 байт C++ HPB_bot2.dll!CRCBotPlugin::GameFrame(bool simulating=true) Строка 393 C++ engine.dll!0ed0d91e() |
Cheeseh |
Oct 2 2009, 02:07 PM
Post
#15
|
Admin Group: Admin Posts: 3,055 Joined: 11-September 03 From: uk Member No.: 1 |
ok scratch that, PlayerInfo is very dodgy...
try... CODE bool CBotFortress :: wantToFollowEnemy () { if ( !m_pLastEnemy ) return false; if ( hasFlag() ) return false; if ( getClass() == TF_CLASS_SCOUT ) return false; if ( (m_iClass == TF_CLASS_SPY) && isDisguised() ) // sneak around the enemy return true; if ( ((ENTINDEX(m_pLastEnemy) > 0)&&(ENTINDEX(m_pLastEnemy)<=gpGlobals->maxClients)) && (CClassInterface::getTF2Class(m_pLastEnemy) == TF_CLASS_SPY) && (thinkSpyIsEnemy(m_pLastEnemy)) ) return true; // always find spies! return CBot::wantToFollowEnemy(); } |
Lo-Fi Version | Time is now: 29th March 2024 - 08:22 AM |