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

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
msec and slow bots
Old
  (#1)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default msec and slow bots - 05-07-2004

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?
  
Reply With Quote
Re: msec and slow bots
Old
  (#2)
bomberman
Guest
 
Status:
Posts: n/a
Default Re: msec and slow bots - 05-07-2004

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 ?
  
Reply With Quote
Re: msec and slow bots
Old
  (#3)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: msec and slow bots - 05-07-2004

yea that!
  
Reply With Quote
Re: msec and slow bots
Old
  (#4)
bomberman
Guest
 
Status:
Posts: n/a
Default Re: msec and slow bots - 05-07-2004

I did found that too , but I fix the problem , but there is another biiiig problem , after a mapchange , my bot move extremely slow !

Last edited by bomberman; 05-07-2004 at 09:52..
  
Reply With Quote
Re: msec and slow bots
Old
  (#5)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: msec and slow bots - 05-07-2004

PMB found out that you have to set all the msec variables to 0 in ServerActivate()
so that they get reset each map.
  
Reply With Quote
Re: msec and slow bots
Old
  (#6)
bomberman
Guest
 
Status:
Posts: n/a
Default Re: msec and slow bots - 05-07-2004

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
  
Reply With Quote
Re: msec and slow bots
Old
  (#7)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: msec and slow bots - 05-07-2004

yes that
  
Reply With Quote
Re: msec and slow bots
Old
  (#8)
bomberman
Guest
 
Status:
Posts: n/a
Default Re: msec and slow bots - 05-07-2004

Code:
pBot->msecdel = 0;
pBot->msecval = 0;
pBot->msecnum = 0;
Are something like this ?
  
Reply With Quote
Re: msec and slow bots
Old
  (#9)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: msec and slow bots - 05-07-2004

yea but why are your msec values different for each bot?
why not use the same ones for all bots?
  
Reply With Quote
Re: msec and slow bots
Old
  (#10)
bomberman
Guest
 
Status:
Posts: n/a
Default Re: msec and slow bots - 05-07-2004

you rock ! the problem fixed ! thanks very much !
  
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 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com