Game Development Reference
In-Depth Information
not only cornering, but spinning as well. Stable cornering has a constant rate of
change in heading and therefore a zero second derivative (the rate of change of a
constant is zero). The amount of counter-steering required to catch the spin
depends on how bad the spin is; the second derivative is a very useful number.
Going the other way and summing data over time may also have merit. If the
monster is tracking the cumulative number of points of damage it is dealing out
to a foe, the monster may have a good idea of how soon it will vanquish a foe
without resorting to cheating and looking at the foe's actual hit points. The
monster is guessing at the number of hit points the foe started with, but it will
know the cumulative number of hit points that the foe has lost. The cumulative
sum is the first integral of damage delivered. The monster may want to decide to
stay in a difficult combat because it thinks it can finish off a potent foe before the
foe can return the favor. A single value for damage delivered does not tell enough
of the story to be useful. Time-varying data typically needs special handling to
create effective features to input to a neural network.
As mentioned earlier, using a neural network in place of our familiar monster
FSM is total overkill. It is used as a familiar example only. There are better ways
than neural networks to do everything we have illustrated so far.
Genetic Algorithms
Genetic algorithms are rarely if ever used for game AI. Instead they are sometimes
used for tuning variables in games. Motorsports provide us with a good example
[Biasillo02]. A mechanic setting up a car manages many tunable parameters to
obtain optimum performance on any particular track. There are the camber,
caster, and toe angles to be adjusted when doing a basic wheel alignment. There is
the braking proportion between front and rear tires—a setting more easily
understood if you consider the rear braking needs of an empty pickup truck
compared to a fully loaded one. An empty pickup truck needs minimal rear
braking force because the lightly loaded rear tires provide minimal traction. A
heavily loaded truck benefits from having a great deal of rear braking force to
exploit the greater traction available. This is only a partial list of tuning para-
meters; as you might expect, there can be interactions between variables.
Genetic algorithms can help us in our search for the optimal settings. Genetic
algorithms roughly mimic biological evolution. We start with a population that
has different characteristics. Some are more fit than others. Cross-breeding and
mutation yield new members with different characteristics. Some of these will
 
 
Search Nedrilad ::




Custom Search