How to Make a Turn-Based Combat System
Turn-based combat is a state machine with a damage formula attached. Here are the turn order models, the formulas that scale and the edge cases that break battles.

Key takeaways
- Choose a turn order model first (side by side, speed initiative, or a timeline) and show the upcoming order on screen.
- Build the battle as an explicit state machine with a queue of actions, so deaths, statuses and multi-hit attacks resolve in a predictable order.
- Show enemy intentions before the player acts. Telegraphed turns turn guessing into planning, which is the reason turn-based combat is fun.
A turn-based combat system lets each combatant act in order: choose an action, pick a target, resolve the effect, then pass control to the next combatant until one side is defeated. To build one, choose how turn order works, model the battle as a state machine that processes one action at a time, write a damage formula that scales with stats without breaking at the extremes, and give players enough information about what enemies will do that each turn is a decision. The rest (statuses, items, animations) hangs off those four parts.
Our RPG guide covers how combat fits into stats, quests and scope. This article is the combat system itself.
Three turn order models
- Side by side. The whole player party acts, then all enemies act. Simple, easy to plan and the norm in card-based and tactics games. The risk is alpha strikes: a side that acts first can win before the other moves.
- Speed initiative. Each round, combatants act in order of a speed stat (with a small random tiebreak). Speed becomes valuable, and buffs to speed change who acts first. Recompute the order every round, not once per battle.
- Timeline (charge time). Each combatant has a counter that fills by its speed; whoever reaches the threshold acts, then their counter resets by an amount depending on the action. A fast character can act twice before a slow one. Heavier actions can cost more time. Show the next 6 to 10 turns on a visible timeline, or the system is opaque.
Whatever the model, show the order. A row of portraits at the top or side of the screen, updated when buffs or deaths change it, is what lets players plan two moves ahead.
The battle as a state machine
Most turn-based bugs come from code that does too much at once. Structure the battle as explicit states, and have every effect go through one action queue:
- 01Start of battle: apply passive effects, set up turn order.
- 02Start of turn: for the active combatant, tick start-of-turn statuses (poison, regeneration), check if they are stunned or dead.
- 03Choose action: the player picks from the menu, or the enemy AI picks. Nothing changes the battle in this state.
- 04Resolve: push the action onto the queue. Process the queue one item at a time: each hit, each status application, each triggered reaction (a counterattack, a thorns effect) is its own queued item.
- 05End of turn: tick end-of-turn statuses, decrement durations, remove expired effects.
- 06Check victory or defeat, after the queue empties, then advance to the next combatant.
The queue is the important part. Reactions append to it instead of running immediately, so a counterattack that triggers another counterattack resolves in order and cannot recurse forever (cap the chain, for example at 10 reactions per action). Animations play as each queued item resolves, so the screen always shows what the logic just did.
Damage formulas that scale
Two families of formula cover most games:
- Subtraction: `damage = attack - defense`, with a minimum of 1. Easy to read, and every point of defense is felt. But it breaks at the extremes: once defense approaches attack, damage collapses to 1, and stacking defense makes characters invulnerable. Good for small games with tight stat ranges.
- Ratio: `damage = attack × (100 / (100 + defense))`, or `attack × power / defense` for skills. Each point of defense matters a little less, and damage never hits zero. Scales well across long progression. Harder to compute in your head, so show the result.
- Variance: plus or minus 5 to 10 percent. Enough to avoid robotic exact numbers, small enough that players can count turns-to-kill.
- Critical hits: 5 to 10 percent chance, 1.5x to 2x damage. Higher crit rates make damage unpredictable; keep them for builds that invest in them.
- Accuracy: consider removing misses entirely, or keeping them only on specific risky skills. Misses on basic attacks are output randomness, which tends to feel bad; our guide to fair randomness explains why and what to do instead.
- Elements and weaknesses: 1.5x for a weakness, 0.5x for a resistance. Show the multiplier on the target when selecting it.
Status effects
Statuses are where turn-based combat gets its depth. Model each as data: an ID, a duration in turns, a tick timing (start or end of the owner's turn), a stacking rule (refresh, add duration, or add intensity), and its effect. Common ones and sensible values:
- Poison or burn: damage each turn, 5 to 10 percent of max health, or a fixed amount that stacks by intensity and decreases by one per turn.
- Stun or sleep: skip the next turn. Give the target resistance afterward (immune for one turn, or reduced chance) to prevent stunlocks.
- Shield or block: absorbs damage before health, usually removed at the start of the owner's next turn.
- Buffs and debuffs: plus or minus 25 to 50 percent to a stat for 2 to 3 turns. Small changes like 10 percent are invisible to players.
Show what enemies will do
The best modern turn-based games show enemy intents: an icon above each enemy saying what it will do next turn (attack for 12, block, buff an ally, charge a big attack). Players stop guessing and start solving: 'I can take the 12, so I attack the healer first'. If you show one thing, show incoming damage numbers. This is common in deckbuilders, and it works for any turn-based game. Enemy AI then becomes a simple pattern per enemy type (attack, attack, block, big attack), which is easier to write and to balance than a clever AI.
Edge cases that break battles
- Dead target. The player chose a target that died earlier in the queue (for example to a counterattack). Retarget to a random living enemy of the same side, or fizzle; never hit a corpse.
- Death in the middle of a multi-hit attack. Stop the remaining hits on that target, or redirect them. Decide which.
- Both sides die at once. Poison kills the last enemy and the last hero on the same tick. Decide who wins (most games: the player).
- Death on its own turn. A combatant killed by start-of-turn poison should not then act.
- Turn order changes mid-round. A speed debuff or a death changes the order. Recompute the remaining order, and make sure nobody acts twice or is skipped.
- Infinite loops. Two reactions triggering each other. The reaction cap in the queue prevents it.
- Input during animations. Lock the menu while the queue is resolving, but let players speed up animations: a 2x or 3x battle speed toggle and a skip are expected.
Pacing and feel
Turn-based does not mean slow. Each action animation should take 0.3 to 0.8 seconds, with damage numbers on impact and a short hit flash. Enemy turns should resolve quickly, and the player's menu should remember the last action and target, so repeated attacks are one tap. A typical normal battle lasts 30 to 90 seconds; much longer and players start avoiding fights. Turn-based systems also suit async multiplayer, which our online board game guide covers.
A brief to paste
Build a turn-based battle system for my fantasy RPG. Party of 3 versus up to 4 enemies. Turn order by speed, recomputed each round, shown as a portrait row at the top. The battle is a state machine (start of turn, choose action, resolve, end of turn, check victory) with an action queue where hits, statuses and counterattacks are separate items, capped at 10 reactions per action. Damage = attack × skill power × 100 / (100 + defense), plus or minus 8 percent, crits 8 percent for 1.5x; no misses on basic attacks. Weakness 1.5x and resistance 0.5x, shown when targeting. Statuses as data: poison (8 percent max HP at turn start, 3 turns), stun (skip a turn, then 1 turn immune), guard (halves damage until your next turn), attack up (plus 30 percent, 3 turns). Each enemy shows an intent icon with its next action and damage. Dead targets retarget to a random living enemy. Battle speed toggle 1x, 2x, 3x. The menu remembers the last action and target.
Frequently asked questions
What is the best turn order system for a turn-based game?
It depends on the game. Side-by-side turns are the easiest to plan and suit tactics and card games; speed-based initiative rewards a speed stat; a timeline lets fast characters act more often. Whichever you pick, show the upcoming order on screen.
What damage formula should I use for turn-based combat?
Attack minus defense with a minimum of 1 is easy to read but breaks when stats grow. A ratio such as attack × 100 / (100 + defense) scales better over long progression and never reaches zero.
How do I make turn-based combat less boring?
Show enemy intents so every turn is a decision, keep normal fights under about 90 seconds, add statuses that create combinations, and offer a battle speed toggle so animations never feel slow.

