- Joined
- Oct 29, 2012
- Messages
- 109
- Reaction score
- 21
- First Language
- German
- Primarily Uses
- RMMV
Alright, so I hope the title isn't too confusing. Anyways, I really enjoy the formula function that allowes me to create my own damage formulas, and it works most of the time just fine, but sometimes, I feel like either I did something wrong, or the maker interprets my formula the wrong way, anyway, to the problem.
I'm using a resistance-based system in my game, similar to the MMORPG Dofus. Just to explain it real quick, it reduces the amount of damage taken by a percentage, equal to the defense stat of said attack type.
So I did a little thinking, and came up with the following: a.atk - b.def / 100 * a.atk
In theory, this does exactly what it should do, I tried it with some example values, like: "67 - 50 / 100 * 67 = 33,5"
My first thought was, that it might have done it in the wrong order, so I put some brackets here and there: a.atk - ((b.def / 100) * a.atk) , however, this still doesn't work. The result is always, that it does the exact same amount of damage, without reducing any of it, except it hits 100 Resistance, where it does no damage as intended.
Example of what I mean:
Actor attacks with an attack stat of 20, enemy has a physical resistance of 50%. The output should be, without variance, 10, however, it comes out as 20.
Actor attacks with an attack stat of 20, enemy has a physical resistance of 100%. No damage is done, as intended.
I checked some threads for formula suggestions and problems, but I didn't find one that tackled a problem similar to this one, excuse me if one already exists!
I'm using a resistance-based system in my game, similar to the MMORPG Dofus. Just to explain it real quick, it reduces the amount of damage taken by a percentage, equal to the defense stat of said attack type.
So I did a little thinking, and came up with the following: a.atk - b.def / 100 * a.atk
In theory, this does exactly what it should do, I tried it with some example values, like: "67 - 50 / 100 * 67 = 33,5"
My first thought was, that it might have done it in the wrong order, so I put some brackets here and there: a.atk - ((b.def / 100) * a.atk) , however, this still doesn't work. The result is always, that it does the exact same amount of damage, without reducing any of it, except it hits 100 Resistance, where it does no damage as intended.
Example of what I mean:
Actor attacks with an attack stat of 20, enemy has a physical resistance of 50%. The output should be, without variance, 10, however, it comes out as 20.
Actor attacks with an attack stat of 20, enemy has a physical resistance of 100%. No damage is done, as intended.
I checked some threads for formula suggestions and problems, but I didn't find one that tackled a problem similar to this one, excuse me if one already exists!


