Saturday, July 2, 2011

Critical Damage, is it worth it?

If you ever played an RPG like Diablo or Neverwinter Nights, you've surely seen Weapons with a Critical Hit Chance. So far i've always ignored them, i prefer a more steady damage over a small chance of double or even triple damage. However i always wanted to know, what critical damage actually is about. Was it invented just to have a new feature? What is the exact effect of it? What is it comparable to?

To answer all theese questions i decided to perform some simulations. I usually avoid that wherever possible, because finding an intelligent formula for an effect is much more satisfying and less work. This however is a too complex topic to find a simple formula to approximate the effects. The main problem is, that when you hit an enemy with little HP left and score a critical it doesn't matter because it's dead anyway. There is only dead and alive, you cant kill a monster 1.05 times. This leads to some jagginess in the graphs and in the game itself. When you see them you'll know what i mean.

Anyway first i needed to make some assumptions and simplifications:
  • I assumed that you have to face 50 enemies
  • Each enemy has 50 HP
  • Each enemy does 1 damage(if id did more, it would simply increase the result proportionally)
  • Not all 50 enemies can attack you at once, i chose 1 and later 3 concurrent enemies
  • Your weapon does 20-30 Damage, you should be able to kill an enemy with 2-3 blows like in most RPGs
  • Every attack takes an equal amount of time(yours and the enemies)
  • I measure total health loss while defeating theese 50 enemies, because thats what matters in an RPG
Now every Simulation depends on a lot of random numbers, since modern CPUs are quite fast i decided to run every simulation 100000 times and average the outcome. Therefore every run yields the same result up to the 2nd decimal place.

First i did 2 simulations one with no critical chance and one with 12.5% of double damage. Then i tried to find a weapon that performs about as well without criticals as the original weaopn with them. I found this to be 23-33 Damage.

It's pretty obvious that the result will be different for Enemies with different HP. If every enemy had only 20 HP you can always kill it with a sinlge blow, so the extra criticals don't matter. When you kill an enemy with 10000 HP, i'm pretty sure that the weapon with criticals performs exactly 12.5% better. Thats the upper limit, it's not going to perform any better than that. The question is however when does the extra damage kick in. I decided to vary the HP from 20-100 with only 1 enemy attacking at a time:


The x axis shows the health of the enemies. The y axis shows your total health loss while killing 50 of them. The blue curve represents 20-30 damage. The red curve is 20-30 damage with 12.5% chance of double damage. The green one is 23-33 damage. You can see, that the blue weapon results in a higher health loss. The green and the red weapons perform roughly on par. The jagginess is a result of the fact that you can bash an enemy down to -20 HP, but it's no better than gently stroking it to death. It would seem that over the normal HP range 20-30 with 12.5% double damage equals 23-33 damage.

Now one could object and say "usually i'm in a crowd of several enemies all whacking me crazy, your test doesn't cover that". You're right it doesn't, so i did the same simulation and allowed 3 enemies to attack at the same time. You'd be surprised it doesn't matter at all. It simply results in a roughly 3 times higher health loss.





I asked myself however if theese tests are really valid. The red and green weapons seem to perform better at different HP ranges. Assume the enemy has 40HP. You can't kill it in one blow. But with a weapon that deals criticals there is still a small chance to do so. On the other hand an enemy with 80HP requires at least two criticals with a high roll each to kill it in 2 whacks and likey 4 hits. It seems that the additional 3 damage reducing the occurences of needing 4 hits outperforms the the small chance of killing it with 2 hits. So what's in between, what if the enemy has 75 or 77 Hitpoints. Perhaps one of the two weapons is just better at the points i selected but bad otherwise. So i did the same calculation varying the HP between 20 and 99 with a stepsize of 1. Now that did take a lot of time. The result surprised me, though it seems quite logical:



This test only compares 20-30 with criticals to 23-33 damage. Knowing the exact HP of the enemy can make a difference of up to 15%. On average they perform about equal with the latter one beeing ~1% better. Now in a game you either don't know the exact HP of the enemy or you face different enemies and can't take that into account. So it stands that they are about equal.

I did another test to verify that against tougher enemies they perform exactly the same, which i stated earlier. I varied HP between 100 and 500:


Here you see the 20-30 weapon beeing not as good as the 20-30+criticals and the 23-33 weapon. The red and green curve are exactly on top of each other.

As a gamer i'd say "hey i'm facing big and mean enemies and weak cannon fodder at the same time, how does that affect it". There's only one way to find out:

In the first simulation i assigned the enemies random HP between 20 and 100. In the second i assigned them random HP between 20 and 150. In the third simulation i created 50% enemies with 20HP, 30% with 50HP and 20% with 90HP.

The 23-33 weapon performs slightly better than the weapon with criticals. The original weapon is naturally worse.

At the end i can honestly state that 12.5% of double damage equals ~11.5% of damage increase.

What a relief to finally know.....

No comments:

Post a Comment