News Forums RAIN General Discussion and Troubleshooting Behavior Tree - Animation while wandering around

Tagged: ,

This topic contains 4 replies, has 2 voices, and was last updated by  Stahlmotte 1 year, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38938

    Stahlmotte
    Participant

    Hi,
    it´s me again.Im just playing around a little bit with the demo scenes. So i used the custom action with the “Choose Wander Position”-script in combination with a move-action to move my enemy around randomly. Works fine. The next step was to add the walk animation. After adding the animation, the animation works, but the enemy only walks to the first position. The Part of the tree looks like this:

    CONSTRAINT (checks if player is near or not)
    I- PARALLEL (Repeat Never / Fail Any / Succeed All)
    I—- ACTION (Choose Wander Position / Repeat until Success)
    I—- MOVE (Repeat Never)
    I—- ANIMATE (Repeat Never)

    I´m sure this is a quite trivial problem how to use the behaviour tree, but i don´t get it.

    Best regards

    Alex

    #38939

    Sigil
    Keymaster

    Check it in the behavior tree debugger to see what is happening. To open the debugger: while your project is playing, select the AI in question, open the Behavior Tree Editor, and set it to the Current AI (first option in the drop down).

    I imagine what is happening is that the Animate node is still running (yellow), which is keeping the parallel from starting over because succeed is set to all. As an alternative I would probably set it up like this:

    constraint (checks if player is near or not)
       sequencer (repeat never)
          choose wander position (repeat until success)
          parallel (fail: Any, succeed: Any, tiebreaker: Fail)
             move (repeat never)
             animate (repeat never)
    #38940

    Stahlmotte
    Participant

    Hi Sigil,

    thanks for the quick reply! Indeed the animation was marked yellow.

    Tried like suggested. Didn´t work, but as soon as i changed the Sequencer to “Repeat Until Failure” it works.

    Best regards,
    Alex

    #38941

    Sigil
    Keymaster

    Ahhh, needing the repeat is probably due to the rest of the tree running, I didn’t take that into account. Glad you got it working.

    #38943

    Stahlmotte
    Participant

    Yes, sounds valid.:-) Thanks for your support!

    Alex

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.