Hello, I'm a new member here, but been browsing the forums for years. I'm trying to figure out a damage formula for my VX Ace project, it's based off of old Final Fantasy games where enemy defense was converted into a percentile reduction, but keeps the core of quadruple user's attack reduced by double target's defense. For most generic weapon attacks, the formula is something along the lines of such:
((a.atk+a.agi)*2)*(1000/(1000+(b.def*2)))
So Character A has a Strength of 96, and an Agility of 112, the enemy they're attacking has a Defence of 456.
The sum of both attack stats doubled is 416, and the Damage Reduction value should return 0.52, which should reduce that damage to 215.
Most of the abilities ended up doing 0 damage and I read in this post https://forums.rpgmakerweb.com/index.php?threads/help-with-a-damage-formula.173075/ that VXA's Ruby Script rounds down divided integers, thus 0.xx returns 0, and that I should A. write the numbers as decimal for the script to read and calculate the decimals, and B. use as little brackets as possible. How would I go about that because I can't quite wrap my head around the math? That post was referring to hp-based damage so I can't use the hp_rate function. I'm not using any plugins whatsoever because I'm challenging myself to create something using only the default assets, and the only edits I've made to the scripts was to stop enemy attacks raising the TP bar, since I'm using it as a Stamina bar for physical attacks.
((a.atk+a.agi)*2)*(1000/(1000+(b.def*2)))
So Character A has a Strength of 96, and an Agility of 112, the enemy they're attacking has a Defence of 456.
The sum of both attack stats doubled is 416, and the Damage Reduction value should return 0.52, which should reduce that damage to 215.
Most of the abilities ended up doing 0 damage and I read in this post https://forums.rpgmakerweb.com/index.php?threads/help-with-a-damage-formula.173075/ that VXA's Ruby Script rounds down divided integers, thus 0.xx returns 0, and that I should A. write the numbers as decimal for the script to read and calculate the decimals, and B. use as little brackets as possible. How would I go about that because I can't quite wrap my head around the math? That post was referring to hp-based damage so I can't use the hp_rate function. I'm not using any plugins whatsoever because I'm challenging myself to create something using only the default assets, and the only edits I've made to the scripts was to stop enemy attacks raising the TP bar, since I'm using it as a Stamina bar for physical attacks.