Skip the third paragraph if you don’t require context.
I have attempted many times to develop a combat system as fluid and responsive as games like Strongest Battlegrounds, Combat Warriors and Deepwoken. Generally the programmatic components (like a state machine, cooldowns, hitboxes etc.) come naturally after playing these games for so many hours but after implementing what I thought made up these games, I became very unsatisfied with how they felt.
Every time I start from scratch with these combat systems, I find it hard to keep track of all the states the player should be in, when to reset cooldowns, when to hit-stun, I-Frames etc. Following tutorials isn’t too much help either because they walk through the code rather than the systems behind the code.
In short, I’m asking if anyone has a state-machine diagram/graph or a guide that’ll help me keep track of what makes these smooth combat systems. I want something that I can follow and check against rather than simply play testing these games because its very hard to tell and see exactly what is happening under the hood.
I’ve made the most progress with this game in terms of animations, feedback and general feel but I can also tell that this wouldn’t feel very nice to use especially when its so centric to the game. Its not necessary (or what the post is for), but If you know or have good experience with combat systems, fighting games etc. I would love if you could test out the combat in my game for a few minutes and give feedback as to what’s missing, what needs work and any reference material you know of.
1 Like
Break your combat system into these core layers:
State Management: Create clear states (Idle, Attacking, Stunned, Blocking, Dashing, Invulnerable). Use enums and ensure only one combat state is active at a time. Track state entry/exit times.
Priority System: Assign priorities to actions. Stun > Block > Attack > Movement. Higher priority states can interrupt lower ones.
Timing Structure: Use tick-based or time-based counters. Track: attack startup frames, active damage frames, recovery frames, cooldown duration, stun duration, i-frame duration.
Buffer System: Store player inputs during animations. Process buffered inputs when current action completes. This makes combat feel responsive.
Hit Detection: Separate hitbox activation from animation. Enable hitboxes only during active frames, disable immediately after.
Reset Conditions: Clear cooldowns on state transitions (death, respawn). Reset i-frames when entering vulnerable states. Clear stun on knockback completion.
Start by documenting your states on paper with arrows showing valid transitions. Add timings to each transition. This visual map will keep you organized as you code.
4 Likes
This is extremely helpful, to add onto it, do you have any kind of diagram or plan that you use yourself?
although he did hit some key points, i don’t think the AI he was using has an answer…
in fact, most of his responses on the devforum are using AI. hell, even the profile and the website in his profile are using AI. so i don’t recommend you to reply or take a reply from him.
anyways:
you eventually will have to train your eye and playtest the games to get a gauge on how they handle their combat backend. for example The Strongest Battlegrounds is heavily client-based because of how customizable certain aspects of the game are, and how you can just move around moves and get different movesets. Combat Warriors, as a another example, is a hybrid approach, since you can customize some visual mechanics on the game, but the core settings are locked to the server, like VFX and [spoiler]gore[/spoiler].
each person has their own learning style, so some tutorials may not help you. you are doing the right thing by looking for help but this is how you can get jumbled code by following other people step by step.
your best course of action is to write down how you handle your system currently, then write down how others handle their system. if there is something that doesn’t fit right with either approach, write it down in another approach. if you feel like you have the architecture down, then go ahead and do it. other people may have another way to do this, and maybe this way doesn’t work for you, but this is how i did my system.
8 Likes