Game Development Reference
In-Depth Information
character is properly equipped and no desire at all to activate otherwise. The
Break Down Door behavior always returns a weak desire to activate. The Run
Away behavior returns a medium desire to activate. The Hide node will pick the
best of the three methods for opening the door and offer them to the Evade node
in the next level up in the tree. The selected hiding result will be compared to
running away. If the character is properly equipped, hiding will be preferred to
running away. If the character lacks picks or spells, the character runs away.
Looking at all the leaves this way may seem vaguely familiar. Bottom-up eva-
luation in a behavior tree is analogous to a rule-based system with an explicit
hierarchical disambiguation system. The argument for or against bottom-up
evaluation centers on whether or not nuances are lost by making high-level
decisions first. If there are no nuances to lose, top-down evaluation is simple and
fast. If low-level complexities keep creeping into the high-level deciders, the
system is losing the simplicity and possibly the speed that top-down systems are
supposed to deliver. In such a case, the system can be simplified by pushing
the detail back down to the leaves where it belongs and evaluating from the
bottom up.
Behavior trees provide two major advantages: They are easy to understand, and
they allow for sophisticated behavior selection. The diagrams shown are easy for
AI programmers to understand, and they are easy for experienced game designers
to understand. This point is critical; if the vision of the designer is to make it into
the AI of the game, the designer needs to understand what the AI will do. Besides
being easy for a designer to understand, the diagrams are straightforward for an
AI programmer to implement. The method is also easy to debug. All these
advantages make for a more productive team, allowing more time to get the AI
right because of the clarity provided.
Where does that clarity come from? The diagram partitions the AI problem,
allowing the team to look at one node (along with its parents and children) and
safely ignore details that are important only to other nodes. FSMs also divide the
AI problem, but behavior trees add their hierarchy as an additional way of
partitioning the problem that FSMs lack. Hierarchical FSMs are a middle ground
between pure FSMs and behavior trees in terms of partitioning. With FSMs, the
mindset at any level is finishing the statement, ''I am...'' yielding a flat diagram.
In contrast, a typical behavior tree works on the idea of ''The big decisions count
Search Nedrilad ::

Custom Search