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

Research Article

Artificial Intelligence in Video Games: Towards a Unified Framework

Algorithm 4

Tanking capacity estimation. This function could be used to evaluate how fit of a tank a unit or character is.
double  score_tanking(Unit  u, UnitList & grp, UnitList & enemies)
{
 //Set the base score to the current unit hit points
double  score = u->hitpts();
 //Get primary damage type of enemy
DamageType dt = get_primary_dtype(enemies);
 //Get current damage reduction of the unit
double  dr = u->dmgred(dt);
 //Factor in average reduction bonus from ally abilities
dr += dmgred_abilities(u, grp, dt);
//Factor in average amplification bonus from enemy abilities
dr −= dmgamp_abilities(u, enemies, dt);
if  (dr >= 1.0)
  return  numeric_limits<double >::infinity();
 //Estimate effective hit points
score  = 1.0/(1.0 − dr);
return  score;
}

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.