Project Description
Implementation of behavior trees for XNA games.

Info
Simple implementation of behavior trees inspired by a series of articles from site http://www.aigamedev.com. This approach heavily uses templates, all the nodes of the trees are bound to one type of entity on which they can operate, so it works nicely with hierarchies of objects.

Concepts
Main concept is that the trees are created for specified type of the entity. This type is specified as a type parameter for the generic classes. All basic nodes are classes that can operate on any entity type. In the entity code however, you can specify more nodes/actions/conditions that will be applicable for that kind of entity. Nodes are classess deriving from the provided basic nodes - you can create predefined behaviors by inheriting from them, and the actions/conditions are methods that operate on entities, manipulate or check its data.
Using that predefined stuff you can build behaviors that will be run upon the specified entity types, and the inheriting ones.

Notes
  • It uses slightly modified XNA http://creators.xna.com/en-us/sample/simpleanimation as an example application, because it's a funny little project which may nicely show the abilities of behavior trees.
  • It runs on XNA 3.0 CTP libraries and the solution is for Visual Studio 2008.
  • Although it is developed for XNA the only dependancy is the usage of GameTime structure (for now).
  • OK, it's not Game Component per se;)

Last edited Sep 9, 2008 at 10:54 AM by scypior, version 8