After having worked out the overall design for your actors, you’ll start creating specific behaviors for all the situations you have in mind. Now, if you use a standard programming/scripting language for this, you’ll end up with a very low-bandwidth approach to express what you have in mind. The actual behaviors will get lost in the syntax.
Instead you should use a domain specific language. In the case of game AI, a DSL is a way to express your behaviors as modular blocks that work together. There are two ways of doing this…
Finite State Machine
A FSM consists of a set of states, which you can connect to each other. When a state is active, connections may trigger a state transition if a condition is true.
See this article for more details:
Using this approach, you can design your behaviors to the smallest detail. Of course, ideally you’d need a tool to get the state machine into the game without having to re-implement the state machine as a script.
A hybrid hierarchical state tree.
Behavior Tree
The alternative to a flat state machine is a behavior tree. Behaviors are organized hierarchically, and call each other to achieve tasks.
Hierarchical Logic at AiGameDev.com
Behavior Trees at Gamasutra.com





0 Comments ↓
Leave a Comment