Game Development Reference
In-Depth Information
We are simply calculating the difference ( T n ) in the time it would take to reach
goals A and B ( T a and T b , respectively). For purposes of this example, we are assum-
ing that we had already determined that B was the most distant—this way I don't
have to clutter things up with absolute values and so on.
FIGURE 7.14 In this example, goal A is closer than goal B. We must consider both the
values of the relevant goals as well as the time it takes to get to the goals.
At this point, T n is simply a linear difference . We have only determined what
the difference between them is numerically. For example, if T a = 10 and T b = 25,
then T n would be 15. While that is valid mathematically in that it allows us to com-
pare the two values, it doesn't tell us as much about the relationship between them.
For instance, if the distances to A and B were 1,000 and 1,015, respectively, T n
would still be 15. At that point, the difference of 15 is not terribly relevant.
Obviously, that difference of 15 doesn't mean as much as the difference of 15 when
the values were 10 and 25.
The solution, as we shall see throughout this section and indeed throughout
this topic, is to normalize the result against one of the values. We need to determine
not what the linear difference is, but rather the relative difference . In other words,
we want to express one of the values in terms of the other one. In this case, let's
specifically compare all time values to that of the shortest time, T n . Therefore,
If we insert the values T a = 10 and T b = 25, we find that T n = 2.5. That is, trav-
eling to goal B ( T b ) is going to cost us two and a half times as much as we would
spend getting to goal A ( T a ).
Search WWH ::




Custom Search