You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a BTRoot as child of this node, and some behavior tree logic in it
In another scene script, add an instance of the above node
Create a blackboard in script, add some values in it, and assign this blackboard to the node's tree
Run the scene
The assigned blackboard is not the same as the tree blackboard at runtime ; its a copy. By doing this, it's not possible to share a blackboard between trees if the blackboard is not assign from Godot Editor.
One way to fix that is to change blackboard type in BTRoot from BTBlackboard to NodePath, like the actor
The text was updated successfully, but these errors were encountered:
We can't share a blackboard because, when setting the blackboard variable in BTRoot, it does not propagate to the real blackboard (_blackboard) : easy to fix
Once we do that, we can share a blackboard quite easily. BUT, there is still an issue ; trees that share the blackboard will store datas in it
When it's user data, it may be important or not, but it's shared
When this is a BTRoot, it contains data that make the tree work (running children ,...). We can't share that sort of thing
To solve that, the blackboard should have a sort of namespace in it ; when storing / retrieving data, you can set in which namespace the blackboard is working. Data in different namespaces should be totally separated.
To preserve the current API, the get_data and set_data can have a thrid parameter, namespace with a default value, to store datas in the default namespace.
Scenario:
The assigned blackboard is not the same as the tree blackboard at runtime ; its a copy. By doing this, it's not possible to share a blackboard between trees if the blackboard is not assign from Godot Editor.
One way to fix that is to change
blackboard
type in BTRoot fromBTBlackboard
toNodePath
, like theactor
The text was updated successfully, but these errors were encountered: