So in my time on roblox I've always stuck to testing and making prototype features for games, but I've never tried making one myself. Recently I began developing my own survival game, and it occurred to me that game development is a challenge on its own.
Whenever you implement a feature in your game, you have to think about it in context of the full game. The biggest challenge here is with determining the results from player input in context.
Let's say I want to include sprinting and aiming down a gun in my game. The problem starts when you begin to think about how these features have to behave when they overlap each other. Let's say that sprinting is bound to the control key, and aiming is bound to right click. These actions will be active when the player holds down either button.
Now we have to consider what happens when the player is sprinting and decides to hold down right click. Sprinting should get interrupted and the player will start aiming. But then what if they stop aiming while they are still holding down the control key? I want the player to keep sprinting so that the controls flow better for a higher quality user experience.
Now if I add crouching to the mix, then the possibilities increase exponentially. This gets even worse when you add GUI into the game.
I came up with my own solution for this problem by developing a service which allows you to create 'Context Groups' which explain whether an action is in context or out of context depending on the state of the game. I later learned that this implementation is called a 'non-deterministic state machine' , or at least I think it is. My approach definitely needs some work, and it is also still confusing to work with. Sorry I can't demonstrate how it functions better, it's quite complicated without writing a full article.
I was wondering if anyone here has any experience in game development, and if they had their own solution for handling complicated user input, or if there is an industry standard out there for indie game devs on roblox who don't have the luxury of behavior trees. I was also wondering if anyone has any advice on how to visualize complex user input and behavior in context, like with flow charts or spreadsheets. If you could also include some example/pseudo code to demonstrate your solution that would be a blessing. Thank you!

1 comment
You say you've created a service for creating context groups. I'm not sure entirely what you mean from your explanation, but it sounds a lot like one of the game services that already exist, ContextActionService. This service is extremely useful for handling input while taking the rest of the game into consideration, check it out on the wiki.