# "Crit chance" word problem

Normally, I can jump exactly 100cm into the air. Sometimes, I can jump higher - by a predictable proportion and with a particular probability. These higher jumps are "critical jumps."

• I have an attribute, "Dexterity" (DEX). For each unit of DEX I possess, I can jump 2% as high on critical jumps as on normal jumps; or, my critical jump is (DEX/50)x the height of my regular jump.
• Currently, my DEX is 100, so that when I "critically jump," I jump 200cm high. (To clarify: I can only jump either 100cm or 200cm into the air.)
• I also have an attribute, "Agility" (AGI), which dictates how often I can critically jump.
• Neither my DEX nor my AGI can be lower than 100.
• Currently, my AGI is 100, which is the baseline for AGI. In other words, at AGI 100, I never critically jump. At values above 100 AGI, I have an increasing chance to critically jump.
• My regular jump (Rj) height varies from day to day, but for my critical jumps (Cj), the DEX proportion (known: (DEX/50)(Rj)) and AGI frequency (unknown, but at AGI 100 = 0%) are the same.
• Depending on how I exercise, I can raise my DEX and AGI by arbitrary amounts, but for DEX=AGI and DEX>100 and AGI>100, my average jump (Aj) height will be [(AGI-100)*2]% higher than Rj -or- Aj = [((AGI*2)/100)-1]Rj

Q: What % of jumps (Cf), as a function of AGI, would have to be critical jumps?

My work before my brain bailed: At 101 AGI and 101 DEX, if my regular jump is 100cm, my critical jump is 202cm; my average jump must be 102cm (1.96% or Cf=100/51?). At 150 AGI and DEX, if my regular jump is 150cm, my critical jump is 450cm; my average jump must be 300cm (50% or Cf=(AGI-100)? AGI/3?). At 200 AGI and DEX, if Rj is 50, then Cj is 200 and Aj is 150 (Cf=2AGI/3?) At 500 each, if Rj=100, then Cj=1000 and Aj=900. I believe that Aj = Cj - Rj as a rule. It also seems right to calculate percentages as [((100-x)*Rj)+((x)*Cj)]/100 = Aj. This is where I fall off.

• Commented Feb 7, 2014 at 2:54
• Sure, I probably should have saved the preamble for the postamble. -.- en.wikipedia.org/wiki/Role-playing_game Commented Feb 7, 2014 at 2:57

To be honest, I think you're making everything hard on yourself by restricting yourself to linear scaling systems. Having it so an equal number of points spread across stats is a problem tailor made for exponential scaling systems.

Consider a damage function like so:

$$D = e^{(d-d_0)/k_d} e^{(a-a_0)/k_a} D_0$$

where $d, a$ are dex and agility; $d_0, a_0$ are constants (like 100), and $k_d, k_a$ are just scaling constants so that the scaling is overall small. If $k_d = k_a$, then 100 points in agility is guaranteed to be the same overall damage as 100 points in dexterity, or as 50/50 in each.

Another common failing of linear scaling systems is that stats diminish in relative worth as you stack them: for instance, strength will keep adding only 1% of base damage per X points, but if you're already doing 200% normal damage, that 1% is worth half of what it used to be worth. This is a classic example of the scaling mathematics driving stat decisions. That can be fun for some people and players, but I would at least consider an alternative where situations drive stat decisions instead of math. Exponential scaling systems do a much better job of getting out of the way.

Once you have the exponential scaling formula in place, you can build a correlation between it and a linear bonus factor that represents the damage done from crits. In other words, you can equate

$$e^{(d-d_0)/k} e^{(a-a_0)/k} = 1 + bc$$

where $b$ is the crit bonus and $c$ is the crit chance. Given that you've already stated you want $b = d/50-1$, a formula for $c$ shortly follows. I'll roll in the constants so that 1 point of dex or agi increases capability by 2%:

$$c(a, d) = \frac{1.02^{d+a-200}-1}{d/50-1}$$

Of course, this crit chance formula is unbounded: if $d = 100$, then just $a = 136$ gives over 100% crit chance. I suggest this is more a problem with the crit bonus not increasing fast enough, rather than the crit chance being the issue, though.

We can do this approach for linear scaling instead:

$$D = (d/50-1)(a/50-1) D_0$$

That would give the following answer:

$$1 + (d/50-1)c = (d/50-1)(a/50-1) \implies c = \frac{a}{50} - 1 - \frac{1}{d/50-1}$$

But the key point about having dex and agi both give the same benefit is lost, I think. 50 points each in dex and agi will be far more effective than 100 points in either one. This is one of the main drawbacks of linear scaling: it forces people down a balanced stat path. If that's what you want, good, but if you want to give the option, this math doesn't support it.

• I can't vote up yet, but this is an excellent answer. You gave me exactly the kind of ideas and directions I had hoped for! Since I'm programming this, it's even very clearly written out in a way I can use. Commented Feb 7, 2014 at 7:32
• However... some thoughts back. First, the idea that the crit frequency never reaches 100% is crucial. Second, I'm not getting the expected results from your bottom equation. At DEX&AGI 100 or 150, it seems right, but take DEX 300 and AGI 300: I expect that if Rj is 100, Cj will be 600 (DEX/50 * Rj) and Aj should be 500. By your formula, I got 2500 for Aj. Certainly, Aj should never be higher than Cj, as that would mean that I have a higher than 100% critical frequency. Commented Feb 7, 2014 at 7:57
• I'm not surprised; the derived formula has some strange properties. For instance as $d$ increases, the crit chance actually $increases$ slowly. At $a=300$, you get $c \geq 4$, or 400% critical chance. What probably needs to happen is that the crit chance is capped (using some asymptotic function) by design. Alternatively, you could have "critical crits". Commented Feb 7, 2014 at 14:46
• With critical crits, however, it makes it even clearer that distributing the two stats evenly is far more advantageous. What I was looking for was something like my formula for EHP (effective hit points) through mitigation. For each point of toughness, I raise damage mitigation by ((-100+TGH)/TGH)*100%, thereby increasing "effective" hit points by 1% for each point. The advantage is that mitigation of damage would never reach 100%. I was looking for the same formula for AGI and crit chance, with the given that DEX will raise the crit hit amount. Commented Feb 8, 2014 at 0:34

I discovered the answer I was looking for:

Cf = (AGI-100)/(AGI-50)

or

((AGI-100)/(AGI-50))*100 % of jumps are critical jumps.

Now that I look back at my "work done so far" section, I had plotted this out so directly that it should have been obvious.

• I don't know how to format math for graphical display. Commented Feb 8, 2014 at 1:02