RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 11 of 77 View original ↗
  1. gotnovicks said:
    I'm trying to set this formula in a skill but it always returns me 0 (zero):

    a.atk * (1 - (b.def / (b.def + 100))basically, it uses defense to work similarly to physical reduction. :C

    also what those .min and .max means in formulae? and how to use them?
    What is probably the problem is that

    (b.def / (b.def + 100)always gives you a value between 0.999 and 0 so

    a.atk * (1 - (b.def / (b.def + 100))will always be

    a.atk * (1 - (number between 0.999 and 0)therefore multiplying your a.atk by a value between 0.999 and 0, which the game might round to 0

    Try 

    a.atk * (2 - (b.def / (b.def + 100))Maybe that will work
  2. luigiman2201 said:
    What is probably the problem is that

    (b.def / (b.def + 100)always gives you a value between 0.999 and 0 so

    a.atk * (1 - (b.def / (b.def + 100))will always be

    a.atk * (1 - (number between 0.999 and 0)therefore multiplying your a.atk by a value between 0.999 and 0, which the game might round to 0

    Try 

    a.atk * (2 - (b.def / (b.def + 100))Maybe that will work
    but it'll make the atk higher (the result will be a number between 2 and 1).

    The (b.def / (b.def + 100) should return a decimal  

    like in a % of physical damage.

    If the target has 25 def it'll have 25/125 = 0.2 ~~ 20% of physical reduction :T

    javascript always round down? in Ruby (VxAce) I used this code and it worked D:
  3. I'm having trouble writing the damage formula I've decided on into MV.

    Basically it works like this:

    (a.X - b.def) * (a.Y / 2)

    X is the total attack stat of the attacker, equipment bonus included,

    while Y is the user's BASE attack stat, minus any bonuses granted by equipment.

    How would one write this?
  4. SpellcraftQuill said:
    All attacks and skills. Even if I try to lower bow damage, it's exponential.

    EDIT: I remove the level formula and a lower DEX bow still does more damage than a STR-based sword that would be equal in the amount.

    IE: a 40 DEX Bow is still stronger than a 40 STR Sword.

    var x = 1; var arr = [81]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? a.level + a.atk + a.mdf - b.def: 0}; x += + a.level + a.atk*2; x - b.def;This is my current formula. A bow can do a lot less damage than a sword at first, but at higher levels, a a stronger sword will still deal less damage than a bow.

    Well, crud. We'll get this eventually! :D

    Now for some questions...

    • 81 is which weapon? You may need to setup multiple arrays depending on different weapon types. I whipped up the below damage equation. 25-30 are the katanas (adding a.mat) while 19-24 are swords (adding a.agi). You could theoretically make arrays for every weapon.
    var x = 1; var arr = [25, 26, 27, 28, 29, 30]; var arrb = [19, 21, 22, 23, 24]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? a.level + 2 * a.mat : 0; x += a.hasWeapon($dataWeapons[arrb]) ? a.level + 2 * a.agi : 0}; x += 2 * a.atk; x - 2 * b.def;
    • x += + a.level + a.atk*2 should maybe just be x += a.level + a.atk*2
    • Do you use your equation in a skill or somewhere else?
    • The - b.def in the conditional statement may off balance the attack, but I'm not sure. It would mean that the target's defense would more greatly reduce the damage dealt if using weapon ID 81. 

    And, I'll probably be even slower on my responses for the next day or two... barring another bout of insomnia. XD
  5. gotnovicks said:
    I'm trying to set this formula in a skill but it always returns me 0 (zero):

    a.atk * (1 - (b.def / (b.def + 100))basically, it uses defense to work similarly to physical reduction. :C

    also what those .min and .max means in formulae? and how to use them?
    Is that a direct cut and paste of the formula you use?  If so, your problem is you don't have a closing ) at the end.  You have 3 opening ( but only 2 closing )
  6. Dachimotsu said:
    I'm having trouble writing the damage formula I've decided on into MV.

    Basically it works like this:

    (a.X - b.def) * (a.Y / 2)

    X is the total attack stat of the attacker, equipment bonus included,

    while Y is the user's BASE attack stat, minus any bonuses granted by equipment.

    How would one write this?
    X would equal atk, so (a.atk - b.def) would be the first part of your equation.

    As for Y, equipment bonus are added automatically, so without a plug in, there's no way to separate the base attack and equipment bonus in the formula bar. 
  7. I am new to RPG MAKER MV and Javascript so I am not sure if this is a dumb question or not but how do you use an eval code? If so, how do I check if an actor is having a specific state? Like if they have a "poison" state then the attack will deal more damage?
  8. YouKnowA said:
    Well, crud. We'll get this eventually! :D

    Now for some questions...

    • 81 is which weapon? You may need to setup multiple arrays depending on different weapon types. I whipped up the below damage equation. 25-30 are the katanas (adding a.mat) while 19-24 are swords (adding a.agi). You could theoretically make arrays for every weapon.
    var x = 1; var arr = [25, 26, 27, 28, 29, 30]; var arrb = [19, 21, 22, 23, 24]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? a.level + 2 * a.mat : 0; x += a.hasWeapon($dataWeapons[arrb]) ? a.level + 2 * a.agi : 0}; x += 2 * a.atk; x - 2 * b.def;
    • x += + a.level + a.atk*2 should maybe just be x += a.level + a.atk*2
    • Do you use your equation in a skill or somewhere else?
    • The - b.def in the conditional statement may off balance the attack, but I'm not sure. It would mean that the target's defense would more greatly reduce the damage dealt if using weapon ID 81. 

    And, I'll probably be even slower on my responses for the next day or two... barring another bout of insomnia. XD

    I decided to stop troubling you about it then. Most games still use Strength for bows anyhow and it'll just make archers' Strength useless. I'm just hoping that Yanfly's new plugin would let us use the dexterity stat for a hit rate and critical chance, making archers good for critical damage. Sorry about that.
  9. I was trying to work on my damage formula so I set the Mdf of a enemy too 1 and my character has a magic stat of 70 or so but the spell will do 0 damage. It will start doing damage if I take off the mdf from the formula but I don't think it's supposed to work that way. Can anyone help with this.
  10. KeroTani said:
    I was trying to work on my damage formula so I set the Mdf of a enemy too 1 and my character has a magic stat of 70 or so but the spell will do 0 damage. It will start doing damage if I take off the mdf from the formula but I don't think it's supposed to work that way. Can anyone help with this.
    It would help if you provide the damage formula you're using.
  11. lilyWhite said:
    It would help if you provide the damage formula you're using.
    Good point. (a.mat*2 - mdf). Crap I just looked and I didn't put the b. in front of the mdf part. I'm still new to this so I think i'm overlooking things.
  12. OK, so if my current damage formula is impossible, then I'm gonna need help coming up with a replacement.

    Therefore, I will list as much as I can about the stats in my game and the results I want out of them.

    First, there's the average ATK stat the heroes will have at each level. At lv1, it's 40, and at lv50, it's 68. Not too drastic of an increase from 49 level-ups.

    Second, there's the average DEF stat the enemies will have at each projected level. At lv1, it's 10, and at lv50, it's 38. Again, small numbers.

    So, at lv1, you have (an average of) 40 ATK vs 10 DEF, and at lv50, you have 68 ATK vs 38 DEF.

    Now, I'm trying to come up with a formula that will result in particular damage ranges at each of these levels. For level 1, I'd like the base damage (before variance) to be somewhere between 150-200. For level 50, somewhere between 550-750.

    Any more experienced mathmeticians out there wanna solve this for me?

    EDIT: I have discovered and perfected the perfect damage formula for my needs. Please disregard this post.
  13. Dachimotsu said:
    OK, so if my current damage formula is impossible, then I'm gonna need help coming up with a replacement.

    Therefore, I will list as much as I can about the stats in my game and the results I want out of them.

    First, there's the average ATK stat the heroes will have at each level. At lv1, it's 40, and at lv50, it's 68. Not too drastic of an increase from 49 level-ups.

    Second, there's the average DEF stat the enemies will have at each projected level. At lv1, it's 10, and at lv50, it's 38. Again, small numbers.

    So, at lv1, you have (an average of) 40 ATK vs 10 DEF, and at lv50, you have 68 ATK vs 38 DEF.

    Now, I'm trying to come up with a formula that will result in particular damage ranges at each of these levels. For level 1, I'd like the base damage (before variance) to be somewhere between 150-200. For level 50, somewhere between 550-750.

    Any more experienced mathmeticians out there wanna solve this for me?
    It would depend on how you wanted the math to work. at level one and an attack of 4 you formula would be (a.atk*5-b.def*2)  you would need to change your numbers a bit to get them to scale the way you want them. Having smaller numbers can work well but it makes hitting some numbers hard.
  14. Let's say I have a skill where the formula is 100 + 50.

    Without making a duplicate skill, is there a way to set it up so that if the person using the skill is an enemy, it becomes 100 - 50 instead?
  15. Sera said:
    Let's say I have a skill where the formula is 100 + 50.

    Without making a duplicate skill, is there a way to set it up so that if the person using the skill is an enemy, it becomes 100 - 50 instead?
    I think we need more information than this. Where are the 100 and 50 coming from? If they're fixed numbers, why not just write 150 in the box?

    Unless, of course, you're just using these numbers as examples. Either way, we need more information than this.
  16. I was using them as examples, yes. In reality, the numbers being used were really complicated formulas.

    But someone else actually helped me to figure this out a moment ago. The solution is:

    s = a.isEnemy() ? -1 : 1; 100 + (50 * s)
  17. VHStapes said:
    EDIT: New question!

    How can I target a different character in the party, besides a or b, without it being actor specific? Let's say I want a skill that deals damage and heals every party member except the caster for an amount equal to the damage dealt? So...

    x = (a.tk - b.def); ALL_OTHER_PARTY_MEMBERS.gainHp(x); x

    What should ALL_OTHER_PARTY_MEMBERS be replaced with?
    I'm trying to do some skill that is quite the same of your, did you figured out how to heal/buff all party members? I didn't find a reply in here about this, or maybe i'm blind lol.

    I'm looking to do 2 "limit" skills that deals aoe damage to enemy, one as bonus heal the party and remove debuffs, and the other give bonus damage of 1 element....

    Someone know how to apply heal/buff to entire party? I just need an example so i can figure out other kind of similar "limit" skill
  18. Dachimotsu said:
    OK, so if my current damage formula is impossible, then I'm gonna need help coming up with a replacement.

    Therefore, I will list as much as I can about the stats in my game and the results I want out of them.

    First, there's the average ATK stat the heroes will have at each level. At lv1, it's 40, and at lv50, it's 68. Not too drastic of an increase from 49 level-ups.

    Second, there's the average DEF stat the enemies will have at each projected level. At lv1, it's 10, and at lv50, it's 38. Again, small numbers.

    So, at lv1, you have (an average of) 40 ATK vs 10 DEF, and at lv50, you have 68 ATK vs 38 DEF.

    Now, I'm trying to come up with a formula that will result in particular damage ranges at each of these levels. For level 1, I'd like the base damage (before variance) to be somewhere between 150-200. For level 50, somewhere between 550-750.

    Any more experienced mathmeticians out there wanna solve this for me?

    EDIT: I have discovered and perfected the perfect damage formula for my needs. Please disregard this post.
    Would you mind posting what you ended up with?  Kinda curious what direction you went.
  19. I'm running with: (a.atk * 2) - ((b.def / 2) + (b.agi / 4))

    In the game Heavy armor has high Defense and negative agility and light armors have low defense and positive agility.

    Seems okay so far.
  20. How would one go around to setting up a basic attack, that does more damage based on how much HP the user has lost?