   Managing Player States
  Hello everyone, please excuse my ignorance and inexperience but I am somewhat trouble by managing a players state for animation/action purposes.Basically, my question is this: For a traditional hack and slash RPG style game, how do most people or what is the most efficient way to deal with state management?My basic thought process is to make several "Layers" if you will.  Each layer would be a basic action group/layer, ex: Movement, Attacks, Actions.... etc.  Within each layer there would be several states, Movement -> Idle, Running, Dodging, etc.  Attacks -> Idle, Standard, Fireball, etc.  Then, as input is processed, each state is set.  The idea behind layering would be that each layer could only have one state, eliminating some processing in terms of what can happen at the same time.  Then, as each state is set that particular state can check to see if any other current state interferes or cannot occur simultaneously.  I figured I would use enumerators to accomplish this.Is this generally the concept I should be going with?  Is there a better way to do this?  Any help is greatly appreciated, and thanks in advance for any help you do have to offer.Also, if my question is unclear, just ask and I will try and develop it further.Thanks!   
  I don't know what language you are using but I would be tempted to go for an OO approach with this sort of thing. So taking your example of Movement and Attacking being two separate set of actions that could be happening simultaneously I might have a base MovementState and a base AttackState that provide interfaces for performing their respective actions. I can then derive from those base classes and implement the specific details of each individual action.Managing them would be a case of storing a list of the different "layers" and the current state associated with them in some sort of player object. You can then control which states may be started/stopped although you could also do this within the derived state itself and thinking on it that might be a better idea. You could tell the current state which state you want to change to and then the current state can decide whether the state you want to change to is conflicting in any way.EDIT: As an example of a potential conflict: You may implement your dodging state to ignore any movement state change requests as your player character can't start running whilst their in the middle of rolling away from something. You can have some sort of system to allow a state to signal to the player that it has completed whatever thing it wanted to and the player should revert to a default state. This would be useful for temporary states like dodging or performing a specific attack.   