Hey guys , hope you’re fine !
I actually need some clear explanations about behavior trees : after reading the documentation , and checking some trees i still don’t know what is the difference between tasks decorators and services , and what is backboard ? ( it’s for storing values , but on projects it is use as function like " HasBeenHit " for example ).
Can someone explains it to me please ?
At the moment for me it is :
task : a function that is a tree’s leaf
decorator : a function that is a tree’s node
service : a recursive function that is a tree’s leaf
blackboard : an “array” of values , but also a function
ps: i’m c++ programmer
Behavior Trees are a way of controlling execution flow within AI, particularly decisions. You use these tools task, decorator, service, and blackboards to operate this flow.
A typical tree contains a root, which is the entry point of the execution flow. This then trickles down to composites which are the branches of the tree. These hold your decorators, and services for recursive execution & flow control. Finally the results of these conditions lead to a Task.
Task are composites which are composed of Selector, Sequence, and Simple Parallel. Selectors takes an execution, execute each of its leafs and returns whenever a Task(leaf) succeeds. Sequence takes an execution, executes its children and returns whenever a Task(leaf) fails. Simple Parallel takes an execution, and attempts to call two child task at the same time. In reality the subtree or second node is called immediately after. The first node on the left of this composite cannot be a subtree.
Blackboards simply allow your Behavior Tree to easily access to shared variables.
Leveraging the power of a BT allows you to easily create AI which can react to live-data. Not only can the AI act on the data immediately, but by structuring your trees hierarchy with alternative fail-safe behavior in mind allows you to create unique and responsive AI.