RGM BTree is an AI module for Unity which allows you to implement Behavior Trees for your Unity AI.
Asset Store: RGM BTree - Behavior Tree AI for Unity
11 Demo Scenes included, with detailed examples of various techniques such as navigation, waypoint following, chasing, and combat
Behavior Trees are an advanced form of AI which allow for the selection of a “behavior” (or state) on each Tick of the tree system.
In RGM BTree, you define the frequency of the Tick, which can occur as frequently as every Update, or (for example) once per turn in a turn based game.
Behavior Trees are different from Finite State Machines (FSM) in that FSMs have a rigid set of states and transitions between each state, while Behavior Trees can be very fluid and dynamic in their selection of behaviors. In addition, Behavior Trees allow for basic operations before selection, and can also run multiple behaviors at the same time.
Elements in a behavior tree return one of three states at the end of each Tick:
-
Running - the element has work which needs to continue on the next Tick.
-
Success - the element completed its work successfully
-
Failure - the element failed to complete. This does not mean the element had an error, only that it could not complete successfully.
-
For example, an element which searches for a nearby GameObject would return Failure if no GameObject was found.