(Answered) Trouble with damage formula.

Alright so I've come up with a formula for all my skills so that I can dictate which skill deals more or less damage based on what they do. But regardless of that it still finished as 0 damage.


(100+((a.lvl/4)*(a.atk/10))*0.8)-(b.def/8)


The 0.8 is my variable for each skill. For some skills it might be 1.2 and others it might be 0.5.


This is based on a level 80 character with 450 attack. The mob has 800 defense.


(100 + ((80 / 4) x (450 / 10)) x Variable) - (800 / 8)
(100 + (20 x 45)) x 0.8) - 100
((100 + 900) x 0.8) - 100
(1000 x 0.8) - 100
800 - 100
700


I'm sure I did something wrong here, I just can't see it.


*edit* Initial problem of Zero damage is fixed, but now the skill deals only 144 damage rather than the 700 I would expect it to. No variance, no crits.


(100+((a.level/4)*(a.atk/10))*0.8)-(b.def/8)


*edit 2* Fixed the calculation.


Found out my 144 damage instead of 700 was due to Yanfly's Armor Scaling plugin.


http://yanfly.moe/tools/armorscalingcalculator/


Thanks to bgillisp for the help! 😀
You have a.lvl, but per the MV help it should be a.level. So the system is zero'ing out the formula as a.lvl doesn't exist. Try making that change and it should work.


Edit: Be warned though that enemies don't have levels unless you installed a plug-in to give them levels! So the fixed formula might still have errors when enemies attack until you install an enemy level plug-in.
Well the lvl to level worked. The skill deals damage now, though it only seems to deal 144 damage (No variance and crits are turned off) instead of the 620 I would expect it to.


And yes I will be using Yanfly's enemy level plugin, but it's not installed yet.
Hmmm...does the enemy have a ~23.22% element rate to whatever you are attacking with? Or do you have Yanfly's Armor scaling plug in installed?
*squints* I do have the armor scaling plugin. *dives into the plugin settings*


Didn't fully look into what it does aside from armor penetration (I have armor shattering skills).


No element rate.


*edit* Ahh so for this Armor Scaling I technically wouldn't even need to have the b.def in the formula, would I?


Though I'm not really grasping the calculations in the plugin settings.
Well, armor scaling does make it so that an 800 defense only does about 20% or so of the damage you expect, so that is why your damage is so much lower than you calculated. Yanfly just posted a calculator over the weekend so you can see what % of damage will be applied based on your character's defense, and 800 defense would be most of the difference.
You're right. That comes to exactly 144 damage. That's some potent damage scaling! That also solves my problem. Thank you very much! You have been a great deal of help, Bgillisp. 🙂


*edit* Also after looking up my calculation in the first post (not the formula), I realized I subtracted 100 twice when it should have only been once. I will change the calculation to reflect that and add some additional info for others people if they need it.
I did wonder about that -100 but thought I was just seeing things (as it is really late where I'm at). Glad it worked!
I've moved this thread to MV Support (there is also a pinned thread specifically for damage formula help). Please be sure to post your threads in the correct forum next time. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/answered-trouble-with-damage-formula.59989/