I'm a bit stuck on one particular aspect of my game, and that's how defense is factoring into how damage is calculated. I already know how I want the raw damage input to be calculated: The attack stat the skill uses, plus any buffs/debuffs applied directly to the stat (such as attack up, attack down), multiplied by the skill's Power (a number such as 100 that represents the true multiplier, which in that case would be 1x, 170 would be 1.7x, etc.). Then after the defense reduces that, the total damage would be further multiplied by active defensive buffs, elemental resistances, or status effects that enhance damage (such as being frozen doubling all physical damage taken, for example). This would produce the final damage amount.
What I want is for the characters' stats to be linearly scaled from a low value to a very high value (think going from 30 attack at level 1 to 3000 attack at level 100), where each level gives an across-the-board percentile bonus to all stats, meaning characters will maintain their statistical ratios across all levels. There is one defensive stat, with much of the bulk of defensive play coming from active skills and random chance mechanics like dodging and blocking (which reduce damage instead of negating it, because there is no such thing as missing in this game --- you always deal damage if you attack).
The part I have an issue with is that I've always worked with formulas that assume defense is static, not something that grows. Making a formula that gives flat reduction with percentage reduction on top is easy and works for that, but it doesn't scale well and won't work here, so I can't use my usual methods. The effect of attacking stats on damage is currently quadratic, but I'm not sure how to make defense scale quadratically to keep up with it. I want defense to have a logarithmic effect on the amount of damage taken proportional to the raw damage (attack times power), but only have to scale based on its statistical value rather than have a power multiplier like attacks do. My initial desire was to have something like Fallout 4's ratio-based defense, but I'm not math-savvy enough to figure that kind of thing out on my own or know if it would actually achieve what I want. That being something that can scale very high and have extreme differences in attack and defense without breaking the game (certain skills/characters doing no damage while others one-shot the enemy). I would have consulted Epic Battle Fantasy's method since that's what I'm mainly inspired by, but I can't find any documentation on that.
So, for the more mathematically inclined among you, how can I achieve this? If you need more details, I'll give whatever I have.
What I want is for the characters' stats to be linearly scaled from a low value to a very high value (think going from 30 attack at level 1 to 3000 attack at level 100), where each level gives an across-the-board percentile bonus to all stats, meaning characters will maintain their statistical ratios across all levels. There is one defensive stat, with much of the bulk of defensive play coming from active skills and random chance mechanics like dodging and blocking (which reduce damage instead of negating it, because there is no such thing as missing in this game --- you always deal damage if you attack).
The part I have an issue with is that I've always worked with formulas that assume defense is static, not something that grows. Making a formula that gives flat reduction with percentage reduction on top is easy and works for that, but it doesn't scale well and won't work here, so I can't use my usual methods. The effect of attacking stats on damage is currently quadratic, but I'm not sure how to make defense scale quadratically to keep up with it. I want defense to have a logarithmic effect on the amount of damage taken proportional to the raw damage (attack times power), but only have to scale based on its statistical value rather than have a power multiplier like attacks do. My initial desire was to have something like Fallout 4's ratio-based defense, but I'm not math-savvy enough to figure that kind of thing out on my own or know if it would actually achieve what I want. That being something that can scale very high and have extreme differences in attack and defense without breaking the game (certain skills/characters doing no damage while others one-shot the enemy). I would have consulted Epic Battle Fantasy's method since that's what I'm mainly inspired by, but I can't find any documentation on that.
So, for the more mathematically inclined among you, how can I achieve this? If you need more details, I'll give whatever I have.