Game Development Reference
In-Depth Information
If the Dudes arrayed before us all have the same threat ratio, a small tweak in the
distance to the detonator could make the difference. On the other hand, if there is
a large difference between the threats that the various Dudes present, it may not
matter much how close any one of them is to the detonator. As with many occur-
rences of subjective ratings, we are left to the obscure and very nonscientific method
known as “pulling numbers out of the air to see what works.�
Thankfully, by performing a simple division, we can significantly affect our result
as both of our two factors change. Consider the formula
Because we had already established that a lower ThreatRatio is more important,
it helps for us to keep that arrangement. We also constructed Urgency so that the
maximum value is 1. We want Score to be at its extreme (lowest) when Urgency = 1.
By placing it in the denominator, we achieve this effect. As Urgency goes down, the
value of the fraction would go up—that is, the target would become less of a prior-
ity. Likewise, if Urgency stayed the same and ThreatRatio increased (became less
important), Score would increase as well—again, making the target less of a priority.
Therefore, the arrangement of dividing ThreatRatio by Urgency achieves the desired
effect.
S CORING THE O PTION
We can run some numbers through the formula to ensure that this is working
properly. Consider the following values:
ThreatRatio
Urgency
Score
3.8
0.26
14.64
3.8
0.32
11.85
4.1
0.26
15.77
4.1
0.32
12.81
10.9
0.51
21.37
10.9
0.80
13.62
Again, as we peruse these examples, some things jump out at us. First, consider
the first two lines. The threat ratio stays the same, but the urgency increases from
the first to the second line. As we would expect, the value for the score decreases (or
becomes more important). Using the same two urgency values but increasing the
 
Search WWH ::




Custom Search