International Journal of Computer Games Technology / 2015 / Article / Alg 15

Research Article

Artificial Intelligence in Video Games: Towards a Unified Framework

Algorithm 15

Modified target selection in Graven. Health is compared instead of distance.
void  CptTargetingSystem::Update()
int  LowestHPSoFar = MaxInt;
m_pCurrentTarget = 0;
 //grab a list of all the opponents the owner can sense
std::list<CptMvAgent2D>  SensedBots;
SensedBots = m_pOwner->GetSensoryMem()->GetListOfRecentlySensedOpponents();
std::list<CptMvAgent2D>::const_iterator curBot = SensedBots.begin();
for  (curBot; curBot != SensedBots.end(); ++curBot)
  //make sure the bot is alive and that it is not the owner
  if  ((curBot)->isAlive() && (curBot != m_pOwner->GetAgent()))
   int  hp = (curBot)->Health();
   if  (hp < LowestHPSoFar)
LowestHPSoFar = hp;
m_pCurrentTarget =  curBot;

We are committed to sharing findings related to COVID-19 as quickly as possible. We will be providing unlimited waivers of publication charges for accepted research articles as well as case reports and case series related to COVID-19. Review articles are excluded from this waiver policy. Sign up here as a reviewer to help fast-track new submissions.