Game Development Reference
more sophisticated than nearly all of the programs it compiles. The output of the
VB compiler is far more flexible and wider ranging than the simpler programs it
usually compiles. Few of the readers of this topic are sufficiently qualified to write
a VB compiler. ''Adding sophistication'' raises the bar for the programmers. We
need not debate whether writing a planner is more or less difficult than writing a
compiler, but we should again also emphasize that the more-sophisticated
programs consume more-sophisticated data. VB code is more than simple
strings, and the actions made available to a planner are likewise more than simple
We will examine three planning systems: STRIPS, GOAP, and HTN. The latter
two (along with behavior trees) are very current
topics among industry
STRIPS stands for the Stanford Research Institute Problem Solver and dates to
1971 [Fikes71]. The basic building blocks in STRIPS are actions and states. From
these, we can develop plans to reach goals. Let us examine these states, goals,
actions, and plans. Along the way, we will touch on conditions as well.
States are not the states of an FSM, but the state of the virtual world. States can be
partial subsets of the world state. States in this sense are a collection of attributes
that have specific values. A state for nice weather might call for clear skies and
Goals are specified as states in this manner. A goal state is defined by a set of
conditions that are met when the goal is reached. Goal states differ from other
states in that the AI places importance on achieving the goal states, and it does
not particularly care about other states along the way to the goal.
Actions have preconditions and postconditions. An action cannot be performed
unless all its preconditions are met. If an action succeeds, all the postconditions
of the action will become true, whether they were previously true or not. As far as
the planner is concerned, only things expressed in the preconditions or post-
conditions matter. Planners are results oriented.
Let us examine the sharpen knife action from Henry's plan to mend the bucket
earlier in this section. It would have two preconditions: Henry has to possess the
knife, and he has to possess the stone. As a postcondition of the action, the knife
will be sharp.