RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 75 of 77 View original ↗
  1. Robro33 said:
    the 5 is the engine not rounding. youll have to use Math.ceil() or some other rounding function to get rid of decimal results
    try replacing that value/=2 line with
    Code:
    value = Math.ceil(value/2);

    also pre-damage tags should work on healing skills. try sharing a pic of the skills that arent working as they are in the database?

    EDIT: just thought of it. do your healing skills use the formula box, or did you use a recover hp effect?

    The Math.ceil() worked like a charm! I'll start a new thread for the skills not working though, as what I've found from experimenting is a little silly: It appears to be based on the attack animation being used.
  2. SmashBroPlusB said:
    Well, guess it's as good a time as any to say I haven't solved the random number issue yet.

    a.atk + (rand(4) + 1) - b.defThis formula breaks things. Every attack now deals 0 damage... actually, they deal 1 damage since I'm using that one Minimum Damage plugin Yanfly whipped up, but it's still a broken formula. (Turning off the plugin shows 0 damage as well.)

    a.atk +1 - b.defThis makes Shiki (my test actor) deal 4 damage (5 ATK - 1 DEF on bats), which is the intended result.

    Anyone know how to generate random numbers in MV?
    I guess that after 8 years you solved this, but the use of random numbers in MV is through the Math.random() function.
  3. sirrichard1960 said:
    I guess that after 8 years you solved this...
    The answer was also provided in the very next post. Also 8 years ago.

    (Math.randomInt(X) is generally easier to work with in situations like this)
  4. If I want an enemy skill to do different damage if the target is not only a certain Actor, but also depending on a variable, how would I go about parsing this? I want the player to have a skill system for different armors (light, heavy, etc) that would simply add the variable value to their defense - but not other actors.

    I'm thinking I could run a conditional right before the battle start event which would check what kind of armor the player has equipped and set it to a variable as a number. Then, depending on which number that variable has (1=light, 2=heavy, etc), a different variable would be inserted into the damage formula for that armor's specific skill.

    Sort of like:
    if PlayerArmorVariable == 1 (light armor)
    enemy damage formula = a.atk*2 - b.def - \v[LightArmorSkill]
    else
    check PlayerArmorVariable for other armor types, doing the regular damage below if set to 'unarmored'
    enemy damage formula = a.atk*2 - b.def
  5. maybe a clearer example is in order?
    from what it sounds like to me... it would seem that you would be better off just adding more defence to your heavier armors?

    EDIT: actually, i think i see it now. That one is on me. Id do it as a state effect using yanfly's buffs and states. if you have light/mid/heavy as armor types, then each actor can have a passive to reduce incoming damage a flat amount based on their skill with the currently equipped armor's type instead of baking it into the damage formula and checking if the target is an actor there
  6. Robro33 said:
    Id do it as a state effect using yanfly's buffs and states. if you have ;ight/mid/heavy as armor types, then each actor can have a passive to reduce incoming damage a flat amount based on their skill with the currently equipped armor's type instead of baking it into the damage formula and checking if the target is an actor there
    Can Yanfly's Buff States Core add variable values to incoming damage when worn?

    Edit: in Auto Passive States I found this:
    <Passive Condition: Variable x Above y>

    It seems only to check a YES/NO if the variable is above a certain number, not factoring the number into oncoming damage ;_;

    DOUBLE EDIT: I suppose I could just have a conditional branch before the battle begins that applies a temporary state buffing the actor's defense that is removed after the battle. No idea why I didn't try that...
  7. fladdles said:
    Can Yanfly's Buff States Core add variable values to incoming damage when worn?
    fladdles said:
    It seems only to check a YES/NO if the variable is above a certain number, not factoring the number into oncoming damage

    the react/confirm effect tags allow you to edit damage dealt directly. an actor with a state that has a react effect to reduce damage could have it be to subtract a variable's value from the damage theyd take as your example detailed. youd just have to check for what the armor type of their armor is, and use the appropriate variable
  8. Hi, this is my damage formula for a normal attack:
    ((((2 * a.level / 5 + 2) * a.atk * 40 / b.def) / 50) + 2)
    Would I be able to swap "40" with the Attack parameter from the character's equipped weapon? If so, how?
  9. ShoujoDev said:
    Hi, this is my damage formula for a normal attack:
    ((((2 * a.level / 5 + 2) * a.atk * 40 / b.def) / 50) + 2)
    Would I be able to swap "40" with the Attack parameter from the character's equipped weapon? If so, how?
    you can get the weapon's atk with a.equips()[0].params[2]
  10. ShoujoDev said:
    Hi, this is my damage formula for a normal attack:
    Just a couple of notes:
    - You can consolidate some of your math. For example, in the first part instead of saying 2 * a.level / 5 you can just say a.level * .4

    - You say it's for "normal attack" - by default, enemies use the same Attack skill as actors. Make sure they are assigned different skills, or else this will cause errors because enemies don't have a level property, nor the equips() method that Robro gave you.
  11. Hello guys! Do you think this formula is suitable for a high tier spell? Could be quite elementary, but i'm still a newbie and i'm trying to make balanced formulas just using what i know from the engine:
    Math.floor(Math.randomInt(21) + 250 + (a.mat * 1.5) - (b.mdf * 0.8))
  12. RoncoMonco said:
    Do you think this formula is suitable for a high tier spell
    that cannot be determined by showing one formula without the rest of the game to contextualize it. in some games, 100 damage is alot. in others, 9999 damage is alot. theres disgaea where by the end, playable characters have health pools that exceed one billion, stats cap at 100 million, and 1 million damage is considered *very, very low damage*
  13. @RoncoMonco In addition to what @Robro33 said, there's no reason to encapsulate your formula in Math.floor(), unless you specifically want it to round down before other steps of the calculation.

    RPG Maker already rounds the value after doing the damage formula, variance and critical hit.
  14. Robro33 said:
    that cannot be determined by showing one formula without the rest of the game to contextualize it. in some games, 100 damage is alot. in others, 9999 damage is alot. theres disgaea where by the end, playable characters have health pools that exceed one billion, stats cap at 100 million, and 1 million damage is considered *very, very low damage*
    You're right. I'll give you some additional guidance on my damage and hp calculation. Generally, this spell is obtained when enemies in the game reach an HP value of 1000. Furthermore, the Bosses in that area have an HP range between 2000 and 2500. Players who arrive at this area generally have a magical attack between 35 and 40 (without items) and an equivalent magical defense. Every Level Up increase these stats by 3-4 points. The spell itself costs 50MP on a total of 150.

    ATT_Turan said:
    @RoncoMonco In addition to what @Robro33 said, there's no reason to encapsulate your formula in Math.floor(), unless you specifically want it to round down before other steps of the calculation.

    RPG Maker already rounds the value after doing the damage formula, variance and critical hit.

    Hello Turan, thanks for the reply.
    So you're telling me that the formula could easily be reduced to: (Math.randomInt(21) + 250 + (a.mat * 1.5) - (b.mdf * 0.8))?
  15. @RoncoMonco Yes, and there even appears to be an extraneous set of parentheses around that whole thing.
  16. ATT_Turan said:
    @RoncoMonco Yes, and there even appears to be an extraneous set of parentheses around that whole thing.
    Could you gently write me back that formula in the correct way? Thank you.
  17. @RoncoMonco In math, (parentheses around a section) says to (do that part first).

    (Parentheses around the entire thing doesn't mean anything.)
  18. ATT_Turan said:
    @RoncoMonco In math, (parentheses around a section) says to (do that part first).

    (Parentheses around the entire thing doesn't mean anything.)
    Thanks for your clarity, was easiest than i though. Just a little off-topic for general knowledge: what would be the implications of putting brackets that are redundant and useless, as happened with this formula? Can these inaccuracies ruin the gameplay in any way?
  19. @RoncoMonco No. It doesn't hurt anything, they're just meaningless. Makes it harder to go back and read your formula later.