Professional/Most Commonly used methodology of state systems

Basically, I’m just here to ask the question, without the usage of something like Reflex ( I don’t use VSC, and in the near future don’t seem myself using it for Roblox at the very least)

What is the most flexible and expandable method of dealing with States. E.G - Attacking, Blocking, Running

I’m asking this because I’m revamping my personal combat framework, and I’m just looking for the simplest way, that could be moved around in different games, and still keep that same level of effectiveness and ease of use.

Whether it be an FSM or a whole different system, just getting a bit more insight might be helpful for my journey of remaking my states I believe.

I was working on an RPG-like game a while ago and was creating a system for melee weapons that used a FSM internally. Each state had animations, sounds, etc. associated with it and would play automatically when transitioning into the next state. It focused only on the weapon attacks themselves so there were no states related to character movement like running or jumping.

I never fully fleshed it out but I think it worked really well for some pretty basic weapon designs. However, I did have two main concerns that I never got around to addressing:

  • Everything about the states was defined in Lua tables. I didn’t have a fancy state diagram UI to create and link new states. If the weapon I was designing was really complex, the states and the relationships between states started to get difficult to track and make sense of.
  • My game was going to have dual wielding (sword/sword or sword/shield). At that time, I only had support for using one FSM at a time. This meant that the state diagram for a combination of weapons would be even worse. Imagine a sword with 5 states that handle a few different swings. Now if you wanted to also swing while blocking with a shield, you needed to add those same exact 5 states but in a different condition where the player is blocking. It wasn’t really scalable. If I were to do it again, I’d probably have support for more than 1 FSM being active at a time and inputs would be sent to each individually. But even with this, the first issue I mentioned is still relevant.

Like you though, I’m also interested in knowing how other people implement combat systems. FSMs are pretty much all I ever consider when it comes to combat systems, so I’m curious to learn about other methods.

For me I had something similar, but states mainly belonged exclusively to the character and if I had to deal w/ stuff like interruptions or weapon actions I’d usually just opt for using normal variables.

I had all of these states, and it felt like the list was progressively growing more and more, and with the addition of useless patterns I put in addition with the existing states, it just made me feel as if I was included more and more unnecessary bloat. Along with the fact that some of the state system was inconsistent since some states (when activated/toggled), would have an action connected to that, and some of the states would just be a buffer to prevent certain actions from occurring. It was very conflicting, so now I’m on the journey to fix that.