Download

Behavior Tree Documentation

We’re working hard to make behavior trees a “full” feature of the engine (meaning we hope to remove them from the “experimental” section soon).

As part of that push, Behavior Tree documents are incoming!

I’m posting the first pass of introductory documents today.

More advanced documents will be coming over the next few weeks and leading up to the official release where we will be moving Behavior Trees out of the “experimental” section.

Additional samples and tutorials will also be coming over time, and we’ll add any documentation we need longer-term as well.

The focus of the first-pass documents and samples will be on using behavior trees purely with data (no code required).

However, there will be at least a few notes for programmers, and we’ll add more “technical”/programming sections as time proceeds.

For now I’m just posting first-pass versions of the docs on the forum, but they’ll be moved to our official documentation area soon.

Here’s the current plan for the various sections of documentation: (links will be added to these as they become available. I still hope to post the Walkthrough and at least part of the docs about Behavior Tree Node Types today.)

  1. Introduction / What’s a behavior tree?
  2. Basic Behavior Tree Walkthrough
  3. How UE4 Behavior Trees differ from “Standard” Behavior Trees
  4. Blackboards
  5. Behavior Tree Node Types
  • *]Basic

  • *]Additional

  • *]Advanced

  1. UI
  2. Debugging
  3. Gotchas

Eventually, we’ll also have:

  1. Technical/Programming – Most programming notes will accompany sections above, but we’ll have additional programming specific notes in its own section if necessary.
  2. FAQ (This will of course have to wait until we learn what questions are frequently asked. :p)
  3. Samples & Tutorials

I’ll link to other threads that you may find useful here.

Behavior Tree Tutorial Post, with some Epic developer explanations about differences between UE4 Behavior Trees and standard trees. Also explains how to enable behavior trees, how to create Blackboard assets, and how to create Blueprint behavior tree nodes.
How do you determine which Key on a Blackboard you are accessing. Includes Blueprint & C++ solution.
UE4 Pathfinding basic AI. Includes an example behavior tree for implementing random wandering, and shows an example of how to make a Blueprint Task node.

Some AnswerHUB Posts:
(Some of these are fairly peripheral to the Behavior Tree issue, but they’re still good AI information generally)
How to spawn the correct AI Controller when spawning an AI Pawn
Best method for calling animations from Behavior Trees

Sorry everyone for the delay in getting these out there. I’m excited to finally be moving forward quickly towards Behavior Trees being a “full” feature of the engine.

It’s really impressive what you’ve all been doing even without documentation, so hopefully this will help get even more people working with behavior trees and making cool things. :slight_smile:

Nice work Daniel, good to see this going up.

Out of interest, and feel free to answer this in another thread on the main forums. Is there anything in the AI area that you would like to see people working on for UE4? Once the BT features are out in the open, then hopefully we’ll get more people involved in playing with them, but I figure there is always a wishlist of features that I want as a developer but don’t necessarily want to tackle for myself. It’d be useful I think for Epic to share that with the community, not in terms of roadmap stuff, but more as a “we’d love to see an implementation of X”.

The kind of thing I’m thinking of is stuff like automated cover selection/notation (for those interested check out Mikko Mononen’s excellent talk from aigamedev.com conference about this, or Matthew Jack’s implementation of that stuff for CryEngine).

I’ve got my own wishlist of course, but I thought it’d be interesting and fun for you to share yours.

Great question! I’ve got a list of features we plan on adding ourselves, some of which are certainly “wish list” in the sense that they’re probably some time down the road or “would be really nice” features. I hadn’t really thought about what we might like to see other developers make though. I’ll talk with the other AI folks though and try to get an overall list from all of us and post that (probably on another thread). Definitely an interesting topic to discuss.

Nice!

Looking forward to the more technical documents :wink:

Hi there .May I know how does the Flow Control in the blackboard works?

Abort Self/LowerPriority. etc ?
I’m a little confuse by these.

See my post about how the “Observer Aborts” property works.

If you need to know more about the blackboard, read the blackboard documentation here.

I hope that helps. If you have any more specific questions, let me know!

