Game Development Reference
In-Depth Information
As with our previous examples, we need to know a bit about the world before
we can process these decisions. Let's use the following variables to define the rele-
vant items we will be using in the example.
Current Health
H 0
Ending Health
H n
Value of Health Kit
V h
Value of Armor
V a
Time to Health Kit
T h
Time to Armor
T a
Time between Health Kit and Armor
T ha
Rate of damage from enemy fire without Armor
D
Rate of damage from enemy fire with Armor
D a
FIGURE 7.18 The agent needs to decide whether or not it can acquire the Health Kit,
the Armor, or both and arrive back behind the cover better off than it left. The utility
value of the time spent traveling under enemy fire is the greatest consideration.
As we are starting to get more complex in our calculations, at this point it
would benefit us to break this process down into manageable sections. First, we
need to establish formulas for how much damage we would take both with and
without armor. We know the rates at which we will take damage, but how much
damage we take is based entirely on the time we will be exposed. For example, if we
run to the Health Kit, we would take damage as follows:
Search WWH ::




Custom Search