Thoughts on Damage Equations

There were some issues with the initial Siralim 3 damage equation and as a result, Zack is testing some adjustments to the damage equation today (See Patch 0.023).

This got me thinking about damage equations in general. It seems that a damage equation has two competing goals:

  1. Make stat increases “feel” awesome (this is afterall a stat-based game)
  2. Make one-shots rare (the game is less fun if either my creatures are dying instantly, or I am annihilating enemies in one hit)

So I am going to start with the premise that it is okay to have enemy max health affect my damage. (This is potentially controversial, but it is a useful premise if one wants to minimize one-shots).

I think a reasonable approach to limiting one shots is to start with a “natural” damage value and then modify the adjust the value based on enemy health if it is too extreme.

For a game like Siralim with Attack and Defense both in approximately the same range, I think a good “natural” damage equation is:
NatDamage = (alpha * ATTACK - delta * DEFENSE) * DAMAGE MODIFIERS

Here, alpha and delta are parameters than can be tuned as desired. Basically decide how much damage should be done for given ATTACK \ DEFENSE values against a super-high health creature and set alpha and delta appropriately. (For instance, set alpha a bit larger than delta if you want a bit of damage to be dealt when ATTACK is equal to DEFENSE)

Now we get to the interesting part, how do you adjust based on enemy health. My starting assumption here is that a creature should be able to one-shot an enemy if the natural damage is sufficiently high relative to enemy max health. I am going to pick 5 arbitrarily as a constant (this can be adjusted) and say that a creature should one-shot an enemy if the natural damage is at least 5 times the enemy max health.

Therefore, I propose that we calculate:
NatDamagePercent = NatDamage / MaxHealth

Now we want to squish down NatDamagePercent if it is too large, let’s call our adjustment function F()
AdjustedDamagePercent = F( NatDamagePercent )

Then our final damage is:
FinalDamage = AdjustedDamagePercent * MaxHealth

So the interesting question is what is the right adjustment function, F() …

We want F to be the identity function for small inputs (no need to adjust if natural damage is small)
… and we want F(5) = 1
(This is based on the assumption that a one-shot should happen if Natural Damage is five times max health … Feel free to replace 5 with any value you prefer)

One possibility is to use a piece-wise function:
F(x) = x if (x < 0.2)
F(x) = (x + 1) / 6 if (x > 0.2)

Or Perhaps:
F(x) = x if (x < 0.2)
F(x) = SQRT( 0.2* x) if (x > 0.2)

There is likely something more elegant than a piece-wise function, but I think piecewise functions probably provide about the right behavior. If you want something more nuanced, you can always go with a three-part piece-wise function.

Very interesting, thanks for the write-up!

The more I think about it, the more I think that something like this is promising. Calculating “Natural” damage and then doing some squishing/adjusting based on the percentage of enemy Max Health seems promising. And we can avoid “capping” scenarios by choosing our adjustment function so that it slows down damage growth, but doesn’t completely prevent one-shots. (Which makes heavy investment in damage statistics still “feel” rewarding)

Let’s say you really wanted one-shots to be rare, so you wanted to require Natural Damage to be 10x Max Health in order to get a one-shot.

Then making a piecewise function like the following might work really well:
F(x) = x (if x < .2)
F(x) = (x + 0.6) / 4 (if x > .2 and x < 1)
F(x) = SQRT( (2.8 * x + 2) / 30 )

Stat increases can’t feel awesome if my damage output has a ceiling limited by something not in my control (ie, enemy HP).

If your damage per hit has a ceiling, the natural progression will be to use abilities that cause multiple hits, or damage that doesn’t rely on hits at all. When that happens, you leave big, single target abilities and spells in the dust, because they’ll hit the ceiling cap easily.

It also devalues the entire Tome system.
If I increase my HP, I’m not actually increasing my survival. Enemies will simply hit harder because I have a higher health pool.
If I increase my Attack/Intelligence, I’m not actually increasing my damage because I’m hitting damage caps.

That just leaves Defense and Speed; Speed is unreliable as a defense mechanism, except to say you get to go first. Defense is likewise lacking. Defense simply doesn’t do enough to mitigate incoming damage.

I don’t have a solution; but the game even with damage caps still revolves around getting the first turn and one-shotting the enemy party. It’s just now instead of relying on a single cast, you rely on a multicast spell or ability. It’s one of the things making Sorcery Mages extremely powerful right now.

Everything else is very RNG which means eventually, you will lose that RNG roll. Put all the enemies to Sleep? They can wake up at the start of their turn. Same with Snare and Frozen.

HP already provides mitigation; with any sort of cap based on maximum HP, it means that increasing your stat by 1 HP won’t provide an actual full point of mitigation - and in some examples, increasing HP results in 0 actual mitigation.

