Article
files/QUESTIONS

What Does a Behavior Tree Editor Look Like?

Alex J. Champandard on December 7, 2007

After my talk at GDC, a few people wondered what a behavior tree editor actually looks like since I kept mentioning their benefits, including their flexibility and intuitiveness. From my experience with the AI designers at Rockstar, I noticed a boost in productivity of multiple orders of magnitude by providing them with this kind of tool.

I also mentioned that it shouldn’t take much more than one man-month of work to get a good editor up and running — but that’s being conservative! So, I decided to put my time where my mouth is and create a quick prototype on my way back from Lyon. Here’s the result:

Of course, there are lots of things missing and the code right now is a collage of the wxPython samples, but it’s a start! Comments welcome…

Discussion 11 Comments

alexjc on December 8th, 2007

[B]Sergio[/B], Working from a fully capable behavior tree implementation, it took me a month to get it to the state where designers would be able to use the editor for editing all the behaviors we did in the previous milestone. It also took a little less than a month to get to a point where they no longer questioned the concept and saw its potential! But you're absolutely right, I was still working on features for months after, and it's something you'll no doubt have to do right until you ship the game! What do you mean by chaotic? The editor I made was simple enough not to get very complex. The only part that needed refactoring eventually was the right click menu :-) Alex P.S. I have also found that using C++ to implement user interfaces is generally a much slower process (e.g. QT). With wxPython you can be up and running much faster...

Sergio on December 8th, 2007

By chaotic I mean that some of the UI decisions that were made in the first version were driven more by "we have this new feature/screen, now, where do we put it?" than by a reasoned plan. Our tree is used by several systems, not only AI, but animation, level scripting, prop logic, effects and, essentially, anywhere where you want to drop a tunable FSM. Trees can be global or tied to specific characters. The interface has to present the choices on what actions/groups are available (we have tens of different ones for each tree), the parameters (which can be not only numbers, but strings, selection lists, points in space, game assets, etc), and the history window we use for debugging. And it has to do this for each of the dozen or so of trees we use. Building a good structure to display all this information in a clear way is no small feat, and there were a lot of rough edges in the first implementation.

zoombapup on December 22nd, 2007

I get the feeling that a visual editor that was a bit more "visual" might get a bit more designer loving. Something like the kismet thing they have in UT3 these days might do it. But hell, you got me fired up for trying out this behavior tree malarkey and coding up an interface for that in C# sounds like a fun way to spend a few days. Would it make sense to extend this "editor" to act as some sort of remote debug interface do you think (i.e. as the game runs, it sends info to the editor to allow you to single step the tree as it gets traversed). Might be thinking too much there :) hahaha. Nice one alex, will update when I've had a chance to try this.

blog on March 30th, 2008

[quote] After my talk at GDC, a few people wondered what a behavior tree editor actually looks like since I kept mentioning their benefits, including their flexibility and intuitiveness. From my experience with the AI designers at Rockstar, I noticed a [/quote] Read the [url=http://aigamedev.com/questions/behavior-tree-editor-example]full article[/url] on the blog.

jamesford42 on October 20th, 2008

I've been messing around with BehaviorTree's in TGB, [URL="http://farm4.static.flickr.com/3214/2956963616_92ebb13c8f_o.png"]heres a screenshot[/URL] of what the editor looks like at the moment, maybe someone will get a kick out of it. Those little icons are actually my favorite thing about it at the moment, heh. It's pretty easy to look for the red-question mark instead of mucking things up with "PrioritySelectorBehavior". Also you can set the "display name" for any behavior or condition in the tree, which is a nice touch.

jacmoe on May 14th, 2009

[QUOTE=Dan;9092]I wrote an open-source behaviour tree editor for one of my projects. You can check it out here: [url]http://www.codeplex.com/brainiac[/url][/QUOTE] I just stumbled upon Brainiac Designer, and it seems to be a nifty Behaviour Tree editor! :) It dumps plain XML, so I'm going to give it a spin. Anyone used it? :)

bristle on May 18th, 2009

[QUOTE=jacmoe;9815]I just stumbled upon Brainiac Designer, and it seems to be a nifty Behaviour Tree editor! :) It dumps plain XML, so I'm going to give it a spin. Anyone used it? :)[/QUOTE] no, but i download it now. sometime next week i will look at it. i am still little fuzzy on understanding the behavior tree model but it seems like better than fsm.

jacmoe on May 18th, 2009

The author of Brainiac Designer [URL="http://nextgenai.com/lexicon/behaviour-tree/"]used AiGameDev as reference material for behaviour trees[/URL], so the program ought to fit right in. :) Haven't tried making a C++ export plugin yet, but I will. Open Source is nice too.

dkollmann on May 18th, 2009

If you have any questions about the editor feel free to post them here and I will answer them as good as I can.

tinjaw on May 18th, 2009

[QUOTE=AstAn;9877]If you have any questions about the editor feel free to post them here and I will answer them as good as I can.[/QUOTE] When are you going to port it to Python? :-p

dkollmann on May 18th, 2009

Haha, I think .NET and C# is accessible enough. And if one want to use it for some Python based behaviour stuff, the editor contains an example of a text exporter so it should not be too hard to get that working. But nice try :P

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!