Game Development Reference
In-Depth Information
T ab
The time to move between A and B
r
The rate that the values of goals A and B decay
The entire formula that we need for calculating the value of going to A first and
then to B would be:
Let's restate that in English (left to right):
1. The total value of accomplishing A and B—in that order ( V ab )…
2. is the value of A ( V a )…
3. after reducing it by the decay over the travel time (1-( r
×
T a )) …
4. plus the value of B ( V b )…
5. after reducing it by the decay over the travel time to A and from A to B
(1-( r
×
( T a + T ab ))
In step 5, it is important to note that we have to include the time it took to get
to A and then from A to B. After all, the value of B was decaying that whole time.
That's why we have to multiply the decay rate by ( T a + T ab ).
If we want to calculate the value of doing things via the reverse path ( V ba ), which
we need to do to compare them, we simply flip the As and Bs accordingly. (We can
assume for now that the distance from A to B is the same as from B to A.)
To decide which route we should take, all that remains for us to do is to com-
pare the values of V ab and V ba to see which one provides us with the highest value.
To test our scenario, let's plug in some numbers (Figure 7.16). First, let's see
what happens when the goal values are the same. Let's use the following values.
V a
The value of goal A
100
V b
The value of goal B
100
T a
The time to move to goal A
10
T b
The time to move to goal B
25
T ab
The time to move between A and B
45
r
The decay rate
1% per time period
 
Search WWH ::




Custom Search