Let’s take this situation:
You have 300 HP
The enemy hits for 200, but gets capped at 100 HP
You go and eat some Tomes, and bring yourself up to 330 HP
The same enemy stills hit for 200, but gets capped at 110 now
This continues on until you break the soft cap of 200. You still die in the same 3 hits, and each hit still does 1/3 of your life. Therefore, every HP Tome you eat is worth 0 effective mitigation.

Applying your formula, the situation is the same only lessened. HP increases prior to breaking the enemy’s soft cap are worth less in terms of effective mitigation. You’re climbing uphill if you’re trying to increase survivability by increasing HP, which feels plain wrong.

Defense is already a stat that should provide mitigation, and HP is the secondary layer. With a damage cap in place, HP mitigation gets reduced drastically unless you have utter gobs of it. As the game scales, it takes more and more HP on a percentage basis for HP to be worthwhile. All the while, the real root of the issue is that Defense doesn’t provide enough mitigation to begin with.

So if it were me, I would go back to the basics on what Defense is supposed to do as compared to normal Attacks and Spells. Obviously, spells have coefficients already built-in, but it’s readily apparent that Defense is not doing it’s job properly.

I admit I don’t really understand the formulas involved, but it seems to me that any adjusting for enemy max health in damage calculations is just going to be frustrating for the player. It makes stacking up for one big hit feel really bad. It should be entirely possible to one shot an appropriately leveled enemy. It should just be hard. It should take a round or two to setup.
Can it not be as simple as increasing the value of defense, multiplying max health, or reducing damage across the board? I like drawn out battles, but right now it feels punishing to charge up for a big attack (stat buffs or traits, etc.) and rewarding to set up a lot of weaker repetitive attacks.

Maybe you could incorporate a reverse exhaustion even, where all creatures have some damage reduction for 1-2 turns. That would help me break my love/hate/abuse relationship with the whole Vulpes monster family.

Oh, and I’ve always had a question regarding Sirilim - why is Defense a universal stat?
It blocks both physical and spell damage.

I would have broken them up into Physical Defense and Magical Defense. That way, you can have a creature like a Golem be highly resistant to Physical attacks, but goes down quickly to magical.

This is my point.
Take Mana Bomb trait for example.
For those not familiar with it, when this creature provokes, it loses up to 50 mana. In exchange, it deals 3% of it’s Intelligence to all enemy creatures per mana spent.
This damage bypasses all defense.

So an example creature -
Lv 50
Intelligence 1000

Now this creature can hit for a maximum of 1500 (!) when it provokes. But the game says “no, you can’t. You can only hit up to this cap, based on enemy HP”. Most level 50 creatures have about 600 HP, so you get capped out at about 150-200 damage. That’s 1/10th of what you should be doing, according to the trait. It’s not very intuitive as to the expected damage, and there’s little point of even building for Intelligence when using this trait. You’ll almost always be capped, even with the worst Intelligence creatures.

And this is my point entirely - look at the root of the one-shot issue rather than addressing it via a damage cap. Instead of looking at it like there should be a cap, it should be looked at that the trait is doing WAY too much base damage to begin with. Not only does this damage utterly ignore defense, but it hits ALL enemy creatures. And as I said, even the worst Intelligence stat creatures can easily hit damage caps with this trait.

Sorry, I simply can’t and will never agree that my Stronghold that Provokes with Mana Bomb should be dealing as much damage as my Raven Lord with Mana Bomb due to damage caps.

There hasn’t been a so-called soft cap of any kind for several patches now, and damage has nothing to do with enemy max hp anymore. That was a bug. Remember that this is early access so the game is still very much a work in progress!

I’ll continue with my Mana Bomb example then.
Can you explain why Mana Bomb is causing such a disparity in damage done if not for some soft cap or other hidden mechanic at play?

Here’s the creature stats of the Harpy I threw this on. I’m not even pumping Intelligence nor maximizing mana on it.
427 Intelligence
32 mana

427 x 3% = 12.81 per point of mana spent
32 mana x 12.81 = 409.92 expected damage

Also, if you’ve removed damage caps (and seemingly lowered AoE spell damage coefficients this patch), would you mind writing such changes in the patch change long so appropriate discussions can be made? Thanks!

I was late to this conversation unfortunately, but the back and forth has me thinking; Wouldn’t it be great to have the damage calculations in the history tab? Easy confirmation of assumptions on how things work or a way to recognize things that are not working as described.

Mana Bomb, like most damage sources, is still affected by Defense.


Sorry, no, it’s not affected by Defense.

Here’s proof:
ver 0.0.39 - Spell Hit at full defense. Top middle creature has +45% defense artifact, so he’s taking (very) slightly less damage. - Same spell at 1 defense (bottom, middle creature has 1 defense). He’s taking (very) slightly more damage from the spell. - Mana Bomb - ALL TAKING THE EXACT SAME DAMAGE. DEFENSE DOESN’T MATTER FOR THIS ABILITY.

And just interesting in general. It would be nice to have it as an option if that were at all possible.