View Single Post
Re: Bot running speed
Old
  (#4)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: Bot running speed - 01-08-2015

Okay, how are you calculating the msec value for the RunPlayerMove function?

EDIT:
I checked out the HPB_bot msec value calculation and it seems wrong. Use the following value as the last argument of the RunPlayerMove() function:
Code:
gpGlobals->frametime * 1000.0f
Do not store it's value in a variable or if you do, make sure you update the value each time before you pass it to RunPlayerMove().

EDIT 2: Or just leave it as currently and fix it's calculation. This code is wrong:
Code:
// adjust the millisecond delay based on the frame rate interval...
      if (msecdel <= gpGlobals->time)
      {
         msecdel = gpGlobals->time + 0.5;
         if (msecnum > 0)
            msecval = 450.0/msecnum;
         msecnum = 0;
      }
      else
         msecnum++;

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

      if (msecval > 100)  // ...or greater than 100
         msecval = 100;
It should become
Code:
// adjust the millisecond delay based on the frame rate interval...
      if (msecdel <= gpGlobals->time)
      {
         msecdel = gpGlobals->time + 0.5;
         if (msecnum > 0)
            msecval = 450.0/msecnum;
         msecnum = 0;
      }
      else
         msecnum++;

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

      if (msecval > 255)  // ...or greater than 255
         msecval = 255;
First try the second option that I posted. If does not work try the first one.

Last edited by The Storm; 03-08-2015 at 00:37..
  
Reply With Quote