.:: 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: *BUGBUGBUG* affects all HL bots!!!
Old
  (#11)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: *BUGBUGBUG* affects all HL bots!!! - 19-01-2004

yes, i think the guys at valve forgot to do the same for strafe speed as they did with the forward speed.

I think contacting them will be one of the sollutions, it will be of no real use to simulate this. The only advantage you will have that it will look a bit more 'normal' but most people don't even notice it. Secondly, when valve DOES fix it, you end up with worthless code. You can spend your time on more urgent matters

Perhaps Mike already fixed while we were talking


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: *BUGBUGBUG* affects all HL bots!!!
Old
  (#12)
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: *BUGBUGBUG* affects all HL bots!!! - 19-01-2004

The problem is that I need it quite badly for my BotWalkPath() function... because my bots *do* press the strafe keys almost all the time when wandering around, they don't just have their pEdict->v.angles face the destination waypoint and their pEdict->v.v_angle facing elsewhere, I forbidden that because it was not human-like ; instead the bots zigzag and strafe like humans when walking their path, but when it comes to tight paths the bots need to make slight corrections to their trajectory, and not completely jump out of the path (and eventually fall down the ledge they were walking) each time they try to strafe a bit. Having this fixed would help a lot.



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: *BUGBUGBUG* affects all HL bots!!!
Old
  (#13)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: *BUGBUGBUG* affects all HL bots!!! - 19-01-2004

Yeah I do that too PM.. I haven't paid much attention to the bots strafe speed though, I didn't notice much, I'll need to check it out sometime.
  
Reply With Quote
Re: *BUGBUGBUG* affects all HL bots!!!
Old
  (#14)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: *BUGBUGBUG* affects all HL bots!!! - 19-01-2004

As a quick and dirty fix, why not just set the bots maximum speed to a lower value just before each strafe operation?

// before strafe
pst_ptrEdict->v.maxspeed = <slower than normal>
// after strafe
pst_ptrEdict->v.maxspeed = <normal speed>


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: *BUGBUGBUG* affects all HL bots!!!
Old
  (#15)
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: *BUGBUGBUG* affects all HL bots!!! - 20-01-2004

The only quick and dirty fix I can think of would be to record the time at which the bot *started* strafing, and the current time, and compute the difference of both, and apply a filtering function to the maxspeed... which function we'd have to figure out ourselves, and which would obviously be not the same at all than the one players use. I'll try to do that (sampling player's strafe speed first to get an idea of the filtering function) and see what I can get.



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: *BUGBUGBUG* affects all HL bots!!!
Old
  (#16)
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: *BUGBUGBUG* affects all HL bots!!! - 20-01-2004

Now is it an optical illusion??? o_O

I duplicated a real player's controls (v.button and v.impulse) on a bot's ones, toggling the bot's move_speed and strafe_speed when necessary, and here's what a sampling of the bot's velocity gives when the bot starts strafing, at a 60Hz thinking cycle:
Quote:
(server HUD): velocity 0.000000
(server HUD): velocity 0.000000
(server HUD): velocity 0.000000
(server HUD): velocity 0.000000
(server HUD): velocity 0.000000
(server HUD): velocity 18.749999
(server HUD): velocity 32.999998
(server HUD): velocity 47.249999
(server HUD): velocity 61.499999
(server HUD): velocity 75.750000
(server HUD): velocity 89.954994
(server HUD): velocity 103.307688
(server HUD): velocity 115.859220
(server HUD): velocity 127.657664
(server HUD): velocity 138.748206
(server HUD): velocity 149.173314
(server HUD): velocity 158.972912
(server HUD): velocity 168.184533
(server HUD): velocity 176.843464
(server HUD): velocity 184.982857
(server HUD): velocity 192.633887
(server HUD): velocity 199.825856
(server HUD): velocity 206.586306
(server HUD): velocity 212.941129
(server HUD): velocity 218.914662
(server HUD): velocity 224.529787
(server HUD): velocity 229.807997
(server HUD): velocity 234.769519
(server HUD): velocity 239.433340
(server HUD): velocity 243.817334
(server HUD): velocity 247.938289
(server HUD): velocity 249.999997
(server HUD): velocity 249.999997
(server HUD): velocity 249.999997
(server HUD): velocity 249.999997
(server HUD): velocity 249.999997
Bug or not bug ???

What I find strange is that when I watched this bot while I was "controlling" it, it didn't seem to strafe abnormally... while I am CERTAIN that my bots strafe abnormally most of the time. WTF ??? o_O



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: *BUGBUGBUG* affects all HL bots!!!
Old
  (#17)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: *BUGBUGBUG* affects all HL bots!!! - 21-01-2004

Quote:
What I find strange is that when I watched this bot while I was "controlling" it, it didn't seem to strafe abnormally... while I am CERTAIN that my bots strafe abnormally most of the time. WTF ??? o_O
Reminds me of the observer effect ...

The bot world cannot be perceived directly, but rather through the use of instruments. And, so, there is a problem with the fact that the act of measuring disturbs the behavior and movement of bots. This is called the measurement problem.

- adapted from a book on quantum physics


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: *BUGBUGBUG* affects all HL bots!!!
Old
  (#18)
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: *BUGBUGBUG* affects all HL bots!!! - 21-01-2004

LOL "the Principle of Uncertainty applied to CS bots"

anyway...

I HAVE FOUND THE PROBLEM!!!!!

My bots strafe almost exactly like humans now.

In fact this problem seems to appear only when a bot zigzags, not when it starts strafing for the first time. When their strafe speed has raised to its maximum, if the bots suddently change their strafe direction, the strafe speed is not decreased to zero then increased again. And actually this is somewhat normal: humans can't press the other strafe key that fast, there is at least 0.2 second between the instant where the first strafe key is released and the second one is pressed, because usually the forward/backwards keys and the strafe left/strafe right keys are opposite altogether relatively to your fingers on the keyboard. My fix only constituted in adding a check for the last strafe time in the function that makes the bots press the movement keys. Not only it fixes things, but it makes the bot's movement look REALLY realistic!! 8D
Code:
void BotMove (player_t *pPlayer)
{
   // the purpose of this function is to translate the data of the BotMove structure (timings
   // at which the bot has to perform some movement - jump in 2 seconds, move forward for 5
   // seconds, and so on) into the right input buttons to be passed to RunPlayerMove(), which is
   // the function that asks the engine to perform the movement of the fakeclient. It also sets
   // the correct values for move_speed and strafe_speed which are parameters of RunPlayerMove().
 
   TraceResult tr;
 
   if (DebugLevel.legs_disabled)
	  return; // return if we don't want the AI to move
 
   if (pPlayer->Bot.is_controlled)
	  return; // if bot is bewitched, it doesn't "steer itself"
 
   // is the bot paused ?
   if (pPlayer->Bot.f_pause_time > server.time)
   {
	  pPlayer->Bot.BotMove.f_move_speed = 0;
	  pPlayer->Bot.BotMove.f_strafe_speed = 0;
 
	  if (pPlayer->Bot.BotMove.f_duck_time > server.time)
	  {
		 pPlayer->pEntity->v.button |= IN_DUCK; // maintain duck button when needed
		 pPlayer->Bot.BotMove.f_duck_time = server.time + 0.2; // keep ducking
	  }
 
	  return; // don't move the bot if it should be paused
   }
 
   // may the bot jump now ?
   if ((pPlayer->Bot.BotMove.f_jump_time < server.time)
	   && (pPlayer->Bot.BotMove.f_jump_time + 0.1 > server.time))
	  pPlayer->pEntity->v.button |= IN_JUMP; // jump
 
   // has the bot just jumped AND is bot skilled enough ?
   if ((pPlayer->Bot.BotMove.f_jump_time + 0.1 < server.time)
	   && (pPlayer->Bot.BotMove.f_jump_time + 0.2 > server.time)
	   && (pPlayer->Bot.pProfile->skill > 1))
	  pPlayer->Bot.BotMove.f_duck_time = server.time + 0.2; // duck while jumping
 
   // may the bot duck now ?
   if (pPlayer->Bot.BotMove.f_duck_time > server.time)
	  pPlayer->pEntity->v.button |= IN_DUCK; // duck
 
   // may the bot safely strafe left now ?
   if ((pPlayer->Bot.BotMove.f_strafeleft_time > server.time)
	   && (pPlayer->Bot.BotMove.f_straferight_time + 0.2 < server.time)
	   && !(pPlayer->Bot.BotBody.hit_state & OBSTACLE_LEFT_FALL))
   {
	  pPlayer->pEntity->v.button |= IN_MOVELEFT;
	  pPlayer->Bot.BotMove.f_strafe_speed = -pPlayer->Bot.BotMove.f_max_speed; // strafe left
   }
 
   // else may the bot safely strafe right now ?
   else if ((pPlayer->Bot.BotMove.f_straferight_time > server.time)
			&& (pPlayer->Bot.BotMove.f_strafeleft_time + 0.2 < server.time)
			&& !(pPlayer->Bot.BotBody.hit_state & OBSTACLE_RIGHT_FALL))
   {
	  pPlayer->pEntity->v.button |= IN_MOVERIGHT;
	  pPlayer->Bot.BotMove.f_strafe_speed = pPlayer->Bot.BotMove.f_max_speed; // strafe right
   }
 
   // may the bot move backwards now ?
   if (((pPlayer->Bot.BotMove.f_backwards_time > server.time)
		&& (pPlayer->Bot.BotMove.f_forward_time + 0.2 < server.time))
	   || (pPlayer->Bot.BotMove.b_emergency_walkback))
   {
	  pPlayer->pEntity->v.button |= IN_BACK;
	  pPlayer->Bot.BotMove.f_move_speed = -pPlayer->Bot.BotMove.f_max_speed; // move backwards
   }
 
   // else may the bot move forward now ?
   else if ((pPlayer->Bot.BotMove.f_forward_time > server.time)
			&& (pPlayer->Bot.BotMove.f_backwards_time + 0.2 < server.time))
   {
	  pPlayer->pEntity->v.button |= IN_FORWARD;
	  pPlayer->Bot.BotMove.f_move_speed = pPlayer->Bot.BotMove.f_max_speed; // run forward
   }
 
   // may the bot walk now ?
   if (pPlayer->Bot.BotMove.f_walk_time > server.time)
   {
	  pPlayer->pEntity->v.button |= IN_RUN;
	  pPlayer->Bot.BotMove.f_move_speed /= 2; // forward walk
	  pPlayer->Bot.BotMove.f_strafe_speed /= 2; // side walk
   }
 
   return;
}



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 21-01-2004 at 11:26..
  
Reply With Quote
Re: *BUGBUGBUG* affects all HL bots!!!
Old
  (#19)
dilinator
Guest
 
Status:
Posts: n/a
Default Re: *BUGBUGBUG* affects all HL bots!!! - 06-04-2004

what file should we addd this to?
  
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