How to make a formula or percentage armor which depends on player level and player armor?
Greetings!
I did spend couple of days and still haven't figured out how to make a formula for percent armor. The percent armor depends on player level and player amor. I need something like this: LV = player level, AR = player armor, PA (output) = percent of armor,
(it's just an example) LV = 1, AR = 50, PA = 75%; LV = 2, AR = 50, PA = 62% LV = 2, AR = 60, PA = 69% LV = 3, AR = 50, PA = 54% LV = 3, AR = 70, PA = 68%
and so on...
Could you please help me out how to make this kind of formula?
Answer by Dragate · Nov 21, 2017 at 09:50 AM
A basic formula is:
Armor(%) = 100 * Armor / (Armor + Level)
As the Level increases (with a constant Armor), the % decreases.
As the Armor increases (with a constant Level), the % increases.
You could make the formula scale better with your numbers by modifying the Armor or Level (or both) first. Like:
Armor(%) = 100 * (Armor * 1.5) / [ (Armor * 1.5) + (Level * 20) ]
You should also check the answer posted here: https://answers.unity.com/questions/468635/how-to-calc-armor-.html
Thank you. I'm not sure if it's what I need. But it looks pretty decent. I'll try it.
Probably it's what I need.