Game Development Reference
In-Depth Information
being equal, the closer cover point is a more attractive option. The further away
the cover point is, the longer it would take to get there and, we would assume, the
longer the agent is exposed to the threat from which he is trying to get cover.
FIGURE 7.12 A common consideration for the utility of time is when it is
calculated as a result of a traveled distance. In this case, the longer distance
to cover B would require being exposed for a longer period of time.
This is hardly a surprise. We do calculations like this all the time. In fact, when
constructing an AI that would take this into account, we likely wouldn't bother
with converting the distance to time. It would be easier to simply sort the cover
points by distance and pick the nearest one. As we discussed above, this is relegat-
ing time to the back seat once again.
Other considerations could be in play that may make us start to think about the
value of time, however. For instance, if the path to cover point A is tougher terrain
that would cause you to move slower, now we are thinking in terms of time. The
distances may be the same, but it takes a longer time… that is, we are spending our
time in traveling the rougher terrain. If we were using a pathfinding algorithm that
incorporated terrain types or another such method of representing traversal time,
this is a calculation that can be performed through those numbers. Regardless, the
distance-time relationship is still somewhat interlinked.
There are times, however, when the time required to travel a distance would
have to be compared to something less closely related. In the above example of
cover points, the assumption was that all cover points are created equal. However,
game agents are often presented with two objectives that are not only not the same
thing (i.e., cover = cover) but are actually two different goals entirely (e.g., “raze this
building� or “destroy that army�). When this occurs, the time involved must be
included in whatever decision we are making regarding those goals.
Search WWH ::




Custom Search