Behavior Tree Sequence returning true without running child tasks (Playmaker)

Haytam95

Active member
Hi

I'm splitting my AI system into smaller BD Tree using State Machines with Playmaker. So for example, here is one of my FSM

1622925496919.png


Each of those blocks starts a Behavior Designer Tree and then when something happens, those post an FSM event. Also the Tree are desactivated when FSM changes it's state, because the Tree ends.

1622925581205.png

So far so good. The trouble comes when I want to have a BD that runs on a Repeater, because the Tree will continue running even if the FSM isn't in that state.

In order to fix that problem, I created a simple Playmaker action that stops the Tree when the state exit. Just like this:

1622925856577.png

Trouble is, that BD gets desactivated before sending the event, so FSM hangs out in the current state.


BD died here:



------------------------------------------------------------------------------------------------------------------------------
Edit:

The problem is that Sequence is returning Success without running it's child tasks, here is the gif debugging:


------------------------------------------------------------------------------------------------------------------------------
Edit 2:

Looks like the Behavior Tree doesn't load up completly on Enable, the first frame. I've been able to partially fix the problem by using Async load (But at some point the Behavior Tree fails for the same reason, the Sequence returns true because don't have load any child yet).

The way I fixed this was by adding a Repeater forever at start of the Trees. So the Tree don't return a value and keeps executing until the event makes FSM change the state.

@Justin if you need I can give you the Scene to check this issue :)
 
Last edited:
It looks like some sort of an execution issue between your FSM and the behavior tree. If you change the script execution order so the behavior tree and behavior manager executes before Playmaker then it should initialize first.
 
It looks like some sort of an execution issue between your FSM and the behavior tree.
Yeah, that was the same I was thinking. So I tried the async load and it work, but at some point the Tree gets stuck as well.

I just tried changing the execution order without success. Same result as before.

I'll use the Trees with a Repeater to patch this issue for now! :)

Do you think that this could cause some trouble if the FSM and the Trees grows up? (My action kills the Trees on Exit, but I'm affraid that at some point this patch will fail as well)
 
Top