News Forums RAIN General Discussion and Troubleshooting Help with BT, please. Trying to incorporate timer node.

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

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #11440

    ScriptGeek
    Participant

    I’m having a tough time figuring out how to get my behavior tree to set “exitEvade = false” after the timer, which is nested in after the constraintToFear constraint node. The timer seems to be running continuously and never exits once it is visited, even though the timer is set to 5 seconds. What could be the problem?

    Here is the export of my behavior tree:

    
    <behaviortree version="1.1" repeatuntil="" name="enemyAI"><parallel tiebreaker="fail" succeed="all" repeatuntil="" name="parallel" fail="any"><detect sensor=""enemyEyes"" repeatuntil="" name="detect" entityobjectvariable="formVar" aspectvariable="" aspectobjectvariable="" aspect=""Player"" /><selector usepriorities="False" repeatuntil="" name="Select Behaviors"><constraint repeatuntil="" priority="" name="Wander" constraint="formVar == null"><selector usepriorities="False" repeatuntil="" name="selector"><constraint repeatuntil="" priority="" name="constraintToWander" constraint="exitEvade == false"><sequencer usepriorities="False" repeatuntil="" name="sequencer"><expression returnvalue="evaluate" repeatuntil="" priority="" name="expression" expression="steering = 1" /><action repeatuntil="" priority="" parametervalues="" parameters="" namespace="(global)" name="actionWander" classname="EnemySteering" /></sequencer></constraint><constraint repeatuntil="" priority="" name="constraintToFear" constraint="exitEvade == true"><parallel tiebreaker="fail" succeed="all" repeatuntil="" name="parallel" fail="any"><sequencer usepriorities="False" repeatuntil="" name="sequencer"><expression returnvalue="evaluate" repeatuntil="" priority="" name="expression" expression="steering = 3" /><action repeatuntil="" priority="" parametervalues="" parameters="" namespace="(global)" name="actionFear" classname="EnemySteering" /></sequencer><sequencer usepriorities="False" repeatuntil="" name="sequencer"><timer waitforsec="5" returnvalue="success" priority="" name="timer" /><expression returnvalue="evaluate" repeatuntil="" priority="" name="expression" expression="exitEvade = false" /></sequencer></parallel></constraint></selector></constraint><constraint repeatuntil="" priority="" name="Evade" constraint="formVar != null"><sequencer usepriorities="False" repeatuntil="" name="sequencer"><expression returnvalue="evaluate" repeatuntil="" priority="" name="expression" expression="steering = 2" /><action repeatuntil="" priority="" parametervalues="" parameters="" namespace="(global)" name="actionEvade" classname="EnemySteering" /><expression returnvalue="evaluate" repeatuntil="" priority="" name="expression" expression="exitEvade = true" /></sequencer></constraint></selector></parallel></behaviortree>
    
    #11589

    Jester
    Keymaster

    Hello ScriptGeek!

    Check out our new RAIN 2.0.10 tutorials they incorporate a Timer Node

    http://rivaltheory.com/forums/topic/get-started-with-rain-2-0-10-video-walkthrough/

    Let me know what you think.

    Best,
    Jester

    #11610

    ScriptGeek
    Participant

    Thanks for the response, Jester.

    Those videos are extremely helpful, but they did not explain why my behavior tree was not working with my timer nodes.

    To make a long story short, I narrowed the cause of the timer node not working down to the Parallel node attributes being set to, Fail: Any, Succeed: Any, Tie Breaker: Fail. I got it to work by changing these attributes to, Fail: Any, Succeed: All.

    And after all the hours spent fussing with this problem it was something so simple.

    #11611

    Jester
    Keymaster

    I feel your pain on that front! How do you think we could make the system better to ensure simple mistakes like that don’t take so many hours to fix?

    Any feedback would be helpful

    Best,
    Jester

    #11614

    ScriptGeek
    Participant

    Well, I’ve tried troubleshooting using the behavior tree editor window and the AIRig script component GUI and I’ve noticed some strange things happening.

    1. The behavior tree editor will sometimes stop highlighting the current node path, forcing me to close the BT editor and reopen it to resume its highlighting feature.

    2. The AIRig script component GUI’s memory tab doesn’t automatically update the display for the variable values, which had me pausing Unity and clicking another AIRig script tab, then clicking back on the memory tab, and finally clicking the pause button for Unity to resume.

    An improvement suggestion for the BT editor is to try queuing up the node traversal and display node events in slow motion when Unity is being stepped through events while Unity is paused.

    #11616

    Jester
    Keymaster

    Thanks so much for the feedback I will send this over to the dev team

    Let me know if I can do anything for you.

    Best,
    Jester

    #11756

    ScriptGeek
    Participant

    Hmm, not sure if I should post this here or not… I’m looking at incorporating steering behaviors with RAIN. I found an article from last year that mentions RAIN{indie} having built-in steering behaviors.

    I’m very curious, does the new RAIN retain this functionality?

    I’m currently tinkering around with UnitySteer to see how I can get RAIN and UnitySteer to play nicely together.

    #11769

    ScriptGeek
    Participant

    I found the answer here. Steering behaviors were removed from RAIN. =(

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

You must be logged in to reply to this topic.