.:: 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 > RealBot > The RealBot 'Source'
The RealBot 'Source' Discuss things about the source code. You can here point out bugs, share ideas and code. Assign to become an 'official team member' and so on!

Reply
 
Thread Tools
Making Realbot suck at shooting for once
Old
  (#1)
yangmungi
Guest
 
Status:
Posts: n/a
Default Making Realbot suck at shooting for once - 20-06-2004

i saw the code and im looking into why the personality values dont seem to affect the bots... Anyone else come up with something? Every one of my friends called the bots hackers so yeah.

[edit] the ini_parser seems fine, im learning about class pointers but i have a general idea. what about Random_float? [/edit]

Last edited by yangmungi; 20-06-2004 at 00:48..
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#2)
dstruct2k
 
dstruct2k's Avatar
 
Status: Offline
Posts: 225
Join Date: Feb 2004
Default Re: Making Realbot suck at shooting for once - 20-06-2004

Well, I installed PODBot for testing, and POD's have a setting to disable "inhuman turning" aka Realbot's turn-on-a-dime.

I'll look into porting this, but it might be something Stefan will have to look at.
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#3)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Making Realbot suck at shooting for once - 20-06-2004

Let me help you a bit:

in bot.cpp, there is the cBot class written. In the function cBot::Aim() the bot aims at a vector given as argument in that function. Now, we look where Aim() is called...

hence! it is called in the function below, called AimAtEnemy()

at the bottom of AimAtEnemy you see Aim() being called. The function AimAtEnemy looks like this:

Code:
/******************************************************************************
 Function purpose: Aims at enemy, only when valid. Based upon skill how it 'aims'
 ******************************************************************************/
void cBot::AimAtEnemy ()
{
  // No (valid) enem pointer? -> bail out
  if (pBotEnemy == NULL)
	return;
  Vector vVecEnd = pBotEnemy->v.origin + pBotEnemy->v.view_ofs;
  // We cannot see our enemy? -> bail out
  if ((f_blinded_time > gpGlobals->time) ||
	  (!(FInViewCone (&vVecEnd, pEdict) && FVisible (vVecEnd, pEdict))))
  {
   Aim(v_enemy);
   return;
  }
  // ------------------------ we can see enemy -------------------------
  Vector vTarget;
  float fDistance;
  float fScale = 0.0;
  // Distance to enemy
  fDistance = (pBotEnemy->v.origin - pEdict->v.origin).Length ();
  // Scale this
  fScale = fDistance / 2500;
  if (fScale > 0.9)
	fScale = 0.9;
  // Super skill requires little differentation
  if (bot_skill == 0)
	fScale = 0.05;
  if (CarryWeaponType () == SNIPER)
	fScale = 0.01;
  
  // Set target here
  vTarget = pBotEnemy->v.origin;
  
  if (bot_skill <= 1)
	vTarget = pBotEnemy->v.origin + pBotEnemy->v.view_ofs + Vector (0, 0, -16);
  else if (bot_skill > 1 && bot_skill < 4)
	vTarget = pBotEnemy->v.origin + pBotEnemy->v.view_ofs * RANDOM_FLOAT (0.5, 1.1);
  else if (bot_skill > 3 && bot_skill < 5)
   vTarget = pBotEnemy->v.origin;
  else if (bot_skill > 4)
   vTarget = pBotEnemy->v.origin + Vector (0, 0, -32);
  // Based uppon how far, we make this fuzzy
  float fDx, fDy, fDz;
  fDx = fDy = fDz = 0.0;
  // Equals SKILL
  fDx = fDy = fDz = (bot_skill * fScale);
  vTarget = vTarget + Vector (RANDOM_FLOAT (-fDx, fDx), RANDOM_FLOAT (-fDy, fDy), RANDOM_FLOAT (-fDz, fDz));
  // Add Offset
  fDx = fpXOffset;
  fDy = fpYOffset;
  fDz = fpZOffset;
  // Set extra offset
  vTarget = vTarget + Vector (RANDOM_FLOAT (-fDx, fDx), RANDOM_FLOAT (-fDy, fDy), RANDOM_FLOAT (-fDz, fDz));
  // When holding a grenade, do this aiming.
  if (current_weapon.iId == CS_WEAPON_HEGRENADE
	  || current_weapon.iId == CS_WEAPON_FLASHBANG)
  {
	  vTarget = vTarget + Vector (0, 0, 50);
  }
 
  Aim (vTarget);  // Aim
}


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#4)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Making Realbot suck at shooting for once - 20-06-2004

I bet you can change the if bot_skill < lines, because i noticed SKILL > 1 is even better then SKILL < 1


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#5)
dstruct2k
 
dstruct2k's Avatar
 
Status: Offline
Posts: 225
Join Date: Feb 2004
Default Re: Making Realbot suck at shooting for once - 20-06-2004

English translation:

If bot skill is from 0 to 1, target enemy in head.

If bot skill is from 1.1 to 3.9, target enemy with a randomized offset.

If bot skill is from 3.1 to 4.9, target enemy's location without correcting for movement.

If bot skill is 4.1 or worse, aim way above head without correcting for movement.



Those numbers are wrong. I would put it like this:
Code:
if (bot_skill <= 1)
vTarget = pBotEnemy->v.origin + pBotEnemy->v.view_ofs + Vector (0, 0, -16);
else if (bot_skill > 1 && bot_skill <= 4)
vTarget = pBotEnemy->v.origin + pBotEnemy->v.view_ofs * RANDOM_FLOAT (0.5, 1.1);
else if (bot_skill > 4 && bot_skill <= 6)
vTarget = pBotEnemy->v.origin;
else if (bot_skill > 6)
vTarget = pBotEnemy->v.origin + Vector (0, 0, -32);
Now you've got all numbers covered, none double-covered, and it should seem more realistic.

I can't figure out the code that actually does the turning of the bot, they seem to turn at the speed of light as if their sensitivity was at 200 or something extreme.
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#6)
V or 'Tex
Member
 
Status: Offline
Posts: 121
Join Date: Feb 2004
Default Re: Making Realbot suck at shooting for once - 20-06-2004

Funny thing, I run all my bots on skill 1 because otherwise they rarely present a challenge, but this time I chose to have a 'team' on my side.


When I died, I spec'd the guy that killed me and he was simultaneously shooting at 3 people using speed-of-light turning. He'd snap of two shots at one guy, and his screen would flicker to another, and then another. It was insane.
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#7)
frashman
Member
 
Status: Offline
Posts: 36
Join Date: Jun 2004
Location: Germany
Default Re: Making Realbot suck at shooting for once - 20-06-2004

yes so it should be correct
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#8)
yangmungi
Guest
 
Status:
Posts: n/a
Default Re: Making Realbot suck at shooting for once - 23-06-2004

2 Questions
1. Whats the constant of 2500?
2. Does AimAtEnemy() modify where the bot is facing or where the bullets will go?

Note: i noticed the bots don't share the same recoil as our human buddies
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#9)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Making Realbot suck at shooting for once - 23-06-2004

1. the constant is a distance, (ie the further away, the more 'fuzz'). I have upped this to 4096 in the new source
2. the AImAtEnemy() function modifies their 'gun' position.

And to you rnote:
the CS DLL makes bots have the same effect in recoil as humans...


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Making Realbot suck at shooting for once
Old
  (#10)
V or 'Tex
Member
 
Status: Offline
Posts: 121
Join Date: Feb 2004
Default Re: Making Realbot suck at shooting for once - 24-06-2004

Aye, I think the bots should keep their superhuman turning because at skill 0 it is still easy for me to be 5-1 against them in a 6 vs 6 match.
  
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