Game Development Reference
In-Depth Information
double Accuracy = pWeapon->GetAccuracy( Dist, AccAdjust );
return Accuracy;
}
Assembling the data requires a similar set of function calls.
double DamageITake = GetDamage( pTarget->GetWeapon(), Dist );
double EnemyAccuracy =
GetAccuracy( pTarget->GetWeapon(),
Dist,
pTarget->GetPointer() );
double TimeToKillMe = TimeToKill( mHealth,
DamageITake,
EnemyAccuracy );
Through the processes above, we know how long it will take for us to kill a
selected enemy and how long it will take for him to kill us… but now what? What
do we do with this information?
As we discussed in the first half of the topic, the utility of an action is not always
as obvious as we would like it to be. Sometimes we have to add a little bit of subjec-
tivity as well.
B UILDING C ONNECTIONS
Certainly, each of the two values, TimeToKillEnemy and TimeToKillMe , is impor-
tant. It is helpful to know how long it would take us to mow down a Dude with a
particular weapon. It is also helpful to know how long we can expect to survive an
onslaught from a particular Dude. However, there is not an inherent “cause and
effect� relationship between TimeToKillEnemy and TimeToKillMe . We have to
define a meaningful connection between the two.
As with our simple example earlier, we cannot base our decision solely on one
or the other of these two factors. Anecdotally, if we select the Dude we can kill the
quickest, we may be exposing ourselves to a Dude who can kill us the quickest.
Alternatively, if we elect to assault the one who is the greatest threat, we may be
overlooking the fact that we could have quickly dismissed his weaker pals. What we
must do is build a connection between these two independent values that expresses
a combined utility to us.
Search WWH ::




Custom Search