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 Damage Calculator

Discussion in 'Technical Projects' started by DougJustDoug, Dec 24, 2009.

  1. Jumpman16

    Jumpman16 np: Michael Jackson - "Mon in the Mirror" (DW mix)
    is a Smogon IRC SOPis a Site Staff Alumnusis a Team Rater Alumnusis a Battle Server Admin Alumnusis a Researcher Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Dec 19, 2004
    Messages:
    4,768
    Very minor suggestion here, but in the Report window, the Critical Hit checkbox one has selected in Options does not show up in the Report. For example:

    252 Adamant Quick Claw Rhydon Stone Edge
    vs. 252/4 Bold Mesprit : 88.2% - 104.3%

    This is a CH. Pretty self-explanatory and I'm sure incredibly minor effort will need to be expended on your part.
  2. Atlas

    Atlas I'm the Mary!
    is a Smogon IRC AOp Alumnusis a Researcher Alumnus

    Joined:
    May 19, 2005
    Messages:
    3,496
    ev's slider need to be reworked, its starts off going by 4s and then goes by 3 then 4 again which screws up the how it works (0,4,8,11,15,19,23,27,31,34, etc)
  3. for54years

    for54years

    Joined:
    May 31, 2009
    Messages:
    288
    The ability Scrappy does not appear to work. For example, a Scrappy Miltank's CB Body Slam does no damage to any Ghost-Type. I didn't see anything about this in the Help Section, but I apologize if I overlooked something. Thanks!
  4. chaos

    chaos
    is a member of the Site Staffis a Battle Server Administratoris a Programmeris a Smogon IRC SOPis a Contributor to Smogonis an Administratoris a Tournament Director Alumnusis a Researcher Alumnus
    Owner

    Joined:
    Dec 18, 2004
    Messages:
    9,757
    My thoughts:

    - Calculator "moves" drop down shouldn't include non-attacking moves. Trying to select, say, Swords Dance, does nothing anyway.
    - Abilities that don't do anything of worth in damage calculator (natural cure, etc) shouldn't be included, just more to scroll through
    - It would be useful if you could select Nature by boost and not by name.
    - Types are currently separated with \, I have always seen /.
    - IVs, EVs, and stats are separated with -, I have always seen /.
    - Trying to calculate damage on a Pokemon that has not been filled in displays Infinity damage; it should probably just not show anything

    These are all nitpicks, the calculator is solid. Good work DJD.
  5. supermarth64

    supermarth64 Here I stand in the light of day
    is a Contributor Alumnus

    Joined:
    Dec 26, 2008
    Messages:
    2,441
    Actually, if you select Swords Dance, it boosts the attack thing by 2.
  6. chaos

    chaos
    is a member of the Site Staffis a Battle Server Administratoris a Programmeris a Smogon IRC SOPis a Contributor to Smogonis an Administratoris a Tournament Director Alumnusis a Researcher Alumnus
    Owner

    Joined:
    Dec 18, 2004
    Messages:
    9,757
    You're right. Isn't that counterintuitive? I expect a move to do something when I click "calculate"
  7. DougJustDoug

    DougJustDoug Knows the great enthusiasms
    is a member of the Site Staffis an Artistis a Programmeris a CAP Contributoris an Administratoris a Battle Server Admin Alumnusis a Smogon IRC SOp Alumnusis a Tiering Contributor Alumnus
    CAP Leader

    Joined:
    Jun 26, 2007
    Messages:
    3,083
    Non-damaging moves are only in the Quick Moves list; they aren't in the normal moves list. I explained their inclusion in the help page for the Quick Moves List (bolding added here only):

    And the choice to make boosts actually do something when chosen from the Quick Moves list, I explained that in the help for Quick Boosts:

    I'm not saying that everyone needs to agree with my design choices there, I'm just pointing out the reasoning behind it. In general, the inclusion of Smogon movesets changed my perception about what the calculator should do to take full advantage of them.
  8. Atlas

    Atlas I'm the Mary!
    is a Smogon IRC AOp Alumnusis a Researcher Alumnus

    Joined:
    May 19, 2005
    Messages:
    3,496
    this would be awsome, i always have to have supremecy open to figure out most natures


    also is it possible to load just the applet in a pop up window
  9. XxJohny2haixX

    XxJohny2haixX

    Joined:
    Jun 22, 2009
    Messages:
    127
    Hi i dont know if this counts as a problem, but I'll post anyway.

    I imput a Heracross (With Guts and Adamant and 252 Atk EVs) with Life ORB uses Close Combat against a the standard Wish Support Jirachi straight from the Smogon Calc. And the damage out put is: 52.6% - 62.3%.

    The same secenerio however the item Heracross holds is Flame Orb. I expected a greater damage output thanks to Guts , however it does less, which, at least I think isn't right. The damage output is: 40.6% - 48.1%.

    Thanks for helping. ^_^
  10. Atlas

    Atlas I'm the Mary!
    is a Smogon IRC AOp Alumnusis a Researcher Alumnus

    Joined:
    May 19, 2005
    Messages:
    3,496
    under heracross' ability in the "other" button, you need to go to status and activate "burn", this will activate guts ability into the damage (which turns out to be 60.8% - 71.8%)
  11. DougJustDoug

    DougJustDoug Knows the great enthusiasms
    is a member of the Site Staffis an Artistis a Programmeris a CAP Contributoris an Administratoris a Battle Server Admin Alumnusis a Smogon IRC SOp Alumnusis a Tiering Contributor Alumnus
    CAP Leader

    Joined:
    Jun 26, 2007
    Messages:
    3,083
    I really wanted to put some more features on the Nature widget/pick list. I investigated several alternative selection widgets, that would allow multiple attributes to be displayed/selected. But, all the widgets had a lot of framework associated with them, and they didn't play nicely with the rest of the calc, without requiring me to modify the widget code, the calculator, or both. I had already gone through quite a bit of hassle implementing some other custom widgets (like the sliders and dialogs, for example). So, my motivation to do anything special just for the Nature list was really low.

    I finally decided to make the Nature field a text field, and put a "dialog button" next to it (like the Type field, for example) that would open a dialog with several features for assisting with picking Nature based on boosts or drops. I just never got around to coding it. Like I said, my motivation to whip up a bunch of special coding for Nature, was really low by the end of the project. So, I just left it as a regular select list dropdown.

    I did put a table of all the boosts and drops on the help page for Nature. So, if you just press the Help Tool and then click the nature field, you can quickly see a list of all the natures and their respective stat boosts. I put that table in the help, specifically because I knew the information would be helpful when picking nature (I personally forget certain natures all the time!).

    The Damage Calculator is not a java applet. It's a webpage, with a boatload of javascript. But, yes, it could be opened with a call to window.open(), set the frame size, etc. Such a call would likely get blocked by many people's popup blockers, but still -- it is possible to do it. I don't think that should be the default mode of opening the calc, but it might be an interesting option somewhere.
  12. supermarth64

    supermarth64 Here I stand in the light of day
    is a Contributor Alumnus

    Joined:
    Dec 26, 2008
    Messages:
    2,441
    Primeape doesn't seem to work on my computer under Chrome, Safari, and Firefox. However, it works fine on IE. This is what happens in Chrome:

    Show Hide
    [​IMG]


    If I go to another Pokemon and choose its move and calculate it, then go back to Primeape, the movesets stay the same.

    Show Hide
    [​IMG]


    That's the only Pokemon I've seen it happen on so far.
  13. DougJustDoug

    DougJustDoug Knows the great enthusiasms
    is a member of the Site Staffis an Artistis a Programmeris a CAP Contributoris an Administratoris a Battle Server Admin Alumnusis a Smogon IRC SOp Alumnusis a Tiering Contributor Alumnus
    CAP Leader

    Joined:
    Jun 26, 2007
    Messages:
    3,083
    There were a bunch of unprintable characters in the analysis text for Primeape on the database. I don't know when all that junk was introduced, but I cleaned up the analysis text, and updated the movesets for the calculator. It may take a while before the server recaches the new file, so don't expect to see the fix immediately.
  14. DougJustDoug

    DougJustDoug Knows the great enthusiasms
    is a member of the Site Staffis an Artistis a Programmeris a CAP Contributoris an Administratoris a Battle Server Admin Alumnusis a Smogon IRC SOp Alumnusis a Tiering Contributor Alumnus
    CAP Leader

    Joined:
    Jun 26, 2007
    Messages:
    3,083
    I just posted a new version of the Damage Calculator that has some changes to the Options Dialog. There is now a section called "Shared Options", which are options that can be toggled on either the Attacker or the Defender, and will affect the damage calculation equally regardless of which side is toggled. Read the Help page for Shared Options for more info.

    I added a new option called "No Immunity" that will cause the calculator to disregard any immunity involved in a calculation. This option is intended to address the various conditions that can cause immunities to be bypassed -- like Foresight, Miracle Eye, Roost, Mold Breaker, Gravity, etc. I wrestled with a few different ways of handling it, and this option had the most "bang for the buck". It covers many of the situations, and wasn't a huge change to the calculator.

    I also added specific support for the Scrappy ability, as it applies to hitting Ghosts with Normal and Fighting moves. Scrappy pokemon do NOT need to toggle the "No Immunity" option to get the right calc. Scrappy is now built in to the basic damage calc.

    I also changed the Report window to have a setting to "Show Options", which includes Critical Hits, Flash Fire, Light Screen, etc.

    I updated the help pages for all the changes described above.
  15. The Diverman

    The Diverman

    Joined:
    Feb 2, 2009
    Messages:
    1,042
    When you select lucario as the defending pokemon, it doesn't show any movesets for it. But it does show if you select lucario as the attacking pokemon. Only reason why I even pointed this out is because I like using the calc. when I'm comparing speed stats.
  16. Habitus

    Habitus

    Joined:
    Dec 13, 2009
    Messages:
    60
    Setting the levels to 50, and clicking the shared option 2 v 2 seems to not be working (tried 2v2 on attacker, defender, and both). This was for both Water Spout and Surf.


    Just tried resetting the levels back to 100 and it still doesn't seem to affect the calcs at all.
  17. Luminary

    Luminary

    Joined:
    Jul 26, 2008
    Messages:
    138
    As far as I know, Struggle ignores type advantages and disadvantages. The calculator does not account for this.
  18. ADEP

    ADEP

    Joined:
    Feb 26, 2009
    Messages:
    31
    Salamence is not working in the sense that you can select his name and edit his moveset and EVs, etc. But you cannot pick any sets. If you had a pokemon selected before Salamence, it'll try and pull from those movesets. Essentially the same problem as Scuba Stevee and supermarth-- except mine doesn't work for the defender, either.
  19. DougJustDoug

    DougJustDoug Knows the great enthusiasms
    is a member of the Site Staffis an Artistis a Programmeris a CAP Contributoris an Administratoris a Battle Server Admin Alumnusis a Smogon IRC SOp Alumnusis a Tiering Contributor Alumnus
    CAP Leader

    Joined:
    Jun 26, 2007
    Messages:
    3,083
    2v2 was broken in all cases, due to a stupid typo on my part. Now it is fixed. Thanks for the bug report.

    I totally forgot to include Struggle when implementing "typeless" attacks like Doom Desire and Future Sight. Now, Struggle should work correctly. Thanks for the bug report.

    Since the Damage Calculator reads movesets from Smogon analyses, it is relying on the Analysis writers and C&C editors to make sure all the analyses are in the correct format. In the case with Salamence, the analysis writer did not properly format the speed EV's for a couple of sets. So, the program was abending behind the scenes every time it tried to load the Salamence movesets.

    I'm sure people will continue to mention moveset issues like that in this thread. But, for anyone tracking this thread, try to remember that any time a pokemon's movesets do not appear, and it leaves the previous pokemon's movesets in place -- then it is 99% likely to be a formatting problem with the pokemon's analysis. You can contact any member of Site Staff to review the analysis and try to locate the error. Most Site Staff should be familiear enough with the proper data format to locate the error.

    The most common formatting errors are usually in the EV lines. The EV number and stat must be separated by a space (ie. "252 Atk" not "252Atk") and the abbreviation must be correct ("Spe", not "Speed") ("SpD", not "SDef").
  20. eric the espeon

    eric the espeon maybe I just misunderstood
    is a Forum Moderator Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus

    Joined:
    Aug 7, 2007
    Messages:
    3,694
    Very minor point, in the drop down ability changer the ability Adaptability is incorrectly spelled "Adaptibility".
  21. DougJustDoug

    DougJustDoug Knows the great enthusiasms
    is a member of the Site Staffis an Artistis a Programmeris a CAP Contributoris an Administratoris a Battle Server Admin Alumnusis a Smogon IRC SOp Alumnusis a Tiering Contributor Alumnus
    CAP Leader

    Joined:
    Jun 26, 2007
    Messages:
    3,083
    Great catch. That bug was actually causing Pory-Z damage calcs to be wrong. I fixed it.
  22. jc104

    jc104 Humblest person ever
    is a Contributor Alumnus

    Joined:
    Aug 27, 2009
    Messages:
    1,780
    I'm very surprised that no-one has noticed this, but at the moment the burn status is cutting special attack as well as attack
  23. Shinedown_53

    Shinedown_53

    Joined:
    Mar 14, 2008
    Messages:
    4
    Leftovers has no effect on the damage calculation for me. Is this a bug or am I missing something, lol?
  24. imapedarsag

    imapedarsag

    Joined:
    Aug 22, 2009
    Messages:
    584
    Torrent doesn't work for me. I was using Blastoise vs. Skarmory if that matters. The damage was the same after I checked the ability box.
    EDIT: Shouldn't abilities like Anger Point just boost their corresponding stat? Either way, Anger Point's boost needs to be entered in manually. I get the feeling the abilities are still being developed.
  25. Jumpman16

    Jumpman16 np: Michael Jackson - "Mon in the Mirror" (DW mix)
    is a Smogon IRC SOPis a Site Staff Alumnusis a Team Rater Alumnusis a Battle Server Admin Alumnusis a Researcher Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Dec 19, 2004
    Messages:
    4,768
    Would it be possible to add a "Level" checkbox to the Reports window, for a corresponding "252 Timid Lv96 Gengar Sludge Bomb" (or Lv. 96 or Lv.96 or Lv 96, etc) output? It's not too big a pain to type these manually but there appears to be room for additional checkboxes for report outputs.

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