Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

http://altdevblogaday.org/2011/02/24/introduction-to-behavior-trees/

Obviously the most interesting article I found on this website. What do you think about it ?

It lacks some code example, don't you know any ? I also read that state machines are not very flexible compared to behaviour trees... On top of that I'm not sure if there is a true link between state machines and the state pattern... is there ?

share|improve this question
1  
"State" just means the data that represents an object at that point. The "State Pattern" is a way to represent this state data in certain programming languages. And a "state machine" is a way to handle changes of behaviour based on an aspect of the object's state. This question should really be split into several because you're asking a few things that aren't very related. – Kylotan Apr 23 '11 at 0:11

1 Answer

up vote 8 down vote accepted

Behaviour trees are getting pretty big in the industry right now. Halo 3 uses them extensively for their AI (Halo 3 - Building a Better Battle).

Alex Champandard seems to be a big fan as well (Lots of articles on it on AIGameDev.com).

For code examples, take a look at:
http://magicscrollsofcode.blogspot.com/2010/12/behavior-trees-by-example-ai-in-android.html - The example is in Java, but self-explanatory)

And:
http://www.sgtconker.com/affiliated-projects/brains/ - Which is C# and XNA, but probably a little more in depth.

A fairly new behaviour tree middleware tool is GameBrainsAI's tool (Edit: Looks like that's a dead end now). It's in its very early stages at the minute, but the plus side is that you can download an evaluation copy for free and use the visual editor and see what kind of code it generates.

To answer your latter question: State Machines: State Object versus sequential check: what are the pro/cons?

share|improve this answer
Can anyone find the BT SDK from GameBrainsAI? – gap Mar 21 '12 at 13:42
It looks like that project has disappeared, which is a shame. – Ray Dey Jun 7 '12 at 0:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.