Game Development Reference
In-Depth Information
RAIN node types
For the RAIN implementation of behavior trees, the behavior nodes are split into two
categories: decisions and actions. Actions tell the AI system to actually do something;
it is where the actual work of the AI is done. The most common action is the one we
saw in the previous chapters, move , which tells the AI system to move a character.
Besides move, here is a list of the current actions RAIN supports:
The Choose patrol path and Choose path waypoints : These nodes help to
move the AI through a network of waypoints.
Detect : This finds other AI entities and areas marked in a scene. This node
will be covered in Chapter 6 , Sensors and Activities .
The Evaluate expression : This node evaluates some logic, using RAIN's
custom logic system. We will be discussing this node more in this chapter.
Animate and Mechanism : These animation nodes manage different anima-
tions playing on the entity. We'll look at this node type more in Chapter 10 ,
Animation and AI .
Play audio : Plays an audio sound for the entity.
Wait for timer : A timer that will pause for a given number of seconds.
Yield : This node stops executing the behavior tree in the frame. This is useful
for spreading expensive AI computation over several frames.
Custom action : This is used to create an action that can't be defined with the
other nodes.
Note
Custom actions and decisions nodes are very useful to define AI behaviors that
are unavailable with the default node types. We will look at an example of a cus-
tom action later in this chapter. Although creating custom nodes is more work,
don't hesitate to use one if needed; part of making good AI is customizing things
specific for your game.
Decision nodes, as the name suggests, are used to decide how we traverse the tree.
Actions are the final things the AI does, and decisions are used to determine which
child nodes should be run:
Search WWH ::




Custom Search