Great work! This makes me excited to work on my NPCs. I had one idea. What if instead of jumping back to the same task when RUNNING is returned, it traversed through the tree again. task.start and task.end can fire depending on if another task returns RUNNING during the traversal.
Say an enemy NPC is in a wondering state and a player walks into their attack range. The NPC can’t detect any state changes from doing a tree traversal because it’s already running a task. The task itself has to listen for the state change which just seems unnecessary.
I’m new to behavior trees so I’m probably missing something.