1.3 – Behavior Tree Demo 1

<BehaviorTree name="BT_Test_2">
        <Filter name="Attack"> <!-- Attack the enemy if seen. -->
            <Condition id="SeeEnemy"/>
            <Action id="MoveToEnemy"/>
            <Action id="AttackEnemy"/>

      <Filter name="Investigate"> <!-- Search near last known position for 3 times. -->
        <Condition id="HaveLastKnownPosition"/>
        <Repeater limit="3">
            <Sequence name="SearchNear">
                <Action id="Wait" time="1"/>
                <Action id="MoveToLastKnownPosition"/>
                <Action id="MoveToRandomPosition" range="400"/>
        <Action id="ClearLastKnownPosition"/>

      <Sequence name="Patrol"> <!-- Randomly search. -->
        <Action id="Wait" time="1"/>
        <Action id="MoveToRandomPosition"/>

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *

The AI Project