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. Crux

    Crux
    is a Forum Moderator Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Sep 14, 2009
    Messages:
    1,296
    This is actually incredible. My only suggestion is that you perhaps make the results c/p'able within the table.
  2. Myrmidon

    Myrmidon

    Joined:
    Sep 26, 2007
    Messages:
    134
    Chandelure (Choice Specs)
    SolarBeam 74.19 - 87.45%
    HP Ice 43.36 - 51.25%

    nice try, but Chandy has a 0.81% chance of surviving... :P
  3. Manxer

    Manxer

    Joined:
    Oct 1, 2010
    Messages:
    50
    man this is awesome
    I'll go and recommend my friend using this as well
    and we don't have to spend more than a minute to calc what is the best option when we're in battle
  4. Blue Kirby

    Blue Kirby Never back down.
    is a Tutor Alumnusis a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Smogon IRC SOp Alumnusis a Smogon Media Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnusis a Past SPL + WCoP Winner

    Joined:
    Nov 1, 2007
    Messages:
    2,841
    This is a pretty brilliant initiative. Thanks for pouring time into this, it's going to be incredibly handy to all walks of the Pokemon community.
  5. whitefag

    whitefag

    Joined:
    Jul 1, 2010
    Messages:
    46
    Not stricter, stupid own standarts that are supported only by Microsoft.

    I suggest a possibility to add own sets for opponents. There are, well, sets that aren't on smogon database. I think you can also use statistics for that.

    And I think you can merge getUserOptions() and getTargets() into one function (or an object so you can generate json with whatever generates that code) to save some traffic and avoid writing same code twice.
  6. HoiPolloi

    HoiPolloi

    Joined:
    Aug 28, 2011
    Messages:
    296
    Awesome job.
  7. Darkaxis

    Darkaxis

    Joined:
    Jun 11, 2011
    Messages:
    710
    this is truly awe-some great job dude great job with the PO Re-player and this Smogon MIGHT become the international facebook of pokemon (even more of what it is now)
  8. ssbbm

    ssbbm

    Joined:
    May 14, 2010
    Messages:
    1,020
    It says that Specs Heatran and Chandelure KO +1 CM Reuniclus with Overheat while they don't /:
    I think what happens is Overheat ignores boosts for some weird reason; the calcs seem to be correct for Kyurem's Specs DM.
  9. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,168
    Good catch. Looks like the calculator is assuming Flash Fire is activated. I'll fix that soon.

    Thanks for the tips, I will look into json. As for adding custom sets, I'm hesitant to do that, mostly for simplicity. In the long run, Smogon should eventually have most of the noteworthy sets. If there's a really popular set that Smogon doesn't have for some reason, I can always add it manually.
  10. whitefag

    whitefag

    Joined:
    Jul 1, 2010
    Messages:
    46
    Well, I meant manual input, when building a pokemon one usually want to ensure KO against certain threat no mater what set it runs (and people usually use own sets, even stupid ones sometimes) which will need calculations with least beneficial circumstances (e.g. +Def nature, max HP/Def IVs and EVs when calclating coverage).

    And I have one more question: why do you store all the data (moves, their effects, pokemon, etc) in js executables? You could store it in, say, some SQL db and retrieve it with server-side script, this will significally reduce scripts size.
    It's just a question, I'm curious a bit)
  11. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,168
    Good news! I've added LC Pokemon to the calculator, and their silly single digit stats give some amusing damage %s when you forget to change tiers (CB Guts Heracross Megahorn vs Choice Scarf Abra: 145610.52 - 171315.78%). I also fixed the Flash Fire bug (it now shows that the attacker has Flash Fire activated, and there's another entry for when it isn't). Enjoy!

    If you mean being able to copy-paste them into Excel, you can. Just select it all and copy it into Notepad or some other text editor first to get the tabs and newlines in, then copy that into Excel.

    I actually had an earlier version of the calculator where you can customize both sides, I just stopped working with it at a certain point, so it would need some fixes now. I'll try to get that up relatively soon.

    There's two reasons I'm using js executables instead of a db. The first is that I built this thing without a clear plan; I just took AMF's old calculator and added things on in pieces until I wound up with what we have now. The second is that I'm not really doing enough with the data to make the abstraction of a db valuable. It runs fast enough now, and I can't think of any other queries I'd need to make, so there's not much practical gain in swapping in some MySQL+PHP. But you're right that what I'm doing right now isn't exactly best practice, and if I was doing this for work or a class I'd definitely be using a more elegant solution.
  12. MaestroXXVI

    MaestroXXVI

    Joined:
    Jun 20, 2011
    Messages:
    202
    this is very awesome, and i wount be able to stress that enough, but can you add in some option selects?

    for instance, for the one vs all calculator, can you add in things like
    "ignore all that dont get ohko'd/2hko'd"
    "ignore air balloon"
    "ignore intimidate" (in case something is behind a sub)
    "assume stealth rocks" (which would basically be "ignore multiscale", i guess)

    or maybe, if you can do something more general, add a check box beside each name which would hide it on clicking it, in case I'd only like to care about some pokemon in a tier (i dont particularly care what alomomola walls, but i'd certainly like to see quagsire in my results, for instance)? then add an "unhide all" check box, or undo all hides whena new calculation is performed.
  13. kmuffinman

    kmuffinman

    Joined:
    Jul 12, 2011
    Messages:
    169
    Sorry for necroing, but i noticed a problem with the offensive calculator; it doesn't have Hyper Beam
  14. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,168
    Added Hyper Beam.

    Now that Pokemon can have analyses for multiple tiers on-site, the calculator will use the tier the set is meant for, rather than just the tier the Pokemon is in. So for example, Milotic's OU bulky water set will show up in OU, but only her UU sets will show up in UU. The same will be true for Uber Pokemon once those analyses get uploaded. Hopefully this will make the calculator even more useful for specific tiers.

    As for additional features, like more filters, copypastable damage calcs, and the version where you can customize both sides: I will get to those eventually, but I'm very busy for the next several months, so it probably won't happen for a while.
  15. Charizard92

    Charizard92

    Joined:
    Jan 6, 2011
    Messages:
    229
    favourited, great job!
  16. Pocket

    Pocket Apo, the astronaut's best friend >:3
    is a Site Staff Alumnusis a Team Rater Alumnusis a Forum Moderator Alumnusis a Community Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus

    Joined:
    Dec 22, 2004
    Messages:
    8,580
    Thank you for this great resource, Honko! Just one problem though - I think the Grass Knot calculations are off.

    For instance:
    Sash Alakazam's Grass Knot vs Physically Defensive Milotic (252 HP / 0 SDef):
    ~ Honko's Spread Calc: 37-44%
    ~ Real Damage: 47-55%

    Sash Alakazam's Grass Knot vs CroCune (252 HP / 4 SDef):
    ~ Honko's Spread Calc: 39-46%
    ~ Real Damage: 49-58%
  17. LUST

    LUST
    is a Team Rater Alumnusis a Forum Moderator Alumnusis a Tiering Contributor Alumnusis a Past WCoP Winneris a SPL Winner

    Joined:
    Jul 14, 2011
    Messages:
    964
    Incredible, good job man.
  18. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,168
    Yeah I was lazy and just set Grass Knot/Low Kick to 80 power and Gyro Ball/Heavy Slam to 100 instead of actually checking the weight. I have some time off later this week so I'm planning on improving a few things, including this.
  19. MaestroXXVI

    MaestroXXVI

    Joined:
    Jun 20, 2011
    Messages:
    202
    are the calcs down?
  20. verbatim

    verbatim Red like Roses
    is a Battle Server Administratoris a Smogon IRC AOPis a Forum Moderator
    Moderator

    Joined:
    Jun 11, 2011
    Messages:
    1,404
    Posting to say that the online version of the calculator is currently down.
  21. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,168
    They're back up now. My account got taken down with no warning for some reason...I guess that's what I get for using shady freehosting!

    I'm on winter break now, so hopefully I'll be able to make some cool changes/additions over the next couple weeks.
  22. Honko

    Honko
    is a Programmeris a Tiering Contributoris a Contributor to Smogon

    Joined:
    Dec 6, 2009
    Messages:
    1,168
    Alright, I finally sat down and busted out the 1v1 version of the calculator. Now you can select the sets for both the attacker and the defender and tweak both sides to get exactly the calculation you want. Enjoy!

    http://honko.freehosting.com/manly_calc.html

    (and let me know if you find any bugs)
  23. MaestroXXVI

    MaestroXXVI

    Joined:
    Jun 20, 2011
    Messages:
    202
    hmmm
    the question is: who's wrong?

    via http://masara.byethost15.com/SilverlightDmgCalcTestPage.html
    252 Atk Terrakion Stone Edge vs 0 HP/0 Def Multiscale Dragonite: 52.32% - 62.23%
    169, 172, 174, 175, 178, 180, 181, 184, 186, 187, 190, 192, 193, 196, 198, 201

    via http://www.honko.freehosting.com/manly_calc.html
    Stone Edge: 170-204 (52.63 - 63.15%)
    170, 174, 176, 176, 180, 182, 182, 186, 188, 188, 192, 194, 194, 198, 200, 204

    ===

    Masara: 252 Atk Terrakion Stone Edge vs 0 HP/0 Def Dragonite: 104.95% - 124.46%
    339, 345, 348, 351, 357, 360, 363, 369, 372, 375, 381, 384, 387, 393, 396, 402

    Honko: Stone Edge: 338-402 (104.64 - 124.45%)
    338, 344, 348, 350, 356, 360, 362, 368, 372, 374, 380, 384, 386, 392, 396, 402

    ===

    Masara: 252 Atk Life Orb Terrakion Stone Edge vs 0 HP/0 Def Multiscale Dragonite: 68.73% - 80.8%
    222, 223, 226, 229, 232, 234, 237, 240, 243, 244, 247, 250, 252, 255, 258, 261

    Honko: Stone Edge: 222-264 (68.73 - 81.73%)
    222, 224, 228, 230, 234, 236, 240, 240, 242, 246, 248, 252, 254, 258, 260, 264

    ===

    Masara: 252 Atk Life Orb Terrakion Stone Edge vs 0 HP/0 Def Dragonite: 137.46% - 161.61%
    444, 447, 453, 459, 465, 468, 474, 480, 486, 489, 495, 501, 504, 510, 516, 522

    Honko: Stone Edge: 440-522 (136.22 - 161.6%)
    440, 446, 452, 458, 462, 468, 474, 480, 482, 488, 494, 500, 504, 510, 516, 522
  24. shnen

    shnen שוני
    is a Battle Server Moderator Alumnus

    Joined:
    Sep 13, 2011
    Messages:
    873
    the NU part of all vs one seems to not work at all for me, and I think someone else on #neverused encountered the same problem. It is down on both my iPad and my old Mac btw.
  25. steelguttey

    steelguttey

    Joined:
    Nov 5, 2011
    Messages:
    94
    Well, no NU analysis are done yet, at least i think so, so we'll have to wait

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