Hi! I need some advice… and I’m sorry about the long post.
I’ve finally finished up my assets (Motion Controller, Mount Points, etc) and I’m getting back to my actual game. I want to use your solutions to create some credible AI that ties all my assets together. To do this, I’ve also created some new things to support RPG-style attributes, sensors for “seeing” and “hearing”, memory, etc.
I’ve created a fair amount of BT conditions and actions. So, I’m comfortable with all that.
What I’m having a hard time with is figuring out when I should use BTs vs. SMs vs. FlowCanvas vs. some manager I create in code.
I want NPCs to have a life of their own. That means there’s high level “in combat” states, but then there’s some detailed control that needs to happen. Take combat for example… I’m looking to do something like Batman Arkham. Meaning attacks, blocks, and counters. This means one NPC should understand when another NPC is attacking, if they’re in the window of time to block, and if they can counter-attack. It will all be pretty fast paced. So, there’s a mix of high-level life management as well as detailed combat control.
Using BTs alone, I’ve got it where one NPC sees another, determines if he’s an enemy, determines the threat level, runs away or draws sword, etc. I haven’t gotten into the true combat part yet. But… I’m finding I’m making “if” statements in BTs using Sequencers. I’m just feeling like I may be going down the wrong road.
I know we can use any of the “canvas” tools any way we want, but I’m looking for some advice. Where do you think I should be switching between BTs, SMs, FlowCanvas, etc?
Hey!
Sorry for the late reply.
That’s a nice question indeed 🙂
My personal suggestion regarding on where to use what, would be to use FSMs at the top higher level to define the different very broad states that a character can be in, like for example, “Gather”, “Combat”, “Idle”, with each of these states being a Sub-Behaviour Tree, or a FlowScript state, which are better for defining precise behaviours than FSMs are.
So, once again, for complex behaviours, I would always use an master FSM at the topmost level and have each FSM state either be a Behaviour Tree state, or a FlowScript state depending on what you feel comfortable with or prefer over the one.
I would personaly never use a BT with nested FSMs (and I think I will also remove that ability in future version), but is some relevant non-complex behaviours, I might simply opt to use a single Behaviour Tree or FlowScript and forget about nested graphs.
Regarding BehaviourTrees vs FlowScripts, I would use FlowScripts when the behaviour is heavility based on events rather than conditions. For behaviours based on conditions (like for example checking variables, distance between objects, etc), I would use a Behaviour Tree instead of a FlowScript.
I like this of FSM’s as top level and BT’s as sub-level. I’m new to NC as of today but I’m going to try to hook a basic Wander, Idle, Attack AI up to this, and will probably post questions about it in the support forum as I get stuck 🙂
Author
Posts
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.