[RELEASED] Behavior Tree Extension: Run Behaviors with Parameters and More

TransparentLogo

Link to Marketplace / Documentation / Example Project

Ever wanted to run Behavior Trees with parameters? Start encapsulating your Behavior Tree logic and reduce boilerplate code while using new powerful features provided by the Behavior Tree Extension plugin.

Many projects go for more monolithic solutions instead of creating a separate Behavior Tree for each AI character. This leads to a huge Behavior Tree code that tries to cover everything, and it reduces your flexibility. Some projects prefer to create a Behavior Tree for each AI, but this time you have to copy-paste the same logic many times and this leads to boilerplate code that’s hard to maintain.

The Behavior Tree Extension plugin helps you encapsulate Behavior Tree logic by providing Run Behavior with Parameters tasks. The task reads every single service, decorator, and task within the behavior tree and exposes them to the Details panel, so you can modify the values within the editor.

This way you can easily reuse behavior logic in different AIs by simply tweaking the settings and avoiding copy-pasting the code. Other features of the plugin can also enhance your Behavior Tree experience.

Features:

  • Expose Behavior Tree parameters by using Run Behavior with Parameters task.
  • Create a Behavior Tree Instance object for modifying parameters similar to Material Instances.
  • Use Utility Selector and Blueprint Utility Score Calculator to use the utility system in Behavior Trees.
  • Take full control of how or when to calculate utility scores.
  • Use weighted random selectors to add controlled randomness to your behaviors.

Feel free to ask any question here. You are also welcomed to share your suggestions or feature requests!

2 Likes

This looks good but I don’t think it is a good enough way to reuse BT. The BT parameters are hardcoded, and what I want , for e.g walk speed, is to vary based on different characters (young man/old man). The values needs to be read from per character.

Hey overreal, thanks for the feedback! You could probably achieve this by designing the tasks or services in a specific way, such as reading those values directly from the character instead of exposing them. The purpose of this plugin is to give you the option to use a Behavior Tree logic many times without needing any other objects or sources, such as a data table or data assets. The plugin allows you to change these values via the node in the Behavior Tree by exposing them. If you want to keep it dynamic, you would probably do that by designing the relevant code in a way that reads from the character or any place you want to pull the walk speed value.

But if you have an idea that you think I could include in the plugin, I’d love to hear it. I can include it if it’s possible and feasible.

If he are using specific character BP’s for old people, or if those NPC’s are at least created with a specific ID. Could he not just set the max walk speed for them in AI controller with their own anim_BP/blend space for how they transition from idle-walk-run and so on?

The state they get like e.g run/walk will only tell them to switch to another speed and go to walk/run in the anim_bp. The animations can be different, and the speed those chracters have could be set based on what the max speed is given to them. And not through BT parameters?