For the game’s random elements, it was necessary to find a way to objectively measure their strength to compare them with alternatives like more damage or attack speed. With a concrete method of discerning the strength of probability-based bonuses it’s much simpler to make balance decisions as it gives us a better baseline value to work from.

In the case of critical hits, for instance, I vastly underestimated the strength of small critical hit increases to the player, to the point where a tower like the Targeting System was providing up to 40% critical hit chance at max level.

I never noticed how overpowered this was until I got to the point where the game was established enough in its development that balance was a concern. The first thing on the list was to figure out the relative strength of critical hit builds compared to regular passive damage and attack speed builds. For this I used the concept of Expected Value.

Expected value in this case is the average increase in damage per second dealt by the Tower due to its critical hit variables. What this boiled down to was adding together the odds of receiving and not receiving a critical hit multiplied by their damage multipliers. In the original case when the base critical hit multiplier of my game was 2.5x and the Targeting System Tower provided a 40% critical hit chance aura, the equation for the expected increase of DPS was:

While it may not seem like much, a 60% increase in regular attack DPS from a single Tower is extreme. This is much more than a player could achieve percentage-wise by any other means, especially as an aura for all surrounding Towers. While larger damage jumps were possible in the early game such as buying a Shortsword, having such a large scaling multiplier meant it was far too strong for lategame.

Now knowing how overpowered critical hit builds were for my game, I had to make extreme changes across all sources of critical hit chance in order to make normal attack damage or attack speed builds even remotely effective in comparison. For instance the Targeting System Aura was reduced from 40% to 4% + 0.16%/Lvl. A change I would never have guessed was necessary without some way to measure the effectiveness of critical hit builds.



To add another layer of difficulty to balancing these builds, the game also includes a mechanic where if a critical hit roll is successful, it will then roll the Tower’s multi-crit chance stat to determine if it will multiply the output damage again and continue doing so until that multi-crit roll fails. This leads to a situation where a Tower can theoretically get an infinite number of critical hit rolls on a single attack; however, that never happens in practice. For instance, if a player has an 8% critical hit chance and a 4% multi-crit chance, they will get a multi-crit on 0.32% of their attacks. The odds of a double multi-crit with these values is 0.0128%.

However multi-crits become a viable build option when that chance becomes much larger as having an attack that could do 20x your normal attack damage on hit even 1% of the time is incredibly strong in a game where you can fire 8 projectiles per second.

So how do we determine the expected value of damage multiplication for this scenario? It’s not possible to simply use expected value as the number of multi-crit rolls before the roll fails is unknown, so we have to use the wonders of Infinite Series. Given some critical hit chance c, multi-crit chance m, and critical hit multiplier k the normal expected value of DPS multiplication without multi-crit is:

To add the effect of multi-crits, we must add on the odds of receiving a multi-crit after a normal crit roll and what the EV of that would be. For each multi-crit roll we must adjust the probability to keep track of the number of successful rolls required before it.

The increase in the EV from the first multi-crit is the compounded probability of getting both a crit and one multi-crit multiplied by the damage that multi-crit would deal, which in this case is two multiplications of the crit multiplier giving us a squared value. To properly assess the overall EV, however, we must consider all possible multi-crits so we need to create a general formula for the nth multi-crit’s addition to the output DPS. From probability trees we know that the odds of a specific roll in a set of rolls are the odds of all successful rolls before it, multiplied by its own odds. In our case this means the odds of reaching the nth multi-crit are the odds of getting a crit multiplied by the odds of getting a multi-crit, repeating the multiplication by the multi-crit odds until we’ve done so n times. As we’re multiplying m by itself n times, we can replace the multiplication with an exponent giving us mn and our probability of landing on a specific multi-crit becomes:

Now we must add the damage component to it in order to determine the EV increase the nth multi-crit will provide. In the case of the first multi-crit, the output damage will be the crit multiplier multiplied by itself giving a square. In the case of the nth multi-crit the crit multiplier will be multiplied by itself n + 1 times as the first multi-crit provides k2 damage, the second provides k3, etc.

With a known multi-crit expected value we can see that to calculate the overall average increase of DPS we must use an infinite series that we can approximate the final value of. This gives us an equation for the final expected average damage multiplier including crit & multi-crit as shown:

With this we can now determine how much of an effect multi-crits will have however a series like this requires using a loop to calculate which will take up precious processing time. Let’s see if we can simplify it further.

It was much simpler to balance critical hit variables now that I had an equation relating them to the average increase in damage they would provide. I could use this equation as a starting point to balance from, and I could test how those variables worked with each other to see if I was leaving a seriously broken crit build on the table.

This equation was also implemented into the HUD. When a player mouses over the chance icon for their Tower they will get a full readout and expected value of DPS increase based on their current critical hit variables. Was this system an unnecessary waste of time? Absolutely, but multi-crit builds always make me laugh when that one enemy takes a few billion damage from a single hit so I think it’s pretty great.