How does resistence work?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Natha
Fast Inserter
Fast Inserter
Posts: 183
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

How does resistence work?

Post by Natha »

Hi,

I tested a few hours to figure out how the resistence works. The wiki entry (from 2014), that it works like:
damage - (damage * percentage) - decrease
wasnt correct. I tested ingame with changing percentage and decrease, and I couldnt yet figure out the right formula.
So, is there someone who knows the right calculation?

LG

Loewchen
Global Moderator
Global Moderator
Posts: 8337
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: How does resistence work?

Post by Loewchen »

Taken damage is the lower of:
  • damage - (damage * percentage)
  • damage - decrease [for decrease < damage] or 1/(2 + decrease - damage) [for decrease >= damage]

Natha
Fast Inserter
Fast Inserter
Posts: 183
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: How does resistence work?

Post by Natha »

Loewchen wrote:Taken damage is the lower of:
  • damage - (damage * percentage)
  • damage - decrease [for decrease < damage] or 1/(2 + decrease - damage) [for decrease >= damage]
That doesnt work for me.
I tested it on a stone furnace with physical 0/60% resistence by shoot it with a basic bullet magazine (2 physical) and a piercing bullet magazine (5 physical) (pistol).
According to your formula one shot with basic magazine reduces the health by (2 - (2 * 0.6)) = 0.8. But it doesn't, the health is reduced by 0.80000305176. Where does the difference come from? Neither pistol nor magazines have other values to determine damage. Values with up to 2 decimal places were only shown if the values are .25, .5 or .75.
With the piercing magazine the health is reduced by the correct amount.

Another case with 1/43%:
Damage from a basic magazine is 0.57000732422.
According to your formula 2 - (2 * 0.43) = 1.14 is higher than 2 - 1 so the damage should be 1.
Damage from a piercing magazine is 2.2799987793, but it should be 2.85.

Loewchen
Global Moderator
Global Moderator
Posts: 8337
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: How does resistence work?

Post by Loewchen »

Natha wrote: That doesnt work for me.
Yea for me neither...but I have still other values :?

The simple case (decrease < damage) seems to be w/o deviation:
  • (damage - decrease)*(1-percentage) both values always applied
The other one (decrease >= damage) is about 1/100 above this:
  • 1/(2 + decrease - damage)*(1-percentage)

Post Reply

Return to “Gameplay Help”