Daniel, is it possible to attach multiple blackboards to a given behavior tree? I haven’t had time to check that yet, but its a pretty common use case for the AI I’ve worked on. I only played around with your BT implementation briefly so far (work to do), but didn’t see that feature and it only now occurred to me to ask.

Ta.

Phil.

I’m deleting my response here, as I’ve responded in better detail on the separate thread about the topic: Read it here! :slight_smile:

Oops, sorry, I just saw Zoombapup’s separate thread on this… let’s continue the conversation there. I’ll post there instead.

Hi Daniel,

I’m a little confused here with the documentation on “behaviour trees” as it seems to be just several forum posts by you and a few others, linked in some other forum posts!

If I remember correctly, you said a few weeks back, " I’m writing up comprehensive documentation on AI and Behaviour trees", so my confusion lies there. Is this it, links to random forum posts and few more detailed posts by you, or are you writing up an official documentation thread for the official documentation listing?
As of this date, I can’t find anything in the official documentation about AI or Behaviour!

Maybe I’ve missed it, or I’m missing something because I’ve been so busy recently and not been on the forums.

Another tip too, ( not that it’s your field, or in your hands) - the answer hub needs cleaning up dramatically, it’s a complete mess and I find it totally unusable.
I’m pretty sure you guys have been a little overwhelmed by how popular UE4 has become, and stuff like forums, documentation and the answer hub have become bogged down in lots of unnecessary nonsense.
The answer hub wasn’t even much use during “Rocket”, but now it’s awash so many questions being duplicated umpteen times, (probably because it’s impossible to use and people find it easier to create a new post) …

Have a word with the answer hub guys please :slight_smile:

By the way, Epic Games and UE4 still rocks :cool: - I love you guys :slight_smile:

At the moment I’ve just posted the first pass of the documentation here. It will be moving to the official documentation section ASAP (and joined by a bunch more documentation I have in progress); definitely by the time we move Behavior Trees out of the experimental section, but hopefully even sooner. And we’re doing our best to have Behavior Trees out of experimental as soon as possible (hopefully by 4.3, though that’s not quite certain yet). I’m afraid I can’t give you an exact date yet. I’m trying to post docs as quickly as I can given other responsibilities and without posting anything that might cause MORE confusion.

I’d be surprised if the people in charge of the Answer Hub & documentation generally are not aware of the concerns people have expressed about it on the forums, but I’ll definitely forward your concerns to them!

Thank you Daniel, and to be honest, I can put up with a dodgy anwserhub and wait for AI docs, because of all the awesomeness of this engine and the goodies every two weeks.
You guys and ladies are true legends :slight_smile: :cool:

Dear Epic Devs,

I am experiencing the AI system as completely unusable in a packaged game, Development or Shipping. I’ve tried both several times.

Everything works great inside the Editor / commandline in unpackaged build! No errors or crashes at all!

In Packaged Builds
I am getting a crash immediately after the Blackboard is initialized for a single character that I spawn on key press

I literally cannot use Blackboard at all in a packaged game :slight_smile:

AnswerHub Link
https://answers.unrealengine.com/questions/53735/ai-behavior-tree-crashes-packaged-shipping-builds.html

I am not personally in a rush but the people whom I am assisting will need this crash to go away soon :slight_smile:

I am not anticipating that this crash is abnormal for the current stage of Blackboard system’s development, but I just wanted to make sure you knew about it!

Full details at link above!

Have fun today!

Rama

Hey Rama,

Regarding that crash, Łukasz Furman did answer your report on AnswerHub. Have you tried following his instructions?

In general we’re using BTs, BBs and the rest of UE4 AI system in cooked builds on a regular basis and we haven’t had a crash related to AI in months. So any help you could give us trying to narrow this one down would be greatly appreciated!

Thanks in advance!

–mieszko

Is there still no Behavior Tree Documentation?

Look here: https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/index.html

There are plenty of video tutorials on youtube now. Here’s my own: Unreal Engine 4 AI Tutorial Introduction and Theory - YouTube

To be fair, you can understand BT’s in general by reading aiGameDev.com and then its a small step to understand Epic’s implementation of them.