.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   msec and slow bots (http://forums.bots-united.com/showthread.php?t=2200)

sPlOrYgOn 05-07-2004 08:05

msec and slow bots
 
when I went searching around the web for HL stuff I found somewhere saying the msec value to pass to pfnRunPlayerMove() should be "gpGlobals->frametime * 1000"..
I started logging my gpGlobals->frametime and found that mine was almost always 0.010000
so I decided to see how TheFatal calculated it and I found my value would almost always be 9, but if I did it the other way it would almost always be 10..
So I decided to do it the other way and see what happens..
The bots seemed to get a sudden boost in speed..
I remembered someone asking why he saw the bots running slower with a knife out than he did when he had his knife out..
I tried it and doing "gpGlobals->frametime * 1000" made bots run at the same speed I did..
I tried changing the 450.0 / msecnum; to 500.0 / msecnum; and it worked just like "gpGlobals->frametime * 1000".
Why do we use TheFatal's method when we can just put "gpGlobals->frametime * 1000" there?

bomberman 05-07-2004 08:40

Re: msec and slow bots
 
Code:

  // TheFatal - START from Advanced Bot Framework (Thanks Rich!)

  // adjust the millisecond delay based on the frame rate interval...
  if (pBot->msecdel <= gpGlobals->time)
  {
      pBot->msecdel = gpGlobals->time + 0.5;
      if (pBot->msecnum > 0)
        pBot->msecval = 450.0/pBot->msecnum;
      pBot->msecnum = 0;
  }
  else
      pBot->msecnum++;

  if (pBot->msecval < 1)    // don't allow msec to be less than 1...
      pBot->msecval = 1;

  if (pBot->msecval > 100)  // ...or greater than 100
      pBot->msecval = 100;

// TheFatal - END

  pBot->f_frame_time = pBot->msecval / 1000;  // calculate frame time

Do you mean these stuff ?

sPlOrYgOn 05-07-2004 08:43

Re: msec and slow bots
 
yea that!

bomberman 05-07-2004 08:50

Re: msec and slow bots
 
I did found that too , but I fix the problem , but there is another biiiig problem , after a mapchange , my bot move extremely slow ! :P

sPlOrYgOn 05-07-2004 08:56

Re: msec and slow bots
 
PMB found out that you have to set all the msec variables to 0 in ServerActivate()
so that they get reset each map.

bomberman 05-07-2004 09:02

Re: msec and slow bots
 
Code:

void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
{
  (*other_gFunctionTable.pfnServerActivate)(pEdictList, edictCount, clientMax);
}

I think you mean this stuff ? my knowledge is not good

sPlOrYgOn 05-07-2004 09:05

Re: msec and slow bots
 
yes that

bomberman 05-07-2004 09:06

Re: msec and slow bots
 
Code:

pBot->msecdel = 0;
pBot->msecval = 0;
pBot->msecnum = 0;

Are something like this ?

sPlOrYgOn 05-07-2004 09:08

Re: msec and slow bots
 
yea but why are your msec values different for each bot?
why not use the same ones for all bots?

bomberman 05-07-2004 09:15

Re: msec and slow bots
 
you rock ! the problem fixed ! thanks very much !


All times are GMT +2. The time now is 08:13.

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