I want to ask something quick about damage formulas, because i want to create a skill that scales with two stats, and i did something like this (35 + a.atk * 2.9 - b.def * 1.7 + a.agi * 2.5 - b.def * 2). This one it seems to be the right scaling, because when i increase both stats the damage increase, but i noticed that the increases are a bit weird. I think upgrading attack should be a higher damage increase than upgrading agility, because have a higher scaling. But it seems that the increases are the same. I should write the formula different?
A doubt about damage formulas
RPG Maker MV SupportOkay, so let's look at this. Say your attacker has 20 atk/13 agi and the target has 15 def:
35 + 20 * 2.9 - 15 * 1.7 + 13 * 2.5 - 15 * 2
35 + 58 - 25.5 + 32.5 - 30
70 damage.
Now let's increase atk by 10:
35 + 30 * 2.9 - 15 * 1.7 + 13 * 2.5 - 15 * 2
35 + 87 - 25.5 + 32.5 - 30
99 damage, an increase of 29 over having 20 atk.
Now if we take the original stats and add 10 agi:
35 + 20 * 2.9 - 15 * 1.7 + 23 * 2.5 - 15 * 2
35 + 58 - 25.5 + 57.5 - 30
95 damage, an increase of 25.
So it is scaling differently, but you may have to go into higher differing values before you see a larger change.
35 + 20 * 2.9 - 15 * 1.7 + 13 * 2.5 - 15 * 2
35 + 58 - 25.5 + 32.5 - 30
70 damage.
Now let's increase atk by 10:
35 + 30 * 2.9 - 15 * 1.7 + 13 * 2.5 - 15 * 2
35 + 87 - 25.5 + 32.5 - 30
99 damage, an increase of 29 over having 20 atk.
Now if we take the original stats and add 10 agi:
35 + 20 * 2.9 - 15 * 1.7 + 23 * 2.5 - 15 * 2
35 + 58 - 25.5 + 57.5 - 30
95 damage, an increase of 25.
So it is scaling differently, but you may have to go into higher differing values before you see a larger change.
I see, i was doing small changes, maybe that is way i wasn't seeing It at all.
Well, part of the issue for this kind of formula is small numbers... esp early in a game.
At the start of the game you will not see hardly any difference in damage values from gaining 1-2-3 points of a stat, esp if you use the standard variation of 20%
If you want obvious higher scaling (but harder to balance), I think you should considering using exponential damage from a stat instead of a set amount (+2.9 damage per STR or +2.5 damage per AGI)
Also, the more DEF a target has will rapidly lower the numbers since you have both attack stats vs one defensive stat
It took me a long time to find a sweet spot for my games formula, but I eventually decided to use exponential growth and it makes it so the damage values slowly increase, but you can feel the gains when you get a few levels or stat increases when sticking in an area for a while.
At the start of the game you will not see hardly any difference in damage values from gaining 1-2-3 points of a stat, esp if you use the standard variation of 20%
If you want obvious higher scaling (but harder to balance), I think you should considering using exponential damage from a stat instead of a set amount (+2.9 damage per STR or +2.5 damage per AGI)
Also, the more DEF a target has will rapidly lower the numbers since you have both attack stats vs one defensive stat
It took me a long time to find a sweet spot for my games formula, but I eventually decided to use exponential growth and it makes it so the damage values slowly increase, but you can feel the gains when you get a few levels or stat increases when sticking in an area for a while.
Precisely for that is because i didn't want to use higher number, because the balance issues. This one is throwing knife, and before it had higher scaling, but i had to reduce it because i was doing more damage than attacking with regular weapons and some skills.
I typed out an example of how an exponential formula works, at least in my game so you can see damage vs stats for each example...
Take it with a bit of salt, as my vision for damage may not match yours, but this is just to help you see an alternative method, possibly.
Hope this will maybe help you in some way to find a good balance you might be looking for 😀
Take it with a bit of salt, as my vision for damage may not match yours, but this is just to help you see an alternative method, possibly.
Hope this will maybe help you in some way to find a good balance you might be looking for 😀
Code:
Formula from my Game:
(((a.atk+Math.pow((a.atk/10), 2)))*(100/(100.00+b.def))+((a.atk-b.def)/2))
Example 1:
Attacker - 15 Attack
Target - 10 Defense
(((15+Math.pow((15/10), 2)))*(100/(100.00+10))+((15-10)/2))
((15+2.25)*(100/110)+(5/2))
Result - 18 damage, or using 20% variance 15-21 damage once rounded.
Seems fair for mild starting stats in a game.
Example 2:
Attacker - 25 Attack
Target - 10 Defense
(((25+Math.pow((25/10), 2)))*(100/(100.00+10))+((25-10)/2))
((25+6.25)*(100/110)+(15/2))
Result - 36 damage, or using 20% variance 29-43 damage once rounded.
Damage has already doubled just from gaining 10 points of the attack attribute vs same enemy def value.
10 points might be a bit much for 1 area gain, but if you count level ups + stats on weapons and armor,
it might not be unheard of.
Example 3:
Attacker - 45 Attack
Target - 60 Defense
(((45+Math.pow((45/10), 2)))*(100/(100.00+60))+((45-60)/2))
((45+20.25)*(100/160)+(-15/2))
Result - 33 damage, or using 20% variance 26-40 damage once rounded.
Much higher attack, but this time attacking a target with a fair bit more Def... in a lot of RPGs this
would result in very low damage or no damage at all. using exponential values can help drage out the
damage scaling drop off so a player can technically go into a location higher level than they are and
still have a chance, even if small, to defeat enemies and level up faster.
Example 4:
Attacker - 100 Attack
Target - 200 Defense
(((100+Math.pow((100/10), 2)))*(100/(100.00+200))+((100-200)/2))
((100+100)*(100/300)+(-100/2))
Result - 17 damage, or using 20% variance 15-19 damage once rounded.
In this instance, the attackers attack is only HALF of the targets defense, but with the formula we are
still able to penetrate and deal some damage. This could be used for exploring high level areas or just
having a very tanky enemy in a current location.
Example 5:
Attacker - 200 Attack
Target - 100 Defense
(((200+Math.pow((200/10), 2)))*(100/(100.00+100))+((200-100)/2))
((200+400)*(100/200)+(100/2))
Result - 350 damage, or using 20% variance 280-420 damage once rounded.
The opposite of example 4, you can see the damage output is much, much higher.
Example 6:
Attacker - 255 Attack
Target - 10 Defense
(((255+Math.pow((255/10), 2)))*(100/(100.00+10))+((255-10)/2))
((255+650.25)*(100/110)+(245/2))
Result - 945 damage, or using 20% variance 756-1134 damage once rounded.
And lastly, the end-game player crushing the scrubs of the games beginning (example 1). Sure, the
attackers attack is 15x what it was at the start of the game, but the damage output is over 52x!
These are just a few examples using exponential formula's... they can be a bit harder to balance, but allow for a much larger range of damage in
the end.
why are you subtracting def twice?
Original thread: https://forums.rpgmakerweb.com/threads/a-doubt-about-damage-formulas.161692/