Page 1 of 2

[b34] bad resistance calculation

Posted: Thu Sep 29, 2011 7:58 am
by lukep
I have a Yeek Doomed that is not getting the full effect of Harkor'Zun's Gauntlets. It is getting about +7% resist physical and +15% resist acid from them, instead of +10 and +20, respectively.

Re: [b34] bad resistance calculation

Posted: Thu Sep 29, 2011 2:45 pm
by edge2054
When you stack resist all with regular resistance you get diminishing returns.

Re: [b34] bad resistance calculation

Posted: Thu Sep 29, 2011 3:08 pm
by Talonj
The fact that this isn't told to the player anywhere is still a bug... At least I didn't read that anywhere.

Re: [b34] bad resistance calculation

Posted: Thu Sep 29, 2011 4:16 pm
by Final Master
?? When did that happen? And frankly, why? With con being nerfed, why do this as well?

Re: [b34] bad resistance calculation

Posted: Thu Sep 29, 2011 4:34 pm
by edge2054
Final Master wrote:?? When did that happen? And frankly, why? With con being nerfed, why do this as well?
Five months ago. It was in a change log. But yeah the tooltips could probably say so.

Here another way of looking at it....
[11:29] drquicksilver suppose the attack was supposed to do 200 damage
[11:29] drquicksilver resist all reduces it to 160 (20%)
[11:29] drquicksilver then resist specific reduces it to 120 (25% off of 160)
[11:29] drquicksilver which is, indeed, 40% total
[11:29] drquicksilver multiplicative stacking is "logical" to my mind.
The diminishing returns formula simplifies this so when resistance is actually called it can just check your total resist of that type.

For those that want the specifics...

Where a and b equal resist all and resist type. (for those who don't know lua math.min means it takes the lower of the two values)

Code: Select all

	local r = math.min(100 * (1 - (1 - a) * (1 - b)), (self.resists_cap.all or 0) + (self.resists_cap[type] or 0))

Re: [b34] bad resistance calculation

Posted: Thu Sep 29, 2011 4:43 pm
by Grey
Then the tooltip for resist all simply needs to say something along the lines of "Stacks multiplicatively with other sources" or "Applied before other resistances are calculated".

Re: [b34] bad resistance calculation

Posted: Thu Sep 29, 2011 7:14 pm
by lukep
In that case, I think that the display should be changed, from:
Resist all: 30%
Resist Physical: 37%

to:
Resist all: 30%
Resist Physical: 10%


or something like that. This would clearly show the relationship, at the cost of requiring some calculations to be done by the player.

Re: [b34] bad resistance calculation

Posted: Fri Sep 30, 2011 5:13 am
by Talonj
None of those explainations make any sense to me.

In the irc explanation, is the character supposed to have 40% resist physical? So are you trying to imply that resist all does -NOTHING- because natural resistances, if higher, will be substituted?

Or does the character have 20% resist all, and 25% resist physical, and the display simply shows 40%?

An example without explanation of what the example is actually an example of is... not an example.

Re: [b34] bad resistance calculation

Posted: Fri Sep 30, 2011 6:03 am
by edge2054
Sorry Talonj.

Say you have 20% resist all and 10% acid resistance and get hit for 1000 acid damage.

After resist all you take 800 (-1000 * 0.2 or 200).

After acid resist you take 720 (-800 * 0.1 or 80).

In other words, resist all and elemental resist are like an onion. They're not really additive. Your acid resist will only reduce the damage that gets past your resist all. You don't check each by themselves and then add the reduction together.

I like Luke's suggestion. But I think we'd need a way to communicate how the resist cap works too. The player doesn't really have a type based resist cap it's just converted into that for ease of digestion. What you really have is a resist all cap that can be modified by type. Your resist all cap is 70 and when you increase an elemental resist cap you're actually giving yourself the value as an added bonus to your resist all cap when resisting that damage type.

So cap resists = 70. Physical resist + resist all = 140 (70 each / 91% resistance total after diminishing returns). Increasing your resist physical cap at this point will directly increase the percentage you resist because the formula takes the lower of the two values. In other words 91% or 70%, which ever is lower. If we add 5% to the 75% it's now 91% or 75%.

So if we changed it to lukes display without figuring out a better way to explain it to players they may hit something like 60% resist all / 60% resist physical and think that adding more resists is still doing them good because of the 70% resist cap display (it's not, they're total resist at this point is 84% and adding 5% more to either of their resists would do nothing; but adding 5% to their resist cap would increase the amount of damage they're resisting directly by 5%).

Maybe the resist cap could be converted to be more honest as well? So you'd have resist all cap and then the rest of the resists would have blank fields that would add (+5% cap for this damage type) or something when you raised your caps.

Re: [b34] bad resistance calculation

Posted: Fri Sep 30, 2011 6:51 am
by Rectifier
I read this and got more confused edge :s

Re: [b34] bad resistance calculation

Posted: Fri Sep 30, 2011 8:55 am
by Grey
Yeah, well done Edge ;)

Re: [b34] bad resistance calculation

Posted: Fri Sep 30, 2011 12:56 pm
by Gliktch
Perhaps if Resist All were renamed something like Damage Absorption or Total Damage Reduction (anything like that which doesn't use the word Resist) it could be easier to make it clear?

Just spitballing here..

As I understand it from this thread, if I have the following resists:

All: 10%
Acid: 60%
Fire: 25%
Cold: 43%

And I get hit with 100 acid, 100 fire, 100 cold, then my damage taken would be:

Acid: 100dmg - (100 x 0.60) = 40, 40 minus (40 x 0.1) = 36dmg
Fire: 100dmg - (100 x 0.25) = 75, 75 minus (75 x 0.1) = 67.5dmg
Cold: 100dmg - (100 x 0.43) = 57, 57 minus (57 x 0.1) = 51.3dmg

I hope that this is both correct and understandable :)

Re: [b34] bad resistance calculation

Posted: Fri Sep 30, 2011 1:56 pm
by Grey
Correct. It also doesn't make a difference if you apply the resist all first instead.

I don't see why we don't have them just stack normally. It's much clearer and damage wise doesn't make a huge difference.

Re: [b34] bad resistance calculation

Posted: Fri Sep 30, 2011 4:23 pm
by edge2054
Aside from my first example last night, all my other ramblings where in relation to lukep's suggested change.

ie.

resist cap - 70
resist all - 30
acid resist - 10 (+5 resist cap)


All I was really trying to get at is that if we changed the display over the luke's suggestion we'd want to break down the resist cap into a more honest approach. Because with his suggestion 40 resist all and 40 acid resist would be over the cap.

Re: [b34] bad resistance calculation

Posted: Fri Sep 30, 2011 7:54 pm
by Rectifier
I don't care what you guys do so long as I don't have to integrate some function to figure it out.