Game Development Reference
In-Depth Information
Certainly, we could have done the math the other way around—dividing the
remaining 12 turns by 3 turns each—and arrived at the same result. The point was
the mentality shift involved in putting things in terms of how much can we do per
time period rather than in terms of how much time per action. This is important be-
cause it helps us frame time as a valid and useful component of utility rather than
simply a measurement of utility. That is, we are “spending time� doing something
rather than doing something “over a period of time.�
When viewed as a whole process, building five soldiers and a settler takes 20
turns no matter which way we do it (Figure 7.11). However, we know that the set-
tler unit has another job to do—that of starting a city. When he starts the city, the
city will grow over time. The longer the time the city is established, the more it will
grow. Therefore, time has a utility with regard to cities. If we want to maximize this
utility, we want to maximize the time the city has to grow, which means that we
want to start the city as soon as possible—that is, in the least amount of time .
Therefore, the utility of time that is so important to the city is transferred to the set-
tler itself. Any time saved in the process of building the settler has a valuable utility
in our overall process.
FIGURE 7.11 In terms of the number of each type of units produced, the end result
of each build order is the same. If the settler has another job to do (presumably starting
a new city), the time saved by building it with its escort first has a utility value.
D ISTANCE OVER T IME
Another very important aspect to take into account when designing game AI is the
relative value of time when attached to travel distance. If we had an agent deciding
between two available cover points (see Figure 7.12), one consideration would be
how far away those cover points are from the current location. All other things
Search WWH ::




Custom Search