So lets start simple with a first gen tree, from what I understand the tree is ticked from the root every think cycle. Sequences and selectors maintain a memory of the current child they left off on since the last tick, and when hitting that sequence or selector again we just continue with the evaluation of that child subtree until it succeeds or fails. After something like a sequence or selector has succeeded or failed the current child node indicator is reset to point at the first child again.
So a tree like this is problematic:
selector
--sequence
----Cond(Health low)
----SubTree(Flee)
--sequence
----Cond(Has target)
----SubTree(Attack)
--Subtree(Idle)
Here the conditions would be checked only once when entering the sequence, so we could not react to changes unless the subtree failed (e.g. attack). For example if we entered the first sequence, checked the condition (which at the time was true), the entered the Flee subtree, that condition would not be checked again until we either succeeded or failed that subtree (which would only have the condition checked once we re-entered the parent sequence later on).
Another way to approach this would be something like this?:
selector
--parallel
----[Not]Cond(Health low)
----[Not]Cond(Has Target)
----SubTree(Idle)
--parallel
----Cond(Health low)
----[Not]Cond(Has Target)
----SubTree(Flee)
--parallel
----[Not]Cond(Health low)
----Cond(Has Target)
----SubTree(Attack)
This seems horribly convoluted, and would get even more complicated for more subtrees i might need to bail out of in this subtree selection.
I heard something about ActiveSelectors being able to always take the highest priority subtree that continually checked conditions will allow, but I am a bit confused on how this wold be implemented (sequence and selectors seem pretty straight forward in their implementations).
Anyone have any insights?
Edited by Ender1618, 25 September 2012 - 09:36 PM.






