NodeCanvas Forums › Support › Multiple or shared blackboards
Tagged: blackboard shared
Hello, I’m an A.I. developer and I’m using Node Canvas to define the high level A.I. FSM that controls the A.I. I recently split some weapon control out of the A.I. FSM and into its own FSM that is attached to the weapon game object that gets instantiated at runtime. The FSM owner and flow script controller are both disabled on the weapon prefabs and when I instantiate the weapon onto the attach point of the A.I., I grab those components and manually set the blackboard so that the A.I. and weapon share the same blackboard. This was an improvement over prior organization but one undesired side effect is that the division of data(blackboard variables), is not ideal. As you can imagine a state machine that controls a weapon could vary immensely by the weapon type, and that variety ideally could take the form of a blackboard on the weapon with weapon specific variables defined in it. On the other hand, there are a set of variables on the base A.I. that I do want to share with the weapon, which is the whole reason I am setting the weapons blackboard to the A.I. currently.
I feel like going back to independent blackboards would complicate the situation in certain ways, so I was wondering if you had any suggestions here. One idea I had that might be a suggestion for the developer might be to provide a field on a blackboard to set another blackboard reference, such that GetVariable calls could follow up a chain of references, which would theoretically give me the best of both worlds. Weapon and A.I. blackboard independence, and yet the weapon can still read from the A.I. blackboard seamlessly.
It looks like GetOtherBlackboardVariable is about the only thing out of the box that can be utilized in this situation, but the way it’s set up is a bit convoluted, so I wanted to see if I understand this properly.
Looks like I basically need to set up a concurrent task to copy the variables I need in the weapon blackboard from the parent blackboard, correct? There doesn’t appear to be a similar mechanism for conditions that one could use to pull variables from another blackboard.
This seems a bit more convoluted than it ideally would be. Any reason why the various blackboard condition functions don’t provide this functionality as well? (CheckBool, CheckEnum, etc). It seems unnecessary to require the values be copied into the blackboard, but maybe there is a reason for that I’m unaware of. Perhaps you would consider it a feature request. It would save a lot of wasted concurrent task work not to have to blindly copy data constantly and instead let it get fetched only when the conditions are evaluated.
Related to this, might I also toss out another posssible feature request?
Suppose you could set a ‘parent’ blackboard on a blackboard, then the GetVariable functions could follow up the parent chain if they did not find the variable within the current level. This would hide the data location from the actual graphs and keep them clean from blackboard variable copy tasks and such and let the graphs treat the blackboard tree as a hierarchy of data. Obviously setting a parent blackboard would be entirely optional. This approach seems like it could be the least impactful.