Reply To: Setting up AI with FSM top-level and BT's sub level + related questions

NodeCanvas Forums Support Setting up AI with FSM top-level and BT's sub level + related questions Reply To: Setting up AI with FSM top-level and BT's sub level + related questions

#10540
jalex19
Participant

Awesome thank you this is very helpful. I wrote my own “CheckVariable_IDamageable” class before seeing your reply about the Preferred Types editor-that thing is really slick!

I do have a follow up question below, but for context this is how my graphs look now.

FSM

Wander And Wait

While in Wander/Wait, he’s constantly checking for a player in his view cone (for right now parameters hardcoded in Find Target condition). I suppose I probably don’t need that Dynamic sequencer anymore. Most of the time that will fail and he will then roll a float between 0 – 1 to see if he should idle. He has a 70% chance to satisfy that check which means he will skip out of that selector and move on to wandering, doing the roll/wait check only upon reaching his point. (This was a little counter intuitive to me at first but I think I’m getting it now 🙂

And then in the FSM as soon as the Target variable is !null it switches out of that BT and into the Attack Target BT.

Ok Follow up question:

When the spider sees the player, I want it to do a one time action of “warning” (play an animation where it rears up a bit on its hind legs, plays a scary sound etc) before it pursues, and attacks the player (and currently it will *always* pursue after this).

What I’m wondering is should this be part of the AttackTarget BT, or should this be a separate State in between Wander and Wait and Attack Target. This model of FSM + BT is new to me, and I come from a background of FSM, so by default I was thinking a separate state, but I want to make sure that I’m using BT’s to their full potential as well.

If it would fit on the BT, how do I set that up so that it only happens once at the start of the state (while the pursuing and attacking logic keeps firing)? Or is this desire simply an indication that I should use a state instead of a BT?

Ok, now to build out my AttackTarget state!

I’ll upload a little video when I get all this done to show them in action, and that’s probably also the time I’ll leave my review 🙂