.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   what todo about game dlls who are build in debug mode (http://forums.bots-united.com/showthread.php?t=526)

Rick 26-01-2004 21:39

what todo about game dlls who are build in debug mode
 
I'm not sure if anyone here has ever tried to run his bot when the server dll was build in debug mode...but when you do you get tons of errors all the time like 'can't find address <hex>' and 'no export <a server dll function here, mostly entities> printed out in the console. Also the game seems to crash because of this problem. When you build your bot dll in debug mode the game is pretty stable, mostly for about 30 mins. But when you build your bot dll in release mode it will crash after a few secs after you made a bot. When it crashes, its never in my bot code.
Does anyone encouterd this and have a solution ???:(

Pierre-Marie Baty 27-01-2004 05:57

Re: what todo about game dlls who are build in debug mode
 
I know at least why it says "can't find proc XXXXXXX". It's because the game DLL doesn't implement the single player features (save/load) and single player specific classes. It should not disrupt multiplayer gaming though, and if you hook FunctionFromName and NameForFunction and build your own exports array like botman does in his HPB_bot (or like I do with the RACC template - see the LoadSymbols() function) this error should vanish away.

I'm not sure this has something to do with your crashes, though...

Austin 27-01-2004 06:26

Re: what todo about game dlls who are build in debug mode
 
If your code runs fine with a debug build but crashes with a non-debug build this is almost certainly caused by using some variable or memory that has not been initialized.

The debug builds zeros out ALL variables, the release builds do not do this.

It doesn't have to crash in your code either. You can be sending in some initialized struct, variable or memory into a Hl/ game function causing IT to crash.

Pierre-Marie Baty 27-01-2004 06:44

Re: what todo about game dlls who are build in debug mode
 
Quote:

Originally Posted by Austin
The debug builds zeros out ALL variables, the release builds do not do this.

Hey, I learn something new everyday :D

Rick 27-01-2004 10:15

Re: what todo about game dlls who are build in debug mode
 
Quote:

Originally Posted by Austin
If your code runs fine with a debug build but crashes with a non-debug build this is almost certainly caused by using some variable or memory that has not been initialized.

The debug builds zeros out ALL variables, the release builds do not do this.

It doesn't have to crash in your code either. You can be sending in some initialized struct, variable or memory into a Hl/ game function causing IT to crash.

hey I didn't knew that, thanx :)
Gonna check this out. And its prolly my code....when I disbled some stuff it didn't crash 9_9. Anyways thanx for the replies.

Rick 27-01-2004 17:57

Re: what todo about game dlls who are build in debug mode
 
weee fixed the crash bug in release mode 8)
I had a simple mistake like this:
Code:

char *ARandomStringTable =
{
  "hello", "how","are","you","doing",
  // terminator
  ""
};

//...
while(ARandomStringTable)
//....

As Austin said this will work in debug mode because everything gets initialized, so the loop will eventually stop. But it won't stop in release mode ofcourse, so I added an FStrEq to check if its an empty string :)

Pierre-Marie Baty 27-01-2004 18:39

Re: what todo about game dlls who are build in debug mode
 
You could do that:
Code:

char *ARandomStringTable =
{
"hello", "how","are","you","doing",
// terminator
"\0"
};

I think it would work :)

*edit* well, provided you don't forget to do "while (*ARandomStringTable)" instead too.

Rick 27-01-2004 18:50

Re: what todo about game dlls who are build in debug mode
 
hmm..nope you need 0 instead of "\0" :)

Pierre-Marie Baty 27-01-2004 18:52

Re: what todo about game dlls who are build in debug mode
 
lol, saw that, I edited my post but you replied in the meanwhile :D


All times are GMT +2. The time now is 21:10.

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