.:: 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
Re: Something about msecval
Old
  (#21)
strelok
Member
 
Status: Offline
Posts: 26
Join Date: Jan 2004
Default Re: Something about msecval - 26-01-2004

NO If mp_freezetime = 0.0 all is normal.
  
Reply With Quote
Re: Something about msecval
Old
  (#22)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Something about msecval - 26-01-2004

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



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Something about msecval
Old
  (#23)
strelok
Member
 
Status: Offline
Posts: 26
Join Date: Jan 2004
Default Re: Something about msecval - 29-01-2004

max speed DURING the freeze time: cs1.5 = 1, cs1.6 = 320, AFTER it: cs1.5 = 250, cs1.6 = 320
  
Reply With Quote
Re: Something about msecval
Old
  (#24)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Something about msecval - 29-01-2004

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.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Something about msecval
Old
  (#25)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: Something about msecval - 31-01-2004

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.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: Something about msecval
Old
  (#26)
KaCaT
Moderator
 
Status: Offline
Posts: 55
Join Date: Dec 2003
Default Re: Something about msecval - 31-01-2004

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


IvPBot - Improved version of Podbot

Last edited by KaCaT; 31-01-2004 at 18:55..
  
Reply With Quote
Re: Something about msecval
Old
  (#27)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Something about msecval - 01-02-2004

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


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Something about msecval
Old
  (#28)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Something about msecval - 02-02-2004

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

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.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Something about msecval
Old
  (#29)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: Something about msecval - 02-02-2004

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.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: Something about msecval
Old
  (#30)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Something about msecval - 02-02-2004

i don't get it either, but if pEdict->v.maxspeed works i have said nothing


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 4 (0 members and 4 guests)
 

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