How to Calc Armor ?

Which mathf function can be used for damage reduction calculation ?

for example i want the following:

100 Armor = 10% DMG Reduce
1000 Armor = 50% DMG Reduce
10k Armor = 75% DMG Reduce & CAP.

I was thinging about using log(2) on the values and do some basic maths after that to fit.

Any other suggestions ?

I’m not sure this question is directly related to unity, but since you’re asking about Mathf I’m letting it slide although a mod may disagree.

However, in regards to your question, I don’t think you’ll find a one-size-fits-all "damage reduction calculation in Mathf. I would instead suggest looking at the calculations used in other games for ideas. I know for example that the WoW mechanics are readily available.

Since your progressing isn’t really described very detailed (only 3 sample points) it’s impossible what progression you actually want. It might be a solution to just use an AnimationCurve and define your desired curve there. Just add a public variable of type AnimationCurve to your script and you should be able to edit the curve in the inspector.

Keep in mind that the “input value” is the x axis and the “output value” the y axis.

If you really need a math formula you have to be more precise on your progression / asymptotes of your desired curve.