Showing Specific External Behavior Tree Variables In Editor Window

drewv

New member
I am currently working on a larger scale game with over 100+ different NPC characters with unique combat patterns and I am trying to use external trees as much as possible for any shared series of actions or behaviors among the NPCs. This is because if my team ever decides we need to change how Patrolling works for example, I will only need to change our one "PatrollingBehavior" external tree that all the NPCs reference instead of having to make changes to all 100+ characters and their individual trees. So, I find myself using external trees very often, and one feature I'd like to request is that inside the external tree, you can flag certain shared variables to always appear in the editor window of the Behavior Tree Reference Task when you set the external behavior field to a specific external behavior tree.

I do like that variables in the external tree can already be overwritten on a case by case basis inside the behavior tree reference task by setting the size of the variables field, typing the name, and setting the correct type. As shown in the picture below.

1630457804186.png
And I do need this feature of being able to decide what the values will be for each instance of the external tree, but I feel that a lot of time and potential spelling errors could be saved if there was some way to flag variables in an external tree to automatically show up here in the editor window when that external tree is referenced. Would this be a difficult change? I am unfortunately pretty inexperienced with custom editors in Unity. I would also be okay with having all of the shared variables in the external tree show up here when it's referenced if that's much easier than specifying specific variables.

Either way, I would absolutely love to have this feature, as external behavior trees are so great for creating cleanly scalable AI and avoiding repetition. Streamlining the workflow of using them to encapsulate and parameterize any shared behaviors would be a great addition to this asset for catering towards larger scaled projects and faster prototyping.

P.S. I was so happy to see the addition of stacked conditionals in the last update! :) Thanks so much for that!
 
Last edited:
Thanks for the request! I have thought a lot about the in the past and one of the issues is that there can be multiple external trees within the same reference. In that case how you do handle it? What if the external trees use the same variable name but have different types? Also, you can override the GetExternalBehavior method to allow dynamic loading of the tree and in that case the parameters aren't know. This case is easier to solve as it would just show what we have now but the multiple external trees issue has stopped me from pursuing this feature.

P.S. I was so happy to see the addition of stacked conditionals in the last update! :) Thanks so much for that!
:)
 
Top