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…













Comments
Comment on this article. | Show full forum thread.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.
However, I would consider your estimate of one man-month to be optimistic, not conservative. Sure you can get something up and running much faster than that, and then you'll spend many months polishing and improving it to get a production-strength editor, that's fully featured, robust and bug-free, easy to use, fast, is integrated with the game so you support hot-loading, has a rich interface (e.g. for actions with tens of parameters), nice different icons for sequences and parallels, can be saved/loaded from a text file and a binary one, etc.
We have a similar editor here, written in QT, and it's been in development for several months, and gone through two full iterations already, as the first version was very organic (read, chaotic).
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...
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.
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.
Alex, thanks for all the articles on Behavior Trees. They've been extremely helpful!
I've got next to no knowledge about Behaviour Trees and wotnot (AI has always interested me however), but if someone was to give me a spec, I could whip up a desktop app in a very short time.
Using Clarion ([URL=http://clarionfolk.com]http://clarionfolk.com[/URL]), I'd be able to create a tight and clean interface into the data structures (whether XML or proprietary or SQL or ..). The main point I would think so, regardless of the database type, would be to
1. Easily create and edit Behaviour Trees
2. Simple and powerful (deep) view of these Behaviour Trees.
Might be wrong there. Let me know.
Anyway, drop me a line, stu (at) clarion folk (dot) com. Be more than happy to take up the challenge of putting a few nights into creating a simple Behaviour Tree editor.
Unless I've completely misunderstood the post / comments and there's already good ones out there.
Cheers,
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? :)
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.
Haven't tried making a C++ export plugin yet, but I will.
Open Source is nice too.
When are you going to port it to Python? :-p
But nice try :P