Behaviour Trees - Event driven

Hey
I’ve played a little with Unreal’s Behaviour Trees and I now wonder what “event driven”, as descriped in the docs, means in this context.
First of all, I know in fact what it actually means. I have a few years of experience in programming and I know what events are, but I wonder how Unreal’s implementation works.

An example BT from google pictures
https://www.safaribooksonline.com/library/view/unreal-engine-4/9781784393120/graphics/B03663_05_04.jpg

So, the top Selector runs every few seconds and the first child is a Blackboard decorator. As far as I know this means, the Blackboard decorator will process automatically when it’s event is fired.
But the decorator seems to be called every few seconds anyways. Is this kind of a hybrid of event and normal BT processing ?
If something is fully event driven, I would expect it to be sort of unconnected to the rest of the BT, as the node will process independent from the parent node.

So, what happens when the parent node (the top selector) calls it first child (I’m Hungry) ?
Is the node returning immediatly, as it hasn’t been called by the event, but by the normal processing BT ? Is it just being processed normally ? Is it even ignored completly (which sounds kinda useless to me, as all childs are receiving events) ?
Or is it maybe called to register in the blackboard key event handler once again?

Somebody ?

#Bump

I’m answering because of the bump, I have experience with the system but these details may take one of the Epic AI programmers to answer correctly and completely.

There is some sort of optimization in the BlackBoard, I don’t know the details. The BT is running much faster than every few seconds. I am not sure that the Blackboard is pinged as the BT runs, but I’m not positive. I do believe it’s independent.

I think the BlackBoard is on the root, not the Selector. The decorator is a compare check on a Blackboard variable, if it fails the node returns fail and the parent Selector will try the next child until it gets a success. Things like MoveTo’s return in progress until they complete.

So, as far as event driven. That tree design is not really event driven, but I think the inner workings of the BlackBoard itself is event driven.

Thanks for your answer !

Definitely, sorry, my post is a little confusing.
What I said was actually related to the example BT from Google pictures, where the top selector only ticks it’s childs every few seconds.

Yep, sorry again, as far as I know it’s just like that the decorator type is called “Blackboard” by default :smiley:

So, just to clearify, my actual question is:
The decorators (I’m hungry ? / I’m barking / I’m tired) should receive an event (i.e. OnValueChange) but the top selector (Mailman Radar) actually seems to call them every few seconds anyways. I would those nodes expect to be called by the event instead of other BT nodes, if they were fully event driven.

That would be great :slight_smile:

This is how I see it. It is not fully event driven, BehaviorTrees are not fully event driven. If you want that, don’t use the Trees and do something else. But, under the hood in the Tree’s workings it is event driven. It’s an optimization. The decorator’s value is updated by an event when it happens, so there is not a lookup cost, but it’s value needs to be read. It’s a reduction of the length of constant time. So it is not the same as, for instance getting a reference to an object, and then comparing a value on it with another value, instead it is a single lookup as it was set by an event. It won’t make much of a difference by itself, but add up every tree when there are many enemies and it can make a large difference in time that is spent calculating the Behavior Trees.

Keeping this post in my radar.

That’s fine ! Just asked out of curiosity.
Thanks alot, I’d upvote your post but it doesn’t work for some reason, sooo (Y)