- Home /
Too subjective and argumentative
Multiple States or Fewer States
So I am developing a bit of a complicated game involving Mario Galaxy style mini planets with localized gravity with third person shooter mechanics on top.
I've successfully made the prototype but want to streamline everything once I start moving to actual production. The heart of my question is about states/state machine(s) governing the character - should there be only one or a few all encompassing state(s) on the character at once to describe its behavior and influence the other scripts attached (such as, inSpaceThrusting, groundedShooting, etc) or should there be multiple state machines governing each different aspect of the character (such as a state machine to just cover physics related states such as Grounded, inSpace, Falling, Thrown, etc - along with state machines for different movement related things, different combat related states etc etc).
Currently with the prototype it's a bit of a mess. There's a state machine which covers all movement including physics and gravity (Jumping, Falling[assumes in a gravity body], Grounded) while the controls behavior are kind of buried in a bunch if/else statements depending on the current gravity state.
Follow this Question
Related Questions
What is the best way to implement user input and movement when using a State Machine pattern? 1 Answer
Making floating specks for space movement 0 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Endless Runner Static Or Moving Player 0 Answers
Infinite Moving/Rotating Question 1 Answer