1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Guest, PO has ceased our separate tiering and adopted Smogon tiers for SM. More information and updates here.

    Dismiss Notice

It's a Damage Calculator!

Discussion in 'Technical Projects' started by sulcata, Jun 10, 2014.

  1. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    https://sulcata.github.io/sulcalc/

    Hello this is a damage calculator, have fun!
    Translations are obviously horribly incomplete. If anyone feels like contributing to them then find the appropriate language file here and start translating all the things in quotes. All the Pokemon, Item, Ability, and Nature names come from PO's translations, so head over there if you want to help out with that.

    It features:
    • Multihit moves without assuming the number of hits.
    • Calculating the probability of two different moves KOing in succession.
    • Swapping Pokemon.
    • A lot more moves implemented compared to honko's.
    • Support for healing berries (Sitrus, Oran, etc.) when calculating the chance to KO.
    • A beautiful grayscale interface.

    If you have any issues with the calculator or bugs either PM me on the server or forums or just post something here.
    Suggested features are also always appreciated :)

    TO-DO LIST:
    • Add stat drops from moves like Draco Meteor and Superpower.
    • Gen 7 stuff
    • Find translators maybe

    • (18:56) Rasu: your calc still sucks
    • (15:05) Rasu: why your damage calc is still so bad
     
    Last edited: Apr 5, 2017
  2. Isa

    Isa Well-Known Tauros

    Joined:
    Dec 11, 2011
    Messages:
    936
    Likes Received:
    1,006
    PO Trainer Name:
    Isa
    Lots of thanks for the past gen support.

    If you want help with old gen sets, call me, you have my number!
     
    ALLALA likes this.
  3. Epikhairz

    Epikhairz Delta Stream

    Joined:
    Mar 15, 2013
    Messages:
    929
    Likes Received:
    102
    PO Trainer Name:
    Epikhairz
    zomg inverted calc tyvm sulcata ^.^
     
  4. Pangaea

    Pangaea resto en peaco

    Joined:
    Mar 20, 2014
    Messages:
    329
    Likes Received:
    46
    awesome, thanks a bunch! I vote to make this a sticky thread.
     
  5. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    Good Job Sulcata
    potato comment is my fav
     
  6. Pangaea

    Pangaea resto en peaco

    Joined:
    Mar 20, 2014
    Messages:
    329
    Likes Received:
    46
    Why doesn't the RBY version have an option to add a move? Without it you can't calculate anything. Or is that just me?
     
  7. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    My local copy shows the move input just fine. I'll check when I can access the internet from my computer. What is your operating system and internet browser?

    Dr. Doom, my calculator already shows the stats off to the side after the stat boosts are applied. Not sure if you mean something else or if you just missed it.
     
  8. Dr. Doom

    Dr. Doom Long time hater of stall

    Joined:
    Jan 1, 2012
    Messages:
    2,123
    Likes Received:
    110
    Oh derp, I need to work on my observation skills...

    Your calculator doesn't take into account Judgment changing type with the held Plate.
    Screen Shot 2014-06-13 at 21.40.26.png
    As you can see, that should've done much more damage.
     
  9. Marina

    Marina The Marshtomp has seen it all before.

    Joined:
    Sep 10, 2013
    Messages:
    218
    Likes Received:
    81
    PO Trainer Name:
    Min
    Do my eyes suck or is there no way to calculate using Mega Evolutions?
     
  10. The Dude

    The Dude The Mannis

    Joined:
    Apr 5, 2011
    Messages:
    1,728
    Likes Received:
    163
    I used Mega's before but now they seem to be gone lol.
     
  11. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    I was tinkering around with the code for extracting information from the PO databases. Looks like something had changed to the databases themselves since I last extracted the information so the different format threw it off a bit. Already fixed, but it might take a while for you to notice unless you clear the cache for the page (each browser is different, the internet has the answers).
     
  12. Dr. Doom

    Dr. Doom Long time hater of stall

    Joined:
    Jan 1, 2012
    Messages:
    2,123
    Likes Received:
    110
    Foul Play doesn't work either
    Screen Shot 2014-06-15 at 17.06.05.png
     
  13. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    Dumb typos. I forgot an else. Will fix when I get home.

    edit: fixed it
     
    Last edited: Jun 15, 2014
  14. Marina

    Marina The Marshtomp has seen it all before.

    Joined:
    Sep 10, 2013
    Messages:
    218
    Likes Received:
    81
    PO Trainer Name:
    Min
    http://prntscr.com/3x528g

    Er, that doesn't feel right to me. Just speaking from the gut, here.

    edit: It's probably something to do with Sturdy

    +2 252+ SpAtk Fairy Aura Xerneas Hidden Power vs. 252 HP/252+ SpDef Leftovers Keen Eye Skarmory: 260 - 308 (77.8 - 92.2%) -- guaranteed 2HKO after Leftovers

    +2 252+ SpAtk Fairy Aura Xerneas Hidden Power vs. 252 HP/252+ SpDef Leftovers Sturdy Skarmory: 16 - 16 (4.8 - 4.8%) -- That's probably not going to KO... after Leftovers
     
  15. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    Typos in the code again, I'll upload a fix after I finish coding links to calculations. For now just don't use sturdy I guess.
     
  16. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    knock off doesn't take item into account!!!!!!!!!!!!
     
  17. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    Elaborate?
     
  18. Ortheore

    Ortheore One beautiful monster

    Joined:
    Aug 7, 2012
    Messages:
    761
    Likes Received:
    336
    0 Atk Snow Warning Abomasnow Knock Off vs. 0 HP/0 Def Snow Warning Abomasnow: 56 - 66 (17.4 - 20.6%) -- 0.5% chance to 5HKO, guaranteed 6HKO (itemless obv.)

    0 Atk Snow Warning Abomasnow Knock Off vs. 0 HP/0 Def Leftovers Snow Warning Abomasnow: 56 - 66 (17.4 - 20.6%) -- 2.8% chance to 7HKO, 59.2% chance to 8HKO, guaranteed 9HKO after Leftovers

    Yeah, in the latter instance Knock off should do more damage because it knocks off the held item

    Edit: I just noticed that for past gens it fails to take into account the cap on stats at 999, making it really difficult to do calcs for anything that manages to boost to that range. Idk if that's a priority, but I thought I'd point it out
     
    Last edited: Jun 28, 2014
  19. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    Yeah, what ortheore said. Knock off isn't taking whether or not the opp actually has an item or not into account when calcing :0
     
  20. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    Dumb typos. Will upload later with everything else.

    Also good suggestion for the 999 thing in gens 1&2 ortheore, already fixed it I think.
    edit 12/5/14: i just realized that he was meaning it was bugged, which it wasn't for the calculation. Only for display.
     
    Last edited: Dec 15, 2014
  21. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    Hey it would be cool if you could "save" certain sets so you don't have to re-enter them all the time :>
     
  22. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    I already put that in my to do list.

    If you're referring to the ability to for each user to save their own sets, I will not do that.
     
  23. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    hahas okay
     
  24. Dr. Doom

    Dr. Doom Long time hater of stall

    Joined:
    Jan 1, 2012
    Messages:
    2,123
    Likes Received:
    110
    Refrigerate doesn't work.

    Screen Shot 2014-07-22 at 18.37.22.png

    It should actually do something like this:

    Screen Shot 2014-07-22 at 18.39.55.png
     
  25. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    BIG FAT UPDATE:

    Thanks for pointing that out. Dumb typos, I fixed it, etc.
    Nevermind, I didn't. Will look into again...

    Okay I think I fixed it now.

    There's a bunch of other bug fixes I probably forgot, mostly pointed out by karppu.
    Formatting also improved with suggestions from karppu.

    You can now link damage calculations. Create your damage calculation and press "Export Calculation". The link will appear in the textbox below.

    I also modified the calculator to only request its database as it needs it, so it should load quite a bit faster. I've noticed it loads more than twice as fast for me personally, and according to Finchinator it went from 25-30 seconds to 15ish.

    Edit: And of course Diancie, Floette-EF, Hoopa, and Volcanion are included.
     
    Last edited: Jul 27, 2014
  26. Undefeated

    Undefeated .To hax, learn to be haxed.

    Joined:
    Aug 14, 2014
    Messages:
    37
    Likes Received:
    2
    PO Trainer Name:
    Undefeated.
    Awesome calculator, thank you. :)
     
  27. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    bigger FATTER update!
    lol fatter than zorodark

    New Stuff:
    • Removed redundant Pokemon.
    • ORAS shit added.
    • Tweaked the interface.
    • Probably made the whole thing a little faster.
    • Made my code look nicer!

    Bug Fixes:
    • Protean fixed.
    • A couple Parental Bond fixes, but I forget exactly what.
    • Probably a few UI fixes.
    • Probably other stuff too.
     
    Aurist and Strudels like this.
  28. Dr. Doom

    Dr. Doom Long time hater of stall

    Joined:
    Jan 1, 2012
    Messages:
    2,123
    Likes Received:
    110
    Thanks for adding the ORAS stuff. One thing though: Delta Stream doesn't work.

    This was calculated with Delta Stream.
    Screen Shot 2014-11-21 at 20.31.54.png
    And this without
    Screen Shot 2014-11-21 at 20.31.59.png

    They both did the same damage, when with Delta Stream the damage should be lower.
     
  29. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    Does anyone know exact mechanics on Delta Stream?

    Is it super effective with halved damage like Filter? Or does it change the message to not say super effective?

    Does it affect allies in doubles and triples battles? Opposing Pokemon?
     
  30. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    sulcata likes this.
  31. DSM01

    DSM01 Jammin' out

    Joined:
    Aug 7, 2011
    Messages:
    705
    Likes Received:
    59
    Hidden Power is calculated incorrectly in all old gens and appears to be getting a free 50% boost.
    252+ SpAtk Heatran Hidden Power Grass vs. 252 HP/0 SpDef Leftovers Starmie: 302 - 356 (93.2 - 109.9%)
    252+ SpAtk Heatran Dark Pulse vs. 252 HP/0 SpDef Leftovers Starmie: 220 - 260 (67.9 - 80.2%)
     
  32. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    Fixed hidden power and made the results include the type/power.
    It wasn't all old gens, just gens 3-5 because of something I must've changed at some point.

    Added Delta Stream mechanics. Currently I am implementing it as follows:
    Is the weather Strong Winds, is the defender Flying-type, and is the move super effective against Flying?
    If the answer to all of those is yes, halve the damage on the same step as when Fire/Water moves get boosted by Sun/Rain.

    I added the "Strong Winds" to the Weather selection box and I made the selection of "Delta Stream" auto select it.

    Moogle also found one of my dumb typos and I fixed that.
    I forgot to prefix NOGENDER with Genders. in some Gen 6 Rivalry code for those who were curious.
     
  33. mibuchiha

    mibuchiha Was yea ra chs ieeya.

    Joined:
    Oct 8, 2010
    Messages:
    1,340
    Likes Received:
    289
    PO Trainer Name:
    mibuchiha
    Suggestion: List Mega after the original mons. The current listing with a huge block of Mega AA BB CC and so on is rather unwieldy and makes for impractical searching.
     
    sulcata likes this.
  34. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    Coded mib's suggestion. The order seems a lot better.
    It was harder than you'd think since I add them to a list in alphabetical order, so I need to add them in the right spot after all is sorted.

    Made the Type changing options more visible (originally under more options).
    people should stop thinking +2 is the same as not very effective->effective... among other misconceptions

    On a minor note I made missingno stop displaying stats. I should probably make an error message for missingno and (no move), but I'm planning something maybe more elegant than an ugly alert window.
     
    mibuchiha likes this.
  35. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    just have the result text give the error probaly
     
  36. mibuchiha

    mibuchiha Was yea ra chs ieeya.

    Joined:
    Oct 8, 2010
    Messages:
    1,340
    Likes Received:
    289
    PO Trainer Name:
    mibuchiha
    Weird that you say so. When I suggested it I had a simple playing with regexp in mind. Like, if(startsWith("Mega ")) then ignore those first five characters during sorting etc.

    Granted, it's a conception so I haven't worried about the details and implementation so I could be oversimplifying.
     
  37. Dr. Doom

    Dr. Doom Long time hater of stall

    Joined:
    Jan 1, 2012
    Messages:
    2,123
    Likes Received:
    110
    There's a weird bug going on when I tried to calc Shell Smash Cloyster's Icicle Spear on Avalugg in Inverted battle. Here it is:

    Screen Shot 2014-12-01 at 19.32.40.png
    I have no idea why that happened
     
  38. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    I left some debug stuff in accidentally (fixed).
     
  39. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    sulcata!!! use console.log!!!
     
  40. sulcata

    sulcata stéphane curry best waifu Forum Moderator Server Administrator Forum Moderator Server Administrator

    Joined:
    Jun 13, 2012
    Messages:
    968
    Likes Received:
    744
    no then i forget to remove it.
    i like interrupting the flow of the program so I can see how different variables are interacting.
    i.e. im too lazy to use an actual debugger or w/e