.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Something about msecval (http://forums.bots-united.com/showthread.php?t=344)

strelok 26-01-2004 14:24

Re: Something about msecval
 
NO:) If mp_freezetime = 0.0 all is normal.

Pierre-Marie Baty 26-01-2004 16:12

Re: Something about msecval
 
Check what is the bot's max speed DURING the freeze time and AFTER it... that might be the problem, somehow.

strelok 29-01-2004 10:20

Re: Something about msecval
 
max speed DURING the freeze time: cs1.5 = 1, cs1.6 = 320, AFTER it: cs1.5 = 250, cs1.6 = 320

Pierre-Marie Baty 29-01-2004 15:01

Re: Something about msecval
 
Okay guys, we have an issue here. 320 is NOT a valid client speed in Counter-Strike. In Half-Life, it is.

Counter-Strike 1.6 does NOT send their max speeds to clients anymore. It's useless for us to hook pfnSetClientMaxSpeed() anymore. We have to fix the bot's max speed OURSELVES.

I suggest having a look in eLiTe's TeamBot code. It's REALLY old stuff, but there is interesting stuff. Because that's how the early bots were setting their max speeds before the pfnSetClientMaxSpeed() was discovered.
Code:

// This function is redundant, but the switch statement could be useful in future...
void SetSpeed (bot_t *pBot)
{
  // This changes the bot's maximum speed depending on the weapon it is
  // currently using
 
  switch (pBot->current_weapon.iId)
  {
          case CS_WEAPON_P228:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_SCOUT:
                pBot->f_max_speed = 260;
                break;
          case CS_WEAPON_HEGRENADE:
                pBot->f_max_speed = 260;
                break;
          case CS_WEAPON_XM1014:
                pBot->f_max_speed = 240;
                break;
          case CS_WEAPON_C4:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_MAC10:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_AUG:
                pBot->f_max_speed = 240;
                break;
          case CS_WEAPON_SMOKEGRENADE:
                pBot->f_max_speed = 260;
                break;
          case CS_WEAPON_ELITE:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_USP:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_GLOCK18:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_AWP:
                pBot->f_max_speed = 210;
                break;
          case CS_WEAPON_MP5NAVY:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_M249:
                pBot->f_max_speed = 220;
                break;
          case CS_WEAPON_M3:
                pBot->f_max_speed = 230;
                break;
          case CS_WEAPON_M4A1:
                pBot->f_max_speed = 230;
                break;
          case CS_WEAPON_TMP:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_G3SG1:
                pBot->f_max_speed = 200;
                break;
          case CS_WEAPON_FLASHBANG:
                pBot->f_max_speed = 260;
                break;
          case CS_WEAPON_DEAGLE:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_SG552:
                pBot->f_max_speed = 235;
                break;
          case CS_WEAPON_AK47:
                pBot->f_max_speed = 221;
                break;
          case CS_WEAPON_KNIFE:
                pBot->f_max_speed = 260;
                break;
          case CS_WEAPON_P90:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_UMP45:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_FIVESEVEN:
                pBot->f_max_speed = 250;
                break;
          case CS_WEAPON_SG550:
                pBot->f_max_speed = 210;
                break;
  }
}

We have to apply this each time a bot changes weapons. Eventually it would be good to check if these old values are still correct after 2 or 3 Counter-Strike updates. It's now the only way to fix the bot's "speed hack" bugs.

botmeister 31-01-2004 07:26

Re: Something about msecval
 
Quote:

Originally Posted by Pierre-Marie Baty
We have to apply this each time a bot changes weapons. Eventually it would be good to check if these old values are still correct after 2 or 3 Counter-Strike updates. It's now the only way to fix the bot's "speed hack" bugs.

I knew something was going wrong. I had problems with the msec system, and the hook onto pfnSetClientMaxSpeed() seemed to correct the speed hack problem but I've noticed that the bots were still running around too fast. Also, I tried using sv_maxspeed but the cvar is not always initialized correctly. There's lots of bugs in CS 1.6 surrounding the speeds and my bet is that they broke the thing trying to hammer in the shield.

KaCaT 31-01-2004 17:48

Re: Something about msecval
 
I use pfnSetClientMaxSpeed() for my bot in CS 1.5 and pev->maxspeed in CS 1.6. They are working well for me :)

stefanhendriks 31-01-2004 23:06

Re: Something about msecval
 
I just get freaking nuts of CS 1.6 guys! Or should i say, get sick of this STEAM? Argh.

Pierre-Marie Baty 02-02-2004 19:28

Re: Something about msecval
 
Quote:

Originally Posted by KaCaT
I use pfnSetClientMaxSpeed() for my bot in CS 1.5 and pev->maxspeed in CS 1.6. They are working well for me :)

pEdict->v.maxspeed ? Hey, great ! How come we didn't think of it earlier ? wow, gotta credit KaCaT in my code now :D

Quote:

Originally Posted by botmeister
I knew something was going wrong. [...] There's lots of bugs in CS 1.6 surrounding the speeds and my bet is that they broke the thing trying to hammer in the shield.

No, actually I believe they did it on purpose to lower the network traffic. If you think about it it's completely stupid to send their max speeds to the clients over the network since the clients already know it (they're running the same game DLL, don't they ?) And since some players have the bad habit to switch weapons like crazy, I think it's wise they did so.
There are still a lot of things that could be removed from the network code. The CS netcode isn't one of the most clever ones around. Maybe TurtleRocker could tell us more about it.

botmeister 02-02-2004 20:06

Re: Something about msecval
 
OK, I agree PMB, it is good idea to optimize the netcode and they probably did remove it on purpose. However I still don't understand why sv_maxspeed was being initialized incorrectly.

stefanhendriks 02-02-2004 20:25

Re: Something about msecval
 
i don't get it either, but if pEdict->v.maxspeed works i have said nothing ;)


All times are GMT +2. The time now is 06:56.

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