.:: 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 ::. > Cyborg Factory > POD-Bot mm > Releases, Installers, Docs & Coding
Releases, Installers, Docs & Coding Where the official development happens

Reply
 
Thread Tools
FPS dependent code
Old
  (#1)
Serious Sam
Member
 
Serious Sam's Avatar
 
Status: Offline
Posts: 33
Join Date: Sep 2009
Location: Bulgaria
Question FPS dependent code - 30-10-2009

Hello,
I have started coding my own bot in my free time not very long ago, its based on the sources of yapb 1, still only minor modifications, and what I noticed is that if I use this bot in a dedicated server and try to increase the server FPS with the sys_ticrate command, bots start to behave strange. I Tried a few other bots to see if these are the only ones with this problem, and I noticed problems in all other bots I tested, and the new beta of PODBot MM was the first one that was working properly at higher server FPS. So, if it's possible, could you point me to the part in the code of podbot mm that makes this, and allow me to copy it into my bot? I'm not very good at reading sources and creating new code, so I cant find it myself and I cant code it on my own.
  
Reply With Quote
Re: FPS dependent code
Old
  (#2)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: FPS dependent code - 30-10-2009

In bot.cpp in BotSpawnInit function:
PHP Code:
   pBot->fTimePrevThink gpGlobals->time;
   
pBot->fTimePrevThink2 gpGlobals->time;
   
pBot->fTimeFrameInterval 0.0;

   
pBot->i_msecval 0;                // KWo - 17.03.2007
   
pBot->f_msecvalrest 0.0;          // KWo - 17.03.2007 
And the clue is somewhere at the end of the function BotThink in bot.cpp (almost at bottom of that file):
PHP Code:
// this is Leon Hartwig's method for computing the msec value
   
f_msecval = (gpGlobals->time pBot->fTimePrevThink2) * 1000.0;
   
pBot->fTimePrevThink2 gpGlobals->time;

   
i_msecvalrest 0;                         // KWo - 17.03.2007
   
i_msecval = (int) (f_msecval);             // KWo - 17.03.2007
   
if (i_msecval 10)                        // KWo - 17.03.2007
   
{
      
f_msecval f_msecval - (float)(i_msecval) + pBot->f_msecvalrest;
      
i_msecvalrest = (int)(f_msecval);
      
pBot->f_msecvalrest f_msecval - (float)(i_msecvalrest);
   }
   
i_msecval i_msecval i_msecvalrest;

   if (
i_msecval 1)
      
i_msecval 1// don't allow the msec delay to be null
   
else if (i_msecval 100)
      
i_msecval 100// don't allow it to last longer than 100 milliseconds either

   
g_engfuncs.pfnRunPlayerMove (pEdictvecMoveAnglespBot->f_move_speedpBot->f_sidemove_speed0pEdict->v.button0, (unsigned chari_msecval);    // KWo - 25.09.2006 - thanks to THE_STORM 
  
Reply With Quote
Re: FPS dependent code
Old
  (#3)
Serious Sam
Member
 
Serious Sam's Avatar
 
Status: Offline
Posts: 33
Join Date: Sep 2009
Location: Bulgaria
Default Re: FPS dependent code - 31-10-2009

thanks a lot
  
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