Hello,
I need some guidance on the best approach to efficiently run dynamic behaviors on an NPC.
Requirement:
As part of my game’s design, the NPC follows a predefined path, moving from one waypoint to another. At each waypoint, the NPC should execute a distinct behavior.
My Approach:
My current plan is to implement a Master Behavior Tree that includes a Run Behavior Dynamic child task along with other default waypoint tasks. At each waypoint, I create a behavior tree specific to that location and attach it to the Master Behavior Tree at runtime using the SetDynamicSubtree method.
Question:
Since my NPC frequently moves between waypoints, this approach requires frequent updates to the child behavior tree. Will this frequent subtree swapping introduce performance issues? Has anyone dealt with a similar requirement, and if so, what optimizations or alternative approaches helped maintain performance?