Announcement

Collapse
No announcement yet.

Trouble with Behavior Tree Decorators

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trouble with Behavior Tree Decorators

    Hi, I've been working on some basic Behavior Tree stuff in the first person template. Basically, I'm just getting two vectors as blackboard and comparing them using Compare BB Entries decorator. If they're equal, it's supposed to print a string. However in my case, the behavior tree passes through the condition even though the vectors are never equal.

    I've encountered the same issue while working with the 'Does Path Exist' decorator even though my two blackboard vectors were clearly blocked by static meshes. I've checked the nav mesh collision in editor to see that nav mesh is cut out by the blocking meshes. However the behavior tree always passes through it even though both the blackboard vector values were correct.

    I'm not sure if there is anything wrong with my workflow. So I've shared the screenshots below.

    Click image for larger version

Name:	AICon.jpg
Views:	1
Size:	444.7 KB
ID:	1146724

    Click image for larger version

Name:	BT.jpg
Views:	1
Size:	309.8 KB
ID:	1146725

    I'm unable to finish uploading the project files here, so I'm sharing the link for the same question in Unreal AnswerHub. I have attached a compressed zip file of the project over there.

    https://answers.unrealengine.com/que...t-working.html
    Unreal Possibilities
    Tower Defense Starter Kit [50% OFF] | Grid Creation Systems [50% OFF] | Line of Sight Visualization [50% OFF]
    Wave Spawning System [70% OFF]

    #2
    this: https://docs.unrealengine.com/latest...t/2/index.html and https://www.youtube.com/watch?v=VAAHKNoIg0w helped me big times.

    ill look into your project if i get home

    Comment


      #3
      Allright

      It would be nice to know what u are actually trying to achieve, theres things I really question in this.

      You compare the vectors of 2 different things in the world, one time then they are not equal nothing happens.

      In depht: At begin play, that means when u hit play and the pawn gets created it also creates an AI ACTOR - then begin play will fire once in aidirector the BP. The blackboard values get set - they dont happen to be equal, and that was it.

      You should go through the 2 tutorials I posted above (the first one first). It really helped me big times.
      Last edited by t0b4cc0; 03-23-2015, 04:08 PM.

      Comment


        #4
        Hi t0b4cc0, I'll check out those tutorials. Thanks for the link.

        As for the vectors, they're not equal. I had thought that 'compare bb entries' would only let the behavior tree pass through the selector node if the decorator condition was satisfied. And in this case, as you noticed it's not. But the task 'BTTask_Test' keeps getting executed regardless. So I was wondering why the decorator has no impact on the flow at all.

        Edit: It works perfectly, if I place the decorator on the task or if I have another selector or sequence node above the one shown in the screenshot. I'm interested in knowing the reasoning behind why it doesn't work in the situation shown in the screenshot.
        Last edited by Stormrage256; 03-24-2015, 12:00 AM.
        Unreal Possibilities
        Tower Defense Starter Kit [50% OFF] | Grid Creation Systems [50% OFF] | Line of Sight Visualization [50% OFF]
        Wave Spawning System [70% OFF]

        Comment


          #5
          ah i didnt see u wanted it to do nothing but it always was executed

          well thats odd. when i have a problem like this i always do debugging with "print string".

          in this case i would print the 2 vectors before the "run behavior tree" to see myself, if they are not the same i would go on through the event chain to see where the error is.

          Comment


            #6

            I have been confused about this for a long time. After some testing, I found that the Decotator of the behavior tree is not kept in the tick state for execution. It is actually executed in the order of the behavior tree to select the task nodes and then wait for the notification of the return of the behavior nodes. Re-judgment the behavior tree condition after the notification is confirmed As shown in the following figure, if the move to node does not add a finish execute notification, the behavior tree will always be stuck at this step, and the judgment of is at location will not be performed. If you add a finish notification, the behavior tree thinks that this node has completed the task, and then re-evaluate the behavior tree condition
            So your problem may be that when the behavior tree is initialized, the values ​​of the two variables are the same, and then enter the task execution, but the execution status is not returned, so the decorator does not re-execute
            Although this is a 2015 post lol, hope it can help people who are confused by behavior tree decorator issues
            Click image for larger version

Name:	Untitled-picture.png
Views:	241
Size:	104.9 KB
ID:	1701769

            Comment

            Working...
            X