Reply To: Question about BT node arrangement

NodeCanvas Forums General Discussion Question about BT node arrangement Reply To: Question about BT node arrangement

#11274
jonc
Participant

Of course 🙂

What I’m trying to achieve is that the agent works through a very simple checklist of needs and when one need is satisfied it can look at the next, so very rudimentary. Let’s say thirst & hunger are at 100 and stamina is at 0 which equals my scenario in Unity.

That’s what is happening:

Seq1 (Thirst Sequence): thirst >= 80 ? true -> owner.Drink() (which doesn’t return success by itself it just decreases the thirst value, that’s the reason for the last condition) (which returns success instantly) -> thirst < 20 ? We drank enough so return success, which it wont, or so fast, I can’t see it and it jumps back to thirst >= 80 ? which is false and then it just hangs there until the agent is thirsty again.

So, the main sequencer works through the thirst sequence again until there is no Drinkable left in the scene, it ignores hunger and stamina completely.

I’m very excited about behaviour trees and grateful for any lecture!

EDIT: Just wanted to clarify, the Owner.Drink() method is no NodeCanvas Action and it indeed returns success instantly, then it goes on to the “thirst < 20 ?” condition.