Questions about Blackboard asset

Q1)
Among the properties of the Variable added to the Blackboard asset, there are Exposed and Shared. How are these options used? I cannot understand what will change even if I change the option values.

Q2)
We can use multiple Blackboard assets in a Behavior Graph, which one does BehaviorAgent.BlackboardReference refer to?

Q3)
How do I change the value of a Variable registered in a Blackboard asset in C#?

Q4)
I can combine multiple Action nodes. In this case, how does the return value of each node affect the execution order of the combined Action nodes? What is the main purpose of merging Action nodes?

Q5)
I want to implement a specific logic as a Sub Graph. For modularization, I also want to process the logic that terminates the execution of the Sub Graph in the Sub Graph. How can I terminate the Sub Graph itself and move the execution order to the parent graph?

Hello @MOBILIN

Thanks for your interest, let me try to cover your questions:

The Expose option makes a Blackboard variable available in the Inspector window under Behavior Agent .

The Shared option marks a variable in the Blackboard as globally shared across different instances of the behavior graph.

For more details please refer to the documentation: Create and manage variables and Blackboards | Behavior | 1.0.6

It refers to the blackboard that is embedded by default in the BehaviorGraph. Any additional linked blackboards are currently not available by code.

I will link this other thread: Behaviour Graph Events to GameObjects without Behaviour Graphs - #2 by MorganHoarauUnity

It is not directly answering your question, but the idea is the same. You need a reference to a particular instance of BehaviorGraphAgent to retrieve a BlackboardVariable from it. From there you can work directly with a reference to the value (using BlackboardReference.GetVariable or BlackboardReference.SetVariableValue).

I assume you are referring about the ability to stack action nodes on top of each other. One of the goal of the tool is to make the creation and maintenance of Behavior Tree easy, and we believe that making it easier to read as one of the way of achieving that. As such, we got rid of redundant connectors by allowing users to stack nodes to create implicit sequence of action. This way you can read your action like a text, from top to bottom.

  1. RunSubgraph node will run as long as your Subgraph is running. So if all of your subgraph branches have ended or are aborted, the RunSubgraph node will be able to end.
  2. It is possible to inject variable in your Subgraph. This way it is possible to send a value that can be set in your subgraph that would cause the parent graph from aborting its (the subgraph) execution.

Something that is done in the Demo is actually using this mechanism to send an Event Message to an Event Channel to allows the Subgraph to run in the background while running another state in the parent graph (see B_Character_Attack_Combo graph - more specifically how the combo subgraph is able to send the parent B_StateMachine_Character back to it’s idle state without stopping it’s own execution).

Hope this helps! Don’t hesitate if you have more question :slightly_smiling_face:

1 Like

Yes, Embedded Blackboard Variable works as you said.
My question was about Variable registered in Blackboard asset registered in Embedded Blackboard. Changing the Expose/Shared property of Variable in Blackboard asset is not shown in Inspector, and Blackboard asset itself does not appear in Inspector.

Thanks for clarifying. In regards to that particular issue, we opened an internal ticket after another user requested the same. I’ll add this thread to the ticket and upvote the ticket.

I cannot say when we will be able to tackle this particular feature atm.

Thanks for your patience :slightly_smiling_face: