Game Development Reference
recall our discussion of complexity in an FSM. The complexity of the transition
rules can be the downfall of an FSM that has a manageable number of states.
Using a neural network frees programmers from the task of programming the
transition rules, provided they can teach the network instead.
An advantage of using a neural net to classify is that the outputs are not fixed to
binary values. In our existing monster FSM AI, when the monster is attacking or
fleeing, it has no middle ground in which it is considering both. A neural network
can be trained to consider two or more different alternatives. If the training data
did not have a sharp cutoff between attacking and fleeing, the neural network will
reflect that for those inputs that had more than one different valid output. The
training data would indicate that sometimes the monster flees players when hit
points are at a given level, and sometimes it continues an attack. The FSM code
that disambiguates multiple possible next states can weigh the options presented
by the outputs. If the highest output is always used, the behavior will be the same
as before. If a weighted random selection is used, the behavior will more closely
match the proportions in the training data.
Using a different example, the output of a neural network trained to recognize
letters might show strong outputs for Q, G, O, and C when presented with a Q to
recognize. If the network did not have a strong preference, the next character
might be used to assist in the decision. In English, Q is almost always followed by
U or u. Having weighted outputs instead of binary outputs coming from the
neural network allows the overall system greater leeway in making decisions. This
is true of other methods as well.
Classifiers such as recognition systems are oracles . When asked a question—any
question—they give an answer. On the surface this capability seems impressive,
but it is also true of the Magic 8-Ball toy. If you feed text that uses the Greek or
Cyrillic alphabet to a recognizer trained on the Roman characters present in
English, the recognizer will output what it thinks are English characters. It would
make the same attempt when fed Hebrew or Hiragana characters or even Kanji
symbols and random applications of the spray-paint tool on a bitmap. One of the
more important design decisions to make with such a system is what to do when
presented with inputs that have no particular correct response. Such inputs are
commonly called garbage, but they include ambiguous input as well.
There are two ways to approach this problem. The simplest is to demand, ''Give
me an answer, even if it's wrong.'' In this case, the system is trained with the
broadest array of data available and sent into battle. The alternative is to design a