This screenshot is from unreal docs of behavior trees: Behavior Tree Overview | Unreal Engine 4.27 Documentation
What I do not understand in this example is the node BTT_FindRandomPatrol which I assume finds a random waypoint to move to.
If this node is executed in a sequence wouldnt it mean that the node will be executed every frame since the tree is usually executing from root to its leaves every frame. To me this logic would end up in the npc picking random waypoint everytime, while moving or waiting. Am I not correct?
Assuming no aborts, the behavior tree usually only executes one task at a time until that task has called finish execute. So, if the Move To task after the BTT_FindRandomPatrol task hasn’t called finish execute, then BTT_FindRandomPatrol would not be called again. And, the same with the Wait task after that.
Though, it is frequently hard to tell exactly what a behavior tree does with just an overview like this with user-made task names. The code in user-made tasks could be anything. But, assuming that BTT_FindRandomPatrol doesn’t have something strange in it that would make it loop a bunch of times before calling finish execute, then it should only find the patrol spot once before starting Move To task.