.:: 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 > YaPB
YaPB Yet another POD-Bot flavor by Whistler and Jeefo Counter-Strike

Reply
 
Thread Tools
shield issues...
Old
  (#1)
szfzafa
Member
 
Status: Offline
Posts: 24
Join Date: Apr 2010
Location: Nanjing, PRC
Arrow shield issues... - 15-05-2010

When bots are focusing an enemy with shield & facing them,
in 2.5x:
they aim & keep shooting! regardless of shield is up/down.
in 2.0.0.864:
they just keep aimming him.

this code was written at the end of CBot::FocusEnemy (2.0.0.864)
Code:
   // don't shoot to enemy if enemy with & facing us, we can't hurt it
   if (IsEnemyProtectedByShield ())
      m_bWantsToFire = false;
it only forbid bots firing at him

Problem:
if other enemies come in bots' sight, they still keep aimming(and shooting) that enemy with shield protected, then stupidly get killed.

I think when bots are focusing an enemy with shield & facing them,
they should engage other enemies(if exists in sight)
or try to complete the mapgoal task
(just image what if a human with shield up running ahead in a new round to catch enemy bots' attention, they just keep aimming and wait to be killed, never to say the mapgoal - bots' stand no chance to win!!)

in 2.51 src I noticed this in Bot::LookupEnemy
Quote:
// the old enemy is no longer visible or
if (FNullEnt (newEnemy))
{
m_enemyUpdateTime = GetWorldTime () + 0.25;
// some shield stuff
Array <edict_t *> enemies;
// search the world for players...
for (i = 0; i < GetMaxClients (); i++)
{
if (!(g_clients[i].flags & ClientFlag_Used) || !(g_clients[i].flags & ClientFlag_Alive) || (g_clients[i].team == team) || (g_clients[i].ent == GetEntity ()))
continue;
player = g_clients[i].ent;
// let the engine check if this player is potentially visible
if (!ENGINE_CHECK_VISIBILITY (player, pvs))
continue;
// skip glowed players, in free for all mode, we can't hit them
if (player->v.renderfx == kRenderFxGlowShell && g_botVar[Variable_Deathmatch]->GetBool ())
continue;
// do some blind by smoke grenade
if (IsBehindSmokeClouds (player) && m_blindRecognizeTime < GetWorldTime ())
m_blindRecognizeTime = GetWorldTime () + g_randGen.Float (2.0, 3.0);
if (player->v.button & (IN_ATTACK | IN_ATTACK2))
m_blindRecognizeTime = GetWorldTime () - 0.1;
// see if bot can see the player...
if (m_blindRecognizeTime < GetWorldTime () && IsEnemyViewable (player))
{
float distance = (player->v.origin - pev->origin).GetLength ();
if (distance < nearestDistance)
{
enemies.Push (player);
if (IsEnemyProtectedByShield (player))
continue;
nearestDistance = distance;
newEnemy = player;
// aim VIP first on AS maps...
if ((g_mapType & MapType_As) && *(INFOKEY_VALUE (GET_INFOKEYBUFFER (player), "model")) == 'v')
break;
}
}
}
// if we got no enemies with no shield, and got enemies with target them
if (enemies.GetElementNumber () != 0 && !IsValidPlayer (newEnemy))
newEnemy = enemies[0];
}
but seems not working...

Bot::
Think
BotAI
SetConditions
LookupEnemy
ChooseAimDirection
FocusEnemy

is LookupEnemy the problem?
and how to correct this??
thx

Last edited by szfzafa; 15-05-2010 at 10:22..
  
Reply With Quote
Re: shield issues...
Old
  (#2)
szfzafa
Member
 
Status: Offline
Posts: 24
Join Date: Apr 2010
Location: Nanjing, PRC
Default Re: shield issues... - 15-05-2010

2.51 src(last modified by ProRaiL)
http://forums.bots-united.com/showpo...2&postcount=82
  
Reply With Quote
Re: shield issues...
Old
  (#3)
szfzafa
Member
 
Status: Offline
Posts: 24
Join Date: Apr 2010
Location: Nanjing, PRC
Default Re: shield issues... - 15-05-2010

i wrote this at the end of FocusEnemy
Quote:
// don't shoot to enemy if enemy with shield & facing us, we can't hurt it
if (IsEnemyProtectedByShield (m_enemy))
{
m_wantsToFire = false;
m_enemy = NULL;
}
i works...partly, through sometimes...

i tested this with a zbot as a teammate(bot_zombie 1) following me, and i'm using shield facing a YaPB enemy. When the YaPB caught sight of my teammate zbot it would usually kill him. But there are times when the YaPB just aim the zbot without shooting, the moment i ran away/turned off shield, the YaPB killed zbot just then, i showed up before that, and YaPB keep shooting at me!
--it seems the YaPB's m_wantsToFire property was applied to wrong enemies!
lol
  
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