Incoming damage with multiple shields, order of application?

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
lies
Cornac
Posts: 31
Joined: Sun Mar 30, 2003 4:23 pm
Location: Interzone

Incoming damage with multiple shields, order of application?

#1 Post by lies »

On higher level characters, I usually have multiple defensive skills that do things to reduce incoming damage. My question is, in what order do they get applied (and is it possible to change that order)?

For instance, I'm running an antimagic mindslayer now (http://te4.org/characters/23337/tome/58 ... 7851608c07). I've got an antimagic shield that reduces all non-physical/mind damage by 55 per attack, a charged shield that absorbs 65% of a blight attack up to a max of 35 per attack, and 24% blight resistance. Let's say I get hit by a 100 damage blight attack, does it go in the order resistance (100*0.76=76), charged shield (76*0.65=49>35, so 76-35=41), then antimagic shield (41-55=0) for a grand total of zero damage, OR does it go resistance (100*0.76=76), AMS (76-55=21), then charged shield for (21*0.65=13.65, 21-13.65=7.35), for not zero damage? (assuming resistance goes first)

Or, for another example, let's say I've got a displacement shield as well as a normal damage shield from a rune up, does damage go to the displacement shield first, making a check to get moved to the target, or does the normal shield have to get knocked down first?

Most importantly, is there a way to set up your shields (order of putting them up?) to optimize their effectiveness?

Frumple
Sher'Tul Godslayer
Posts: 1517
Joined: Sat May 15, 2010 9:17 pm

Re: Incoming damage with multiple shields, order of applicat

#2 Post by Frumple »

Lemme see... from what I recall, damage shields (ala runes) come after resistances... after everything, actually. They're basically temporary HP, and function like it. Shields with special effects are... finicky, and short of code diving I couldn't tell you (and maybe not even then :lol:). The order of application is defined in the lua, though. Somewhere.

Mindslayer shields specifically come before resistances, AM shield, and pretty much everything else (barring enemy damage debuffs, I think), so far as I'm aware. That was a nerf that came along a waaays back.

AM shield, again, insofar as I can remember, comes after resistances. In the example you gave, charged shield would knock off its 35 damage, then resistance would be applied to whatever remains, then AM shield would do its thing. Damage would still come out zero, I believe.

Displacement shield vs damage shield, I have no clue. Haven't used displacement shield enough to pick up the mechanics.

