Critical Hits
A critical hit is a hit that now and then does extra damage. Every hit gets one roll, and the hit is a crit when the roll falls below the crit chance. Bonuses from gear are added up before the chance and the multiplier are capped, and a crit always does at least one point more than a normal hit.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "Critical Hits" to my game.
What it should do: Crits add a little luck to every hit, so fights are not exactly the same twice, and they give gear that raises the chance or the damage a clear meaning. Used with care they add excitement without deciding a fight on their own.
Use these starting values:
- critChance: 0.1
- critMultiplier: 2
- chanceCap: 0.75
- maxMultiplier: 4
Watch out for these common mistakes:
- A chance above one hundred percent: Tell your AI: add up all the bonuses first, then keep the chance between zero and the cap.
- Multipliers that multiply each other: Tell your AI: add the bonuses together first and add the sum to the base multiplier. Then cap the result.
- A crit that does the same as a normal hit: Tell your AI: round the damage to whole points, then make the crit at least one point more than the normal hit.
- Rolling the dice again and again: Tell your AI: roll once when the hit lands, keep that roll with the hit and use it everywhere. Pass the roll in from outside, so the same roll always gives the same result.
- A roll that lands exactly on the chance: Tell your AI: a hit is a crit only when the roll is below the chance, not when it equals it. A roll is a number from zero up to, but not including, one.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
What it does
Crits add a little luck to every hit, so fights are not exactly the same twice, and they give gear that raises the chance or the damage a clear meaning. Used with care they add excitement without deciding a fight on their own.
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| critChance | 0.1 | The base chance that a hit crits, from 0 to 1. One in ten is often enough to be noticed within a fight and rare enough to feel like luck. Gear that adds to it has room to matter. |
| critMultiplier | 2 | How many times the normal damage a crit does. Double is easy to see and easy to balance: with a one in ten chance, crits add a tenth to the average damage. |
| chanceCap | 0.75 | The highest the chance can get after all bonuses. Three in four keeps a miss possible, so a build that stacks the chance does not turn crits into the normal hit. |
| maxMultiplier | 4 | The highest the multiplier can get after all bonuses. Without a top, a few pieces of gear can make one hit finish any fight. |
What usually goes wrong
A chance above one hundred percent
Gear adds chance on top of chance until it passes one hundred percent, or a penalty pushes it below zero. Nothing is wrong with the roll, but the numbers on the screen stop making sense.
Fix: Tell your AI: add up all the bonuses first, then keep the chance between zero and the cap.
Multipliers that multiply each other
Three pieces of gear that each say a crit does one and a half times more are multiplied together, and a crit does far more than any of them promises.
Fix: Tell your AI: add the bonuses together first and add the sum to the base multiplier. Then cap the result.
A crit that does the same as a normal hit
On a hit of 1 or 2 points, a multiplier of 1.25 rounds away to nothing. The player sees the crit flash and the number does not change.
Fix: Tell your AI: round the damage to whole points, then make the crit at least one point more than the normal hit.
Rolling the dice again and again
A hit with an animation of many frames rolls on every frame, or the game rolls again when the damage is shown. The player keeps getting new chances for the same hit, and the real crit rate is far above the one on the page.
Fix: Tell your AI: roll once when the hit lands, keep that roll with the hit and use it everywhere. Pass the roll in from outside, so the same roll always gives the same result.
A roll that lands exactly on the chance
The game counts a roll that equals the chance as a crit. At a chance of zero, a roll of exactly zero then crits, and the chance is never really zero.
Fix: Tell your AI: a hit is a crit only when the roll is below the chance, not when it equals it. A roll is a number from zero up to, but not including, one.
How to check it works
- A crit chance of one in ten and a hit of 10. The roll is 0.05: The hit does 20 and is counted as a crit.
- A crit chance of one in ten and a hit of 10. The roll is exactly 0.1, or higher: The hit does 10 and is not a crit.
- A multiplier of 2.5. A hit of 30 crits, and a hit of 7 crits: They do 75 and 18.
- A multiplier of 1.25. A hit of 1 crits, and a hit of 2 crits: They do 2 and 3, never the same as a normal hit.
- A crit chance of zero. Any roll comes, including exactly zero: The hit is never a crit.
- A base chance of one in ten, a bonus of 0.9 and a cap of 0.75. The roll is 0.74, and then 0.76: The first is a crit and the second is not.
- A multiplier of 2 and a bonus of 1 from gear. A hit of 10 crits: It does 30, as a multiplier of 3.
- A multiplier of 2, a cap of 4 and a bonus of 10. A hit of 10 crits: It does 40.
- A crit chance of zero. A guaranteed hit lands with a high roll: It is a crit anyway.
- A hit of zero, below zero or no number at all. It arrives: Nothing is counted and nothing is done.
- The same hit and the same roll twice. Both are worked out: Both give the same result.
- A crit chance of one in ten and twenty thousand hits with fair rolls. You count the crits: About one hit in ten crits.
Works well with
- Health and Damage: A crit that multiplies the damage after armor makes armor weaker against crits. Decide which one you want, and say so on the page of the game. Work out the crit first, then give the result to the armor and the health.
- Bad Luck Protection: A long run of hits with no crit feels bad. Protection can raise the chance with each miss, so luck evens out without the player seeing it. Roll first, then let the protection change the result.
- Combo System: Each hit of a combo gets its own roll. A combo that rolls once for all its hits makes every crit a feast or a famine.
Common questions
what do i tell my ai to add critical hits
Paste this: Add critical hits: each hit gets one roll from zero up to but not including one, passed in from outside. It is a crit when the roll is below the chance, which starts at one in ten and is capped at three in four. A crit does double damage, rounded to whole points, and always at least one point more than a normal hit. Add bonuses from gear together before capping, never multiply them.
how high should the crit chance be
Start with about one in ten. That is often enough to notice within a fight and rare enough to feel like luck. Raise it only with gear, and keep a cap below one, or crits become the normal hit.
should crit bonuses add up or multiply
Add them up. Add all the bonuses together, add the sum to the base multiplier, and cap the result. Multiplying them makes a few pieces of gear far stronger than any one of them promises.
why do my crits feel too frequent or too rare
Check how many times the game rolls for one hit. If it rolls once per frame or once per number shown, the real rate is far above the one you set. Roll once when the hit lands.
Where it comes from
We could not find a reliable origin for this one yet.
What was checked
- 21 tests pass on the reference code.
Your AI gets the code
Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it