Good pattern to "wait" or pause?

Fashtas

New member
I am trying to work out the "best" way to have a tree "wait"

Essentially I have a creature, it can look around, respond to seeing or hearing an enemy, attack if attacked, and randomly wanders around it's patrol area.

The wait part comes in to where I want it to STOP and wait for a bit once it reaches it's destination before deciding on a new point and wandering there.

My current trees are all working fine, currently using a wait task and conditional aborts to exit the wait if something interesting happens but is there a better way to introduce a pause in a tree without a forced wait task?
 
You can pause the entire behavior tree:


But it doesn't sound like that is a good use case for this situation. One other alternative would be to add a waiting feature to an abstract task and then inherit all of the tasks that can wait to that abstract class.
 
Yeah pausing the entire tree isn't really an option, essentially I was wondering if I was doing things the wrong way and the tree should be processing constantly, just not doing anything while idling.

However the Wait tasks works perfectly, and any change in circumstances that should be interrupting the idle NPC do so... working as I want it without any real downside so I guess working correctly!

Thanks!
 
Top