Damage Formulas 101

● ARCHIVED · READ-ONLY
Started by Skunk 281 posts Page 6 of 15 View original ↗
  1. Nice! I tried that formula and it works perfectly. It also seems to work if I let it check for a 3rd or a 4fth state. Thank you very much!
  2. Piggybacking on Gorgutz's question, is there a way to do like, a massive amount of states without checking each one? Like, If I want to increase damage for each positive state on a target: (Regen, Reraise, Accuracy Up, etc.) I wanted to make a skill check for like, 66 different states, but I'm afraid of crashing the game.

    Also, all my "Positive states" are in order, like in a row. So, does that help? Like, can I do:
    Code:
    a.isStateAffected(10..77)
  3. Zacyiia said:
    Might want to read this article by Yanfly: http://www.yanfly.moe/wiki/Stop_Putting_Mechanics_in_Damage_Formulas
    Context: you are using auto-battle.

    EDIT
    @epson777341
    I don't know what you're using (MV/MZ), but, maybe my plugin could help
    Theo - Actor and Enemy Metadata I see no reason why it won't work in MV.

    The usage would be as simple as
    Code:
    a.meta.buff
    And tag your states with <buff> to indicate if it is a buff.
    If you have 33 states that are tagged as buff, "a.meta.buff" will return 33.
  4. I'm using MV.
    I tried your plugin. it doesn't seem to work.
    Kept getting errors in my main project, so I put it in a fresh project, and it just doesn't count the states.
    Thanks for trying though.
  5. TheoAllen said:
    Context: you are using auto-battle.

    EDIT
    @epson777341
    I don't know what you're using (MV/MZ), but, maybe my plugin could help
    Theo - Actor and Enemy Metadata I see no reason why it won't work in MV.

    The usage would be as simple as
    Code:
    a.meta.buff
    And tag your states with <buff> to indicate if it is a buff.
    If you have 33 states that are tagged as buff, "a.meta.buff" will return 33.
    Auto-Battle was used to show what happens when MV's AI takes over. In other words when an enemy uses a skill, what is mentioned in the article will happen. I tested this my self and the result is the same. If you had fully read the article then you would know that the context is: Adding mechanics to Damage Formula will break the enemy AI.
  6. Zacyiia said:
    Adding mechanics to note tags will break the enemy AI.
    Default Enemy AI does not use this evaluation. So it is fine.
  7. If that is the case then show me what you think the difference is between enemy AI and Auto-Battle AI.
  8. TheoAllen said:
    Default Enemy AI does not use this evaluation. So it is fine.
    I can confirm this. I have a lot of mechanics in my skills and this problem never occured to me with enemies.
    I guess I am also lucky that I do not use Auto-Battle.
  9. From Yanfly's Artical:

    Explanation​

    1613569160970.png

    The above two functions are the "culprit" to why this happens. I say "culprit" in quotes because it's not really a culprit. It's doing what it's supposed to be doing: its job of calculating the damage formula. It's not at fault that we, the game devs, decided to put game mechanics inside the damage formulas.

    But why did it calculate without the actions being performed though?

    That's because for some cases, like the A.I. for Auto Battle, all of a battler's available actions have to be evaluated in order to determine the optimal action to perform for battle. RPG Maker's A.I. is simplistic, find the largest number, go with the skill that produces the largest number. However, because we put mechanics in them, each time the calculations are made, the mechanics are also being performed.

    Why did it happen TWICE though? Let's look back at the troops page:
    1613569186108.png
    There are two enemies there.

    The A.I. would evaluate each available skill for each available enemy. This means if there are two enemies, the skills are evaluated twice each. And this will happen each turn. If there are 8 enemies, the skills will be evaluated 8 times each. This means that the self-HP halving skill would occur 8 times over had there been a full enemy party.

    Let's see what happens on turn 1 with 8 enemies instead.

    1613569203369.png

    Poor Harold now starts battles with only 2 HP. Geez...

    This problem is not exclusive to just Auto-Battlers either. Auto-Battlers just happen to be the easiest way to show the problem. This problem happens each and every time evaluations are made to determine the proper skill to use via A.I.
  10. It seems the article is simply being dismissed because the information is inconvenient. Maybe read the entire thing instead of skimming or ignoring it.
  11. @Zacyiia I read the article. I read the actual code in the core files.
    Screenshot_733.jpg

    Guess what, that is only used in auto-battle. Yes, if you're utilizing auto-battle then stop using it. If you are not, be liberal with what you want to do and use any hack you want as long as you know what you're doing.

    Maybe, try to actually read the code instead of just reading someone's article and believing it. If you want to prove me wrong, then give evidence if it is not exclusive in auto-battle.
  12. And for what reason should I believe you or the OP? You say you read the actual core code? How do I know you are not a liar? Why not post your own article and accuse Yanfly of lying if your that confident? Show me how exactly I am wrong. Don't just post code without an explanation, hoping that I might not understand what you have posted. So far you have only dismissed or ignored anything I have said or posted. All I did originally was suggest to others that they read said article. Never did I say "You have to make your game according to said guidelines."

    Your original reply was nothing but ignorant and arrogant. You never fully explained your reasoning for why Yanfly is wrong. The replies you have given are void of any information and simply state your opinion on the matter. Seeing as you have no interest in giving a full explanation as to how and why RPG Maker MV / MZ would use two different AI to handle battles, your reply is probably going to involve why you think you are superior and I should just shut up and go away. You seem to think the burden of proof is on me. I hate to break it to you but you are the one who started making accusations. Thus the burden of proof is on you. You accused the author of writing misinformation. Since that is the case you need to give an actual explanation as to why and how the author is wrong. If you simply dismiss this again, then you are a liar and a slanderer. I would have no reason to trust anything you say at that point.
  13. epson777341 said:
    Piggybacking on Gorgutz's question, is there a way to do like, a massive amount of states without checking each one? Like, If I want to increase damage for each positive state on a target: (Regen, Reraise, Accuracy Up, etc.) I wanted to make a skill check for like, 66 different states, but I'm afraid of crashing the game.

    Also, all my "Positive states" are in order, like in a row. So, does that help? Like, can I do:
    Code:
    a.isStateAffected(10..77)
    You can do
    Code:
    let sum = 0;
    for (i = 10; i < 78; i++){
    if (user.isStateAffected(i)) sum += 1;
    }
    To only check for those states you have lined up.
  14. Zacyiia said:
    And for what reason should I believe you or the OP?
    It is up to you.
    I made several plugins, at least you know I have some degree of knowledge.
    But it is really up to you honestly.

    Zacyiia said:
    You say you read the actual core code?
    Yes

    Zacyiia said:
    How do I know you are not a liar?
    By reading the actual code. Or maybe, you can't?
    You can just admit it if you can't. I won't blame you.
    You can ask other plugin dev as well if you're curious enough.
    Or create an entire thread asking if it is true.

    Zacyiia said:
    Why not post your own article
    Because the article is actually good. It is a good practice to just use the damage formula for damage calculation only. There is no debate on that.

    That doesn't mean you can not use any hack available. Game developers use the hack in almost every corner. Use game variables to store text so you can use \v[n] in the text and all. It is the same.

    Zacyiia said:
    and accuse Yanfly of lying if your that confident?
    Yanfly is not lying. Maybe the evaluation process is also used in other plugins, that is what they were trying to say if I could tell. Like maybe, a damage estimation plugin that shows estimate damage before you execute the skill. That would be using the evaluation. But by default, it is only used in the auto-battle

    Zacyiia said:
    Don't just post code without an explanation, hoping that I might not understand what you have posted.
    I only tell that the context is auto-battle and that it is. I think it is already easy to understand. What makes you think that would break something outside of it? There is no explanation in the article, and you just believe in that.

    Zacyiia said:
    So far you have only dismissed or ignored anything I have said or posted.
    There, I'm quoting every sentence of your post.

    Zacyiia said:
    All I did originally was suggest to others that they read said article. Never did I say "You have to make your game according to said guidelines."
    And all I did was just adding the context. "This is for auto-battle" and somehow you were being pissed for no reason.

    Zacyiia said:
    Your original reply was nothing but ignorant and arrogant. You never fully explained your reasoning for why Yanfly is wrong.
    How can I explain when there is nothing to explain?
    If I posted the code, this is only used in auto-battle and nothing else.
    How can I explain that the code is not being used somewhere else?
    it just doesn't exist... what to show?

    Zacyiia said:
    The replies you have given are void of any information and simply state your opinion on the matter.
    There is no opinion on this.

    Zacyiia said:
    Seeing as you have no interest in giving a full explanation as to how and why RPG Maker MV / MZ would use two different AI to handle battles
    They are not using a different AI to handle the battle. But I want to make sure, what AI you meant here. Enemy AI or auto-battle AI?

    Zacyiia said:
    your reply is probably going to involve why you think you are superior and I should just shut up and go away
    You're free to think whatever you want.
    But if you can not keep up with me then you better shut up.

    Zacyiia said:
    I hate to break it to you but you are the one who started making accusations.
    All I did was just giving a context "this is for auto-battle".

    Zacyiia said:
    Thus the burden of proof is on you. You accused the author of writing misinformation
    All I did was just giving a context "this is for auto-battle".

    Zacyiia said:
    Since that is the case you need to give an actual explanation as to why and how the author is wrong. If you simply dismiss this again, then you are a liar and a slanderer. I would have no reason to trust anything you say at that point.
    You seem frustrated enough to not being able to provide proof that it is also being used outside the auto-battle thus putting the burden on me for no reason.

    EDIT:
    Zacyiia said:
    If that is the case then show me what you think the difference is between enemy AI and Auto-Battle AI.
    If this is the one you want an explanation for, the enemy AI uses a weight-based pattern. NO skill evaluation is used.
  15. TheoAllen said:
    You're free to think whatever you want.
    But if you can not keep up with me then you better shut up.
    So I was right. You see yourself as superior therefore you won't accept any possibility of being wrong.
    image.PNG

    By weight based you are referring to this? This is a part of the evaluation process. Not the entire thing. If this not what you are referring to, then you are either making stuff up. I am starting to think those plugins you claimed to have made are not your work. Seeing as you are having some difficulty explaining how and why there are two different AI's for the battle system. So not only are you a liar and a slanderer, but possibly a thief as well? How Awful.
  16. Zacyiia said:
    you won't accept any possibility of being wrong.
    Can you replicate the issue in the damage formula by using the enemy AI weight-based evaluation?
  17. Unless you're using the different AI options Yep AI core (or idr what it's called) gives you.
    It's evaluated based on it's rating. The enemy AI doesn't consider anything else but that.
    and I LIKE Theo's work. It's relatively easy to use and understand.

    you can say: I think you're wrong.
    Don't get mad if someone calls you on out it.
    Also
    Actors by default don't have a rating system available to them. And they shouldn't need one by default either. There's no point. They simply use the skills they know/learn by their class/ traits that rack up the most damage.

    You CAN set/use the auto battle on them if you wish. But a player probably won't get the most out of that character outside of just autoing down the enemy for a swift victory.



    But to blindly accuse him of thievery because you aren't winning a debate its another thing all together.
  18. Cut it out everyone. I don't care who started it, I'm ending this. Return to debates on damage formulas please.

  19. Cyberhawk said:
    Unless you're using the different AI options Yep ai core (or idr what it's called) gives you.
    It's evaluated based on it's rating. The enemy AI doesn't consider anything else but that.
    and I LIKE Theo's work. It's relatively easy to use.
    It states in the article that no plugins were used, as well as a full explanation as to what causes the issue when using mechanics in the damage formula box.
    TheoAllen said:
    Can you replicate the issue in the damage formula by using the enemy AI weight-based evaluation?
    Let me get this straight: you want me to replicate an issue found in one part of the evaluation process; in another part of the evaluation process.

    Lets say an enemy has more than one skill with a rating of 9 and no other conditions for activation. How does the AI choose which skill to use? The Action Patterns are not the only factor in the evaluation process. As Yanfly stated in the article:

    That's because for some cases, like the A.I. for Auto Battle, all of a battler's available actions have to be evaluated in order to determine the optimal action to perform for battle. RPG Maker's A.I. is simplistic, find the largest number, go with the skill that produces the largest number. However, because we put mechanics in them, each time the calculations are made, the mechanics are also being performed.

    Action Patterns are a part of that process.