1. New to the forums? Check out our Mentorship Program!
    Our mentors will answer your questions and help you become a part of the community!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

Programming Mass Damage Calculators

Discussion in 'Technical Projects' started by Honko, Sep 4, 2011.

  1. whitefag

    whitefag

    Joined:
    Jul 1, 2010
    Messages:
    46
    Furthermore...
    via http://masara.byethost15.com/SilverlightDmgCalcTestPage.html
    252 Atk Terrakion Stone Edge vs 0 HP/0 Def Multiscale Dragonite: 52.32% - 62.23% (169 - 201)

    via http://www.honko.freehosting.com/manly_calc.html
    Stone Edge: 170-204 (52.63 - 63.15%)

    http://kalashnikov.pokecenter.ru/damage/
    52% - 61% (168 - 200 HP)
    ===

    Masara: 252 Atk Terrakion Stone Edge vs 0 HP/0 Def Dragonite: 104.95% - 124.46% (339 - 402)

    Honko: Stone Edge: 338-402 (104.64 - 124.45%)

    Mine: 104% - 124% (338 - 402 HP)
    ===

    Masara: 252 Atk Life Orb Terrakion Stone Edge vs 0 HP/0 Def Multiscale Dragonite: 68.73% - 80.8% (222 - 261)

    Honko: Stone Edge: 222-264 (68.73 - 81.73%)

    Mine: 67% - 80% (218 - 260 HP)
    ===

    Masara: 252 Atk Life Orb Terrakion Stone Edge vs 0 HP/0 Def Dragonite: 137.46% - 161.61% (444 - 522)

    Honko: Stone Edge: 440-522 (136.22 - 161.6%)

    Mine: 135% - 161% (438 - 522 HP)

    Multiscale is kinda understandable, it was added in gen 5 and no additional research in damage formula was made, we all just assumed that it applies the same way old modifiers apply, so maybe we put this modifier in different spots in our formulas...
    But why results without Multiscale differ is beyound my understanding. I remember finding an error in old version of masara's calc (he forgot one rounding), I have no idea if it's fixed now.
  2. whitefag

    whitefag

    Joined:
    Jul 1, 2010
    Messages:
    46
    Ok, step-by-step calculation using the formula.
    Scenario without Multiscale:
    Neutral natured Terrakion with 252 Atk EVs vs Neutral natured Dragonite with 0 HP and 0 Def EVs
    All IVs are 31, lvl 100, Stone Edge, no held items or modifiers.
    Terrakion's Attack is 357
    Dragonite's Defense is 226, HP is 323

    ((((((100 × 2 ÷ 5) + 2) × 100 × 357 ÷ 50) ÷ 226) + 2) × R ÷ 100) × 1.5 × 2)
    So it's 402 when random modifier is max and 338 when Terrakion is out of luck.
    However, if we do not round down after applying STAB modofier, we have 169.5 * 2 = 339, so that's probably where Super Basic's error is.

    Now if we give our Terrakion LO:
    The formula is almost the same:
    (((((((100 × 2 ÷ 5) + 2) × 100 × 357 ÷ 50) ÷ 226)+ 2) [134] × 1.3) × R ÷ 100) × 1.5 × 2)
    Results are: 440 - 522. So, this time, only Honko's calc is correct. And I have no idea where a lesser number came from...

    Scenario with Multiscale:
    Assuming Multiscale applies the same way Filter and Solid Rock do (this needs research however), we simply need to divide numbers above by two (and round down of course)
    Without LO: 169 - 201
    With LO: 220 - 261
  3. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,167
    Yeah, all the new BW items and abilities I had to guess where to add it to the formula, so they might be in the wrong place resulting in small rounding errors. When a sexy researcher publishes the full formula for this gen I'll definitely fix everything, but until then things like Multiscale and Sheer Force may or may not be off by a point or two.
  4. Violatic

    Violatic
    is a Battle Server Moderator Alumnus

    Joined:
    Apr 25, 2011
    Messages:
    22
    I had an idea for this although I don't know how implementable it is.

    Before I make my suggestion I'd like to say this is a fantastic tool.

    I think the most useful part of it is deciding what EVs / Moves are most useful for each set. Would it be possible to get it to run a comparison between two pokes at tell you the pokes which one 1HKO's compared to the other (so you could compare say Scald vs Surf) and also 2HKO's. Again I have no idea how easy it is to do so if it isn't just say so and I won't mind.

    I was also curious if it was worth implementing things like Leftovers into sets for damage done, given that they heal that much off.

    It is a great tool!
  5. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,167
    That's a neat idea! It's certainly possible, but it would take quite a bit of work, so I won't be able to do it anytime soon. I'll keep it in mind though, because that would be an awesome feature.

    Minor update: I've fixed Grass Knot, Low Kick, and Heavy Smash. They now have variable BP that adjusts depending on the target's (and user's for Heavy Smash) weight, so your MixApe and CB Aggron calculations should finally be accurate.
  6. dcae

    dcae naughty list

    Joined:
    Dec 9, 2011
    Messages:
    1,169
    For some reason its not working on my comp recently. I used it to great success however, so I was wondering the problem. I use Google Chrome.
  7. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,167
    I've added a couple of new features to the mass calcs recently. There are two checkboxes down at the bottom now that let you customize how the results come out. Checking the first one (Strict) removes from the results any Pokemon that don't actually qualify for the tiers you've selected; no more Alomomola and Shedinja wasting space on your OU mass calcs, for example.

    The second is the long-awaited Copypasta! When this one is checked, the results will come out as plain text that you can easily select, copy, and paste straight to the forums/chat/etc. The format is still a little ugly, so I'm open to suggestions there, but hopefully this will make the calculators easier to use for general discussion. Enjoy!

    (Also, anytime the calculator isn't working, try clearing your cache.)
  8. Wobbanaut

    Wobbanaut

    Joined:
    Feb 29, 2012
    Messages:
    1,002
    Thank you for this wonderful creation
  9. Wobbanaut

    Wobbanaut

    Joined:
    Feb 29, 2012
    Messages:
    1,002
    I can't believes it works on IPad and not on IE though
  10. Draycos7

    Draycos7

    Joined:
    Mar 10, 2012
    Messages:
    168
    This is a beautiful thing. Thanks a million for making it.
  11. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,167
    I've added a piece to the 1v1 (manly) calculator that gives you the % chance for your attack to OHKO, 2HKO, or 3HKO, factoring in Stealth Rock, Spikes, Leftovers, and weather damage, plus abilities like Poison Heal and Ice Body. You can set the entry hazards and weather status in the box on the right side.

    Also, I seem to be approaching my bandwidth limit for the month on that domain, so if people could start using this mirror (lol) instead for a while, that would be great.
  12. Furai

    Furai wellfare
    is a Site Staff Alumnusis a Team Rater Alumnusis a Forum Moderator Alumnusis a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Contributor Alumnusis a Past SPL Winner

    Joined:
    May 4, 2010
    Messages:
    2,844
    Umm, Honko, I was trying to calculate Choice Band Terrakion's Sacred Sword agasint +1 Bulk Up Dialga and I was surprised to find it does not exist in the calculator. Could you fix it by any chance?

    EDIT: I also just noticed that if you put an LC Pokemon as the target, it doesn't become automatically at level 5.
  13. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,167
    Thanks for the heads up Furai, I've added Sacred Sword. Can you clarify what you mean about LC Pokemon not becoming Lv 5 though? It seems to be working for me.

    I've also added support for Speed-based moves, so you can finally get accurate calcs for your OTR Zong's Gyro Ball, and of course the unstoppable Choice Scarf Electro Ball Electrode!
  14. Furai

    Furai wellfare
    is a Site Staff Alumnusis a Team Rater Alumnusis a Forum Moderator Alumnusis a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Contributor Alumnusis a Past SPL Winner

    Joined:
    May 4, 2010
    Messages:
    2,844
    Well, if you try and put Pokemon such as the reintroduced Gligar, Murkrow, and Misdreavus, or even Munchlax, they're put as level 100 by default. Some work perfectly, they're instantly put at level 5 (Mienfoo, Chinchou, Staryu), and some don't, such as the ones I mentioned.

    I'm talking manly calc, btw.

    EDIT: Psycho Boost is missing as well!
  15. Wobbanaut

    Wobbanaut

    Joined:
    Feb 29, 2012
    Messages:
    1,002
    I think that's because all of them have sets in the higher tiers
  16. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,167
    Yeah, Wobbanaut's right, it was looking at what tier the Pokemon is listed in to determine the level, rather than what meta the set is for. Fixed that and added Psycho Boost.
  17. Furai

    Furai wellfare
    is a Site Staff Alumnusis a Team Rater Alumnusis a Forum Moderator Alumnusis a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Contributor Alumnusis a Past SPL Winner

    Joined:
    May 4, 2010
    Messages:
    2,844
    Sweet. I'll tell you if the calculator is missing more moves.
  18. jackm

    jackm

    Joined:
    Dec 12, 2011
    Messages:
    354
    This may just be my computer, but I can't access it currently. I believe that the internet free hosting service is rejecting me, but I'm not sure. If it's something that's fixable, that would be great, because this is the easiest and best damage calculator out there (at least for me) and I'm really annoyed by the formatting of some others.

    (EDIT: disregard this post. I hadn't noticed the mirror you posted. Sorry.)
  19. Furai

    Furai wellfare
    is a Site Staff Alumnusis a Team Rater Alumnusis a Forum Moderator Alumnusis a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Contributor Alumnusis a Past SPL Winner

    Joined:
    May 4, 2010
    Messages:
    2,844
    The mirror does not work for me though. I'm getting 404 Not Found, and below that nginx/1.1.15. Is that just the site, or is there something wrong with my computer? :c

    EDIT: Working now.
  20. Melee Mewtwo

    Melee Mewtwo Is a Fox main.
    is a member of the Site Staffis a Smogon IRC AOPis a Forum Moderatoris a Community Contributoris a Tiering Contributoris a Contributor to Smogon
    Moderator

    Joined:
    Jan 26, 2011
    Messages:
    2,171
    Thank you so much for this calculator, it's absolutely incredible. By the way, is there any way you can make a filter between special and physical attacks? It would be a lot easier to build a physical Gliscor spread without having to search through all of the Surfs and HP Ices.
  21. Furai

    Furai wellfare
    is a Site Staff Alumnusis a Team Rater Alumnusis a Forum Moderator Alumnusis a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Contributor Alumnusis a Past SPL Winner

    Joined:
    May 4, 2010
    Messages:
    2,844
    Umm, Honko, you're missing burn's effects in your calculator. If it's the same as Reflect though, you might want to put a slash there, because it's kinda confusing.
  22. Furai

    Furai wellfare
    is a Site Staff Alumnusis a Team Rater Alumnusis a Forum Moderator Alumnusis a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Contributor Alumnusis a Past SPL Winner

    Joined:
    May 4, 2010
    Messages:
    2,844
    Sorry for double posting, but adding to my post above, Gyro Ball's calculations are wrong after you have gotten a Speed boost. Once I add +2 to the opponent, the calculation doesn't change.
  23. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,167
    It seems to be working for me. Are you sure the power wasn't maxed out already? If you're doing something like Ferrothorn vs Sharpedo, the +2 won't matter because Gyro Ball is already at full power against +0.

    I'll add things like burn, Helping Hand, and spread move power reduction in doubles eventually. I know those things are missing, I just haven't gotten around to it.
  24. Wobbanaut

    Wobbanaut

    Joined:
    Feb 29, 2012
    Messages:
    1,002
    Fling isn't in the Calculator
  25. I Am

    I Am

    Joined:
    Feb 27, 2011
    Messages:
    69
    My nigga, you're a legend. Great work.

Users Viewing Thread (Users: 0, Guests: 0)