Article

Behavior Trees for Next-Gen Game AI (Video, Part 2)

Alex J. Champandard on December 16, 2007

Here is part 2 of my lecture at the GDC in Lyon two weeks ago. Be sure to view the overview of behavior trees in part 1 first if you haven’t already. This video is exactly 21:48 minutes long, and is worth roughly 7.9 Mb of bandwidth!






In the video, I go over the process of making behavior trees easy to edit by using modular building blocks like decorators and filters. I also discuss the process of setting up a goal architecture with the behavior tree using a lookup table, and how you can both automate the process of assembling large trees — yet still get full control over the behaviors. Finally, I provide tips to deal with reactive planning in practice to make the most of the simple implementation of behavior trees.

This video is better quality than the previous video as I’ve got a bit more comfortable with the tools! (Note: Use Firefox if you have problems with other browsers.) The third and final part will be posted next Sunday… Be sure to subscribe to be notified when it’s released.

Discussion 3 Comments

kingius on December 21st, 2007

That is a very good question. Inspired by the videos on here I have started to develop a behavior tree in a personal project I'm working on and hit that exact issue when writing the code. Parsing the tree from the top downwards (perhaps using recursion) may be the way to solve the above problem, unless an event system is used (perhaps part of a seperate sensory system that can fire an "enemy spotted - danger" message at the behaviour tree). I think the event system is better and would require less CPU resources (the tree business logic would only need to store where in the tree it is and what the state of the tree is, as opposed to traversing everything over and over again).

blog on June 27th, 2008

[quote]Here is part 2 of my lecture at the GDC in Lyon two weeks ago. Be sure to view the overview of behavior trees in part 1 first if you haven't already. This video is exactly 21:48 minutes long, and is worth roughly 7.9 Mb of bandwidth! [/quote] Read the [url=http://aigamedev.com/videos/behavior-trees-part2]full article[/url] on the blog.

alexjc on February 9th, 2009

Hi Rune, The logic for selecting sub-branches can be entirely customized. There's no built in mechanism for estimating probability of success, but you could implement that yourself modularly. Alex

If you'd like to add a comment or question on this page, simply log-in to the site. You can create an account from the sign-up page if necessary... It takes less than a minute!