Can someone clarify how Blackboard Key Selector work and BTs?

I’m trying to use BT, actually converting my vehicle path following logic into a BT.
Basically I’ve set up an array with locations to follow for my vehicles, it works in BP flawlessly.

Now I’m trying to convert this logic into a BT because I want to see if it can be less CPU intensive (I aim to have like 15 - 20 vehicles all at once on the track).

So I put my nav points on the track, let’s say NP_00, NP_01 all the way to NP_18, and set up a key in the blackboard as object and select the nav point BP: NP.
Now, I can’t understand how it actually works, I couldn’t find docs about it: all the nav points are stored in the key and I can access them by Blackboard Key Selector node? Or I need to manually assign every nav point to the key and then feed it to the logic to move the vehicle?

When creating the asset in the content browser you right click go to miscellaneous and select blackboard. That is your blackboard data object. It is essentially a structure that has key:value pairs. When you make a behavior tree you assign it a blackboard data object to use (by selecting the root node I believe and choosing the one you want from a drop down) To use them in your decorator you select a blackboard key from the blackboard data. As a quick example say you have the following blackboard data.

[UnitData]
bool Attacking: false
float range: 0
float AnimLength: 2.31

A Blackboard decorator could be:
Key query: Is Not Set
Blackboard Key: Attacking

This will let you through if you are not attacking. if it fails the behavior tree will move to the next branch to the right. it’s up to your tasks, blueprint or services to set the keys to something though.

1 Like