Game Development Reference
A neural network for determining monster state.
an output layer. The hidden layer helps provide a way to create associations
among multiple inputs and multiple outputs. Key to exploiting neural networks
is knowing that they are classifiers and that they need the right inputs.
Neural networks are classifiers. They take inputs and render an opinion on what
they are. As a learning algorithm, they infer relationships instead of requiring the
relationships to be explicitly programmed in. This is critical to understanding the
utility of the method. When you know the relationships among the inputs, you
can get exactly what you want by directly programming them. When you do not,
or when they tend to defy an exact definition, it may be easier and more accurate
for the network to infer, or learn the relationship.
At this point, we know enough to ask the final question we should always ask, ''Is
this the right tool for the job?'' If the job of our AI is to classify the situation
before it, we might still be okay. However, the job of most game AI is to answer
the question, ''What should I do?'' It is not always obvious that the answer to
''What is the situation?'' that we get from a classifier will directly yield the answer
to ''What should I do?'' that the AI needs to provide.
The neural network show in Figure 10.3 could be used to determine the best next
state in the FSM from Chapter 3, ''Finite State Machines (FSMs).'' The network
classifies the world by indicating the next state that is the best fit to the conditions
at hand. Using a neural network for this simple example is total overkill, but