.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   The RealBot 'Source' (http://forums.bots-united.com/forumdisplay.php?f=52)
-   -   Making Realbot suck at shooting for once (http://forums.bots-united.com/showthread.php?t=2014)

yangmungi 20-06-2004 00:46

Making Realbot suck at shooting for once
 
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]

dstruct2k 20-06-2004 08:48

Re: Making Realbot suck at shooting for once
 
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.

stefanhendriks 20-06-2004 11:34

Re: Making Realbot suck at shooting for once
 
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
}


stefanhendriks 20-06-2004 11:36

Re: Making Realbot suck at shooting for once
 
I bet you can change the if bot_skill < lines, because i noticed SKILL > 1 is even better then SKILL < 1 :D

dstruct2k 20-06-2004 18:50

Re: Making Realbot suck at shooting for once
 
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.

V or 'Tex 20-06-2004 22:46

Re: Making Realbot suck at shooting for once
 
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.

frashman 20-06-2004 22:57

Re: Making Realbot suck at shooting for once
 
yes so it should be correct

yangmungi 23-06-2004 15:04

Re: Making Realbot suck at shooting for once
 
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

stefanhendriks 23-06-2004 16:04

Re: Making Realbot suck at shooting for once
 
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...

V or 'Tex 24-06-2004 00:01

Re: Making Realbot suck at shooting for once
 
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.

dstruct2k 24-06-2004 01:38

Re: Making Realbot suck at shooting for once
 
Quote:

Originally Posted by V or 'Tex
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.

Hence the setting in POD that turns superhuman turning on or off...

V or 'Tex 24-06-2004 01:53

Re: Making Realbot suck at shooting for once
 
This is podbot? Wow.


Just make it so that the bots have two attributes for reaction... Sensitivity and Reaction Time. Sensitivity will prevent the bots from instantly snap to a target unless its above ~30 and Reaction Time will prevent them from acquiring a target until a random number between two times. .03 and .1 are typical of humans, from what I can tell.

dstruct2k 24-06-2004 03:19

Re: Making Realbot suck at shooting for once
 
... You really don't understand, do you? I mean, that's why they put the setting in POD to turn superhuman aiming on or off, and probably exactly what we should do.

You don't want lock-on crosshairs, sorry about that.


Plus, reaction times for humans are between 0.08 and 0.20 seconds for thinking and reacting, just make the bot wait a random number between that (or higher, like 0.50, for lower skilled bots) before adjusting their aim, to compensate for their near-zero reaction time.

yangmungi 24-06-2004 03:41

Re: Making Realbot suck at shooting for once
 
well lets just say you feel like kicking some ass one day and you turn on the bots because you can kick their asses all day. BUT they have like .08 reaction time and by the time you see one pixel of their bodies you're dead. "OMG" "H4X0Rz" "G4Y"; it would be nice if the INI files actually affected the settings... still looking into that.
Also in the morning, my reaction time is somewhere around from 1 second to 3 seconds (really);
One more thing is that I play with a tactical AMX mod where it is one shot one kill. The ONLY way to kill the bots first is with the HE Grenade... Even when they're flashed they own.
One comment that I will probably not fix is windows. Bot cannot see through windows (But I can baby!) [ more technical terms, they cannot see through func_walls, but they have vision through func_illusionary ]
It would be really cool if I can get 10 Sucky Terrorist bots vs 3 Really Godlike CT bots to have an even match (Ever played Rainbow Six 3: Raven Shield's Lone Wolf? [the demo at least] )

[edit] perhaps the computer has something to do with bot skill?
STATS: (Srry about the approx. I'm Away from MY computer)
2600~ MHz Intel Pentium
512~ MB RAM, approx. 1GB Virtual Memory
64MB Intel "EXTREME" GFX Card (Most HL Mods run at 30fps tops)
2 HDs, C: 80 GB 95~% free; E: 160GB 85~% free;
Windows XP Home Edition
[/edit]

V or 'Tex 24-06-2004 04:36

Re: Making Realbot suck at shooting for once
 
I say .03 because usually when you encounter somebody you dont even think you simply hit the trigger, it happens often on dust when you are -waiting- for somebody to pop out of tunnel and theres little thinking. You see, you shoot.


Yangmungi, calm down.

Turn down the bot personality settings if they kill you.

The bots WILL NOT shoot at you if they see one pixel of you, they usually require at least a view of your head and chest, but if they know where you are they seem to have no problem shooting through walls if they can see your legs, arms.



YOU might not be able to kill them with that reaction time, but other people can. So are you saying we should intentionally inhibit and create a 'minimum' reaction and sensitivity just because you don't edit your personality settings?!

Although, I should cut you some slack, for the last few WIPs RealBot has not read the inis properly. For example, I tested 50 to 60 second reaction time, and it only applies on the first encounter with an enemy, and is ignored every time thereafter.

dstruct2k 24-06-2004 04:45

Re: Making Realbot suck at shooting for once
 
What we need is for someone to spend a day or two reading the code and trying to understand it... Anything that doesn't make sense should be posted to a thread (1 thread for all proofreading) where we can post fixes. :)

yangmungi 24-06-2004 06:33

Re: Making Realbot suck at shooting for once
 
ok thnx V (or Tex) it was the inis that were pissing me off :)
I DEFINITELY think that there should NOT be a minimum setting.

I cant get the code cuz im in another country right now (And the bitch i am i like IDEs)

stefanhendriks 24-06-2004 07:31

Re: Making Realbot suck at shooting for once
 
Quote:

Originally Posted by V or 'Tex
I say .03 because usually when you encounter somebody you dont even think you simply hit the trigger, it happens often on dust when you are -waiting- for somebody to pop out of tunnel and theres little thinking. You see, you shoot.


Yangmungi, calm down.

Turn down the bot personality settings if they kill you.

The bots WILL NOT shoot at you if they see one pixel of you, they usually require at least a view of your head and chest, but if they know where you are they seem to have no problem shooting through walls if they can see your legs, arms.



YOU might not be able to kill them with that reaction time, but other people can. So are you saying we should intentionally inhibit and create a 'minimum' reaction and sensitivity just because you don't edit your personality settings?!

Although, I should cut you some slack, for the last few WIPs RealBot has not read the inis properly. For example, I tested 50 to 60 second reaction time, and it only applies on the first encounter with an enemy, and is ignored every time thereafter.

Interesting! You do know there is a difference between those? But i seem have to forgotten to apply that low'reaction thiny there.

V or 'Tex 24-06-2004 07:33

Re: Making Realbot suck at shooting for once
 
Is that sarcasm?

Hm, but, the reaction time has only applied once I've seen. Maybe twice. Every time I create a new game with my bots which all have 50-60 second reaction, they don't shoot. Sometimes one will shoot, and kill maybe one bot.

After the first round, they go back to normal superhumanness (which I prefer, even if it means that a bot across the map can do a 180 and nail me in the head with a glock and kill me.)

stefanhendriks 24-06-2004 13:51

Re: Making Realbot suck at shooting for once
 
no, there was no sarcasm here. I actually do differ these 2. Because when you are 'expecting' someone to come around a corner, you also estimate when to fire .. so your reaction time is faster in that time.

I forgot to include this reaction time field with the '2nd reactiontime' code, i think it should have some influence there too.. although not too much.

V or 'Tex 24-06-2004 22:25

Re: Making Realbot suck at shooting for once
 
Ah, so that's why my bots are always tards on my first round. When I was testing reaction time I had it at 50-60 sec, and it made the first round very easy.

stefanhendriks 25-06-2004 09:11

Re: Making Realbot suck at shooting for once
 
exactly. I will fix it.


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

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