Can See and Within Distance not evaluating

greatstudios

New member
I am trying to evaluate my NPC to seek a hiding spot transform when she sees the wolf. With only the 'Can See' task, it works

1. However, I want to evaluate either Can See or Within Distance. Neither of them works.
2. Once I get these 2 conditions working, how can I continually check for when the wolf comes back. So far, once she hides, even if the wolf walks past her she doesn't evaluate again.

I've tried using the parallel and parallel selector tasks and nothing works.




only_can_see_works.pngcansee_withindistance_not_working.png
 
Can See Object on the left image isn't reevaluating because you have a lower priority abort. You should instead use a Self abort if you want it to reevaluate when the Seek task is active.

Your screenshot on the right doesn't show any branches active so I'm not sure what type of abort you need but because your selector doesn't have an abort type it is not going to reevaluate any of the tasks.
 
Can See Object on the left image isn't reevaluating because you have a lower priority abort. You should instead use a Self abort if you want it to reevaluate when the Seek task is active.

Your screenshot on the right doesn't show any branches active so I'm not sure what type of abort you need but because your selector doesn't have an abort type it is not going to reevaluate any of the tasks.
It's only a Wander task to the right. The branches In both the screenshots are on the same branch. I disable one when I test the other. Thanks for the clarification on the self abort.
 
Is that a different tree? If you want the left Can See Object or Within Distance task to reevaluate you should use a Lower Priority abort type. The Wander task is not in the same branch as the two conditional tasks so a Self abort type won't reevaluate. You can see if a task is being reevaluated by a circle around the X or checkmark.

I recommend that you watch the video at this page as it gives a good example of each type of abort: https://opsive.com/support/documentation/behavior-designer/conditional-aborts/
 
Is that a different tree? If you want the left Can See Object or Within Distance task to reevaluate you should use a Lower Priority abort type. The Wander task is not in the same branch as the two conditional tasks so a Self abort type won't reevaluate. You can see if a task is being reevaluated by a circle around the X or checkmark.

I recommend that you watch the video at this page as it gives a good example of each type of abort: https://opsive.com/support/documentation/behavior-designer/conditional-aborts/
I've been looking at your videos religiously and combing through the documentation as well. I try my best before posting questions.
I remade the tree but with the same intent.

For the lower priority in the tree, I have a self abort on the sequence node[for within distance and wander] but a lower priority on the selector node above it. Do you mean lower priority on the sequence as well?

Also,

1. I noticed the Within Distance node does not evaluate with the default magnitude of 5, as soon as I set it to 6 or higher it does evaluate.
2. The Flee and Wander tasks seem to attempt to sample random destination vectors outside of the NavMesh. My npc would go to the edge of the walkable terrain and would try to navigate. Obviously they can't do this, so they just stay there stuck.
 
Do you mean lower priority on the sequence as well?
If you want the leftmost Can See Object / Within Distance to be able to abort the rightmost branch you need a Lower Priority type on both the Selector and Sequence.

1. I noticed the Within Distance node does not evaluate with the default magnitude of 5, as soon as I set it to 6 or higher it does evaluate.
There isn't anything special about the default value so maybe the condition is true or false with a value of 5 but not 6?

2. The Flee and Wander tasks seem to attempt to sample random destination vectors outside of the NavMesh. My npc would go to the edge of the walkable terrain and would try to navigate. Obviously they can't do this, so they just stay there stuck.
The task does a SamplePosition before determining the destination. For this situation you may need to create a new task that knows the borders of your walkable terrain and if it is outside that area then it determines a new position.
 
Top