As for manual optimization, no, there's no way. Which order you activate stuff is irrelevant, insofar as I'm aware. Order of application in regards to shields and suchlike is specifically defined in the code and intended to be defined in that manner -- it's actually a notable balance consideration for a few classes (Such, as mentioned, mindslayers. Before their shields were shifted to cut damage before resistances were applied, they were incredibly hard to kill.). Order of application making a notable difference is also a fairly obtuse way of going about things -- it's one of the reasons bloodbath got changed to what it is now, from what I understand (whether you popped a regen and proc'd bloodbath or vice versa would make a difference of sometimes hundreds of HP/round) -- and generally avoided in T4's code altogether.

Note that all of that comes with the caveat that I've never actually code dived this stuff, and most of it is (possibly outdated, as mechanics do shift around fairly often) experience or stuff I've picked up in passing from the folks that can actually interpret T4's code easily.

Crim, The Red Thunder
Sher'Tul Godslayer
Posts: 2000
Joined: Fri May 07, 2004 8:26 pm
Location: Nahgharash

Re: Incoming damage with multiple shields, order of applicat

#3 Post by Crim, The Red Thunder »

Displacement trips before disruption, so I ASSUME it would also trip before damage shield. I know that if I displace a blow to an enemy on my archmage, it doesn't give me any mana. I assume it therefore ALSO doesn't do any damage, so wouldn't harm a damage shield either. That's about my sum knowledge of shields though, and that archmage was in b43, so things MIGHT have changed, though it seems unlikely.
Currently playing under the name Aura of the Dawn 4 down, 227 to go!
Proud author of Orc Pit Restoration Project, Faction Allies, Dwarven Adventurer addons
SadistSquirrel wrote:DarkGod has two arms, one with an opened hand, one with a closed fist. You got the fist.

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: Incoming damage with multiple shields, order of applicat

#4 Post by lukep »

The order is:

armour (if applicable)

Block (from shields)
+damage%
Psionic shields
spiked psionic shields
damage resistance%
AM shield
torques of kin/thermal/charged psi shield

(shields etc... after this)

I'm leaving out the other 20 or so steps, but that should be the relevant ones.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

Mewtarthio
Uruivellas
Posts: 717
Joined: Mon Jul 16, 2012 6:03 pm

Re: Incoming damage with multiple shields, order of applicat

#5 Post by Mewtarthio »

For shields, the order is this:

Invulnerability
Retribution
Displace Damage (the Chronomancy talent)
Temporal Shield
Damage Shield
Displacement Shield (the Spell)
Disruption Shield
Bone Shield
Deflection
Rampage
Iceblock
Dismissal
Cauterize
Unstoppable

supermini
Uruivellas
Posts: 800
Joined: Tue May 15, 2012 11:44 pm

Re: Incoming damage with multiple shields, order of applicat

#6 Post by supermini »

You can check the te4_log.txt to see the shields, armor and resistances in action. It's quite fun.
<darkgod> all this fine balancing talk is boring
<darkgod> brb buffing boulder throwers

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Incoming damage with multiple shields, order of applicat

#7 Post by jenx »

Mewtarthio wrote:For shields, the order is this:

Invulnerability
Retribution
Displace Damage (the Chronomancy talent)
Temporal Shield
Damage Shield
Displacement Shield (the Spell)
Disruption Shield
Bone Shield
Deflection
Rampage
Iceblock
Dismissal
Cauterize
Unstoppable
I'm running AM Solipsist with Dream Forge. Where does AM Shield and Forge Shield fit into this list?
MADNESS rocks

Mewtarthio
Uruivellas
Posts: 717
Joined: Mon Jul 16, 2012 6:03 pm

Re: Incoming damage with multiple shields, order of applicat

#8 Post by Mewtarthio »

jenx wrote:I'm running AM Solipsist with Dream Forge. Where does AM Shield and Forge Shield fit into this list?
Forge Shield applies right after the Block talent, while AM Shield comes before regular armor. Both take place before takeHit is called, so before anything I've listed.

Parcae2
Uruivellas
Posts: 709
Joined: Sat Jan 14, 2012 12:02 am

Re: Incoming damage with multiple shields, order of applicat

#9 Post by Parcae2 »

Hmmm. Are you sure that shield block comes before Bone Shield? I've tested this out specifically, and attacks removed a Bone Shield charge even when Block would have completely negated the damage.

Mewtarthio
Uruivellas
Posts: 717
Joined: Mon Jul 16, 2012 6:03 pm

Re: Incoming damage with multiple shields, order of applicat

#10 Post by Mewtarthio »

Parcae2 wrote:Hmmm. Are you sure that shield block comes before Bone Shield? I've tested this out specifically, and attacks removed a Bone Shield charge even when Block would have completely negated the damage.
Looking at the code, it appears you lose a charge even if the damage has fallen to zero by that point. Only invulnerability and Elemental Surge: Lightning actually prevent takeHit from continuing to that point. The takeHit function still gets called even if the damage is zero (ie fully blocked), and I don't see any checks in either takeHit or Bone Shield's absorb function that ensure the damage is positive before sacrificing a charge.

tylor
Wyrmic
Posts: 285
Joined: Thu Mar 07, 2013 5:18 am

Re: Incoming damage with multiple shields, order of applicat

#11 Post by tylor »

What about multi-component damage? Is every component treated separately, and then just bundled in log for ease of read?

PureQuestion
Master Artificer
Posts: 726
Joined: Fri Feb 03, 2012 3:53 am

Re: Incoming damage with multiple shields, order of applicat

#12 Post by PureQuestion »

I think they're separate, and will thus shred your bone shield extra fast.

Post Reply