Tag Info

New answers tagged

0

First off, I think you should clearly define which are the states of your character and what are just actions that can be executed but don't change the state of the player. For instance, running is a state. But I wouldn't consider using a potion a state, just an action that affects the character in some way. Usually I would consider attacking an action and ...


1

What if implementing the HSM with a stack of states for each entity you have in the game? public final class StateStack { private List<State> states = new List<State>(); public void PushState(State newState) { states.Add(newState); } public State PopState() { State topmostState = null; if (states.Count ...


0

Behavior Trees are a great way to structure your behavior, but they can suffer from excessive "checking", as you point out. By design, a BT will jump to another branch in the tree if a higher priority behavior becomes available, so the implementation needs a way to check if that's the case. The easiest and safest way to do it is by polling. The BT will ...


0

Every game has different design challenges. I would start by drawing out a flow diagram of events. A Behavior Tree typically uses high level "composite" nodes. You can then build out these "composite" nodes into sub-trees. For instance: [sequence] --> [Am I Under Attack?] --> [Flee] The nodes "Am I Under Attack" and "Flee" are composite nodes. You ...



Top 50 recent answers are included