Programming Pokémon Showdown Damage Calculator

I don't know if this has been brought up before, but IMO its slightly inconvenient that the four default moves for the calc can include status moves.
AFAIK the sets are ripped from analyses, but when you're calcing, status moves don't do anything. For example, the doubles Diancie set is
Code:
Diamond Storm
Moonblast
Trick Room
Protect
Time entering moves could potentially be saved if it was instead
Code:
Diamond Storm
Moonblast
Body Press
Play Rough
Its not a big deal, but it could really matter in a time sensitive game. Another big thing is that scrolling through the list of moves is extremely painful on mobile.

My proposed solution is to allow all new analyses written to include a 'four most common offensive moves' set specifically used for the calc and update older analyses to include it. This will be hidden on the analysis page, just directly submitted to the calc. This is the best solution, but it could be unfeasible to update all existing sets. An automatic solution is to include 2 slashed (alternate) moves over status moves where possible (executed by whatever program in charge of ripping the analyses sets for use in the calculator). This doesn't seem too difficult to implement in my head.
 
Last edited:
Hello there

I'm new to the forums but have been using the calculator for a few weeks now in my personal offline gaming challenge runs.

I'm not very knowledgeable in Pokémon calculations and mechanics but I noticed a few minor UI bugs that I could fix, so I've registered a few issues on the GitHub page and also created the pull requests with the fixes for them.

Hopefully, you guys can review the changes and approve them if they don't interfere with anything else.

Regards
 
When I close the tab with the calculator and reopen the tab with ctrl+shift+t, it messes up the calculator in a way I don't fully understand. I doubt many people run into this and it might be on my end, but here's a screenshot.

1610840370012.png
 
Hello!
I've noticed that reflect prevents a different amount of damage in singles than in doubles.
That is the intended behavior. From Bulbapedia:
Instead of doubling the Defense of affected Pokémon, Reflect now technically halves the damage done to them by physical moves; it still does not reduce damage done by moves that deal direct damage.

If multiple Pokémon are present on the user's side of the field, all of them are protected by Reflect, but physical damage is only reduced by a third rather than half.
 
I noticed that Rivalry doesn't seem to calculate properly. According to Bulbapedia's description:

"When a Pokémon with Rivalry uses an attack, the attack's power is raised by 25% if the target and the user have the same gender, and is reduced by 25% if the target and the user have opposite genders."

However, when input with Rivalry, it doesn't seem to calculate properly. Rather, it says same-gender is weaker than opposite genders. This doesn't seem like intended behavior. Screenies below.



 
More of a QoL suggestion, but would it be possible that when you check Unburden as activated, Acrobatics is powered up to 110 BP automatically ? This would be faster than manually doubling the BP of the move or removing the item. It would make sense, as Acrobatics is always doubled in power if Unburden is active.

Alternatively, we could add a "knocked off" button in the center part of the calculator. This would affect Knock Off and Acro BP as well as Poltergeist, and also disable item effects for the concerned Pokemon (such as Leftovers recovery, Heavy Duty Boots, etc)
 
The boosts of Intrepid Sword and Dauntless Shield are automatically included on the "message" part:
1612363540757.png

but not from this pop-up bar thingy (sorry idk what it's called):
1612363552336.png

The two should be consistent. If I give Zacian a +2 boost in the bar thingy the message part displays +3 instead. It might confuse players if they're careless like me.
1612364037993.png


Also, would you consider making Intimidate automatically inputting the -1 to the opponent's attack on both the message and pop-up bar thingy? Intimidate does work similarly with Intrepid Sword.
 
The boosts of Intrepid Sword and Dauntless Shield are automatically included on the "message" part:
View attachment 313060
but not from this pop-up bar thingy (sorry idk what it's called):
View attachment 313061
The two should be consistent. If I give Zacian a +2 boost in the bar thingy the message part displays +3 instead. It might confuse players if they're careless like me.
View attachment 313064

Also, would you consider making Intimidate automatically inputting the -1 to the opponent's attack on both the message and pop-up bar thingy? Intimidate does work similarly with Intrepid Sword.
Intimidate is one of those abilities with a little check box next to it, which means if you click that check box it'll automatically lower the opponent's attack by one stage.
 

pqs

Banned deucer.
i would like to request a feature to add a "total evs" line where it shows how many evs added up there are on your pokemon (out of 508) to make it much easier for optimization since (especially for the communities i'm in) you're constantly flicking evs around trying to make a spread optimized, and sites like ps can often be laggy or you can't connect to them and its very tedious to insert the evs into there / an online calculator every time you want to check. (this would not mean adding a limit, it could just say something like 520/508 if it's over since when calcing against an opponent sometimes you need to go over for convenience)

example of what i mean:
- something like this would be nice

thank you!
 
Calc shows 0 damage for Sludge Bomb from Neutralizing Gas Koffing vs Bulletproof Hakamo-o (or for any other 'mons for that matter - Ability is the important part)
 
According to https://dex.pokemonshowdown.com/moves/shellsidearm Shell Side Arm picks a category at random in the case of a tie, but the calculator acts like the tie always goes to picking Special. Also, I don't know if this is the appropriate forum to report bugs with the Randoms mode, but there are some checks in the set generator that lower EVs in some situations, and the calculator is missing the case where sets with Shell Side Arm and Choice Specs have their Atk EVs reduced by 4.

Edit: Shell Side Arm is also being calculated as if it takes Choice Specs into account when determining its category, but it’s not supposed to use any modifiers except stat stages (and Wonder Room, but erroneously).
 
Last edited:
The damage calculator says that in Gen 2, Hydro Pump from a level 50 Starmie is a guranteed OHKO against a full health level 50 Marowak, displaying the roll like this: Starmie Hydro Pump vs. Marowak: 158-186 (95.1 - 112%) -- guaranteed OHKO
Interestingly enough, if you take off Hidden Power from Marowak (which only adjusted the attack and physical defense DVs), it shows more accurate odds: Starmie Hydro Pump vs. Marowak: 158-186 (95.1 - 112%) -- 71.8% chance to OHKO
CalcError.png
 
The damage calculator says that in Gen 2, Hydro Pump from a level 50 Starmie is a guranteed OHKO against a full health level 50 Marowak, displaying the roll like this: Starmie Hydro Pump vs. Marowak: 158-186 (95.1 - 112%) -- guaranteed OHKO
Interestingly enough, if you take off Hidden Power from Marowak (which only adjusted the attack and physical defense DVs), it shows more accurate odds: Starmie Hydro Pump vs. Marowak: 158-186 (95.1 - 112%) -- 71.8% chance to OHKO
I noticed this with other calcs as well, though I don't recall which ones. I may provide examples in the future of the percentage of KO threshold misrepresenting the amount of a pokemon's health a certain attack depletes
 

Martin

A monoid in the category of endofunctors
is a Smogon Discord Contributoris a Forum Moderator Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
You may have given a reason for why the calculator does this instead of calculating correctly in the past that I can't find, in which case I apologise, but the way multi-hit moves interact with Multiscale/Shadow Shield on the calculator is currently incorrect. This was reported twice in 2019, first by DaWoblefet in July as part of a big Parental Bond fix and then later by DrPumpkinz in November in relation to Icicle Spear in a report that appears to have been buried. I also checked the old thread in IS and there wasn't anything about it in there.

I was doing some calcs of Double Iron Bash vs Multiscale Dragonite and thought the numbers looked wrong, so I checked each hit independently using a modified Iron Head and it was doing what I thought: if the Pokémon's HP is at 100%, Multiscale/Shadow Shield will weaken both hits of the move instead of only weakening the first, resulting in an output which is 3/5 of the correct value:

Tested: Melmetal (OU Protect) vs Dragonite (OU Dragon Dance)
Calculator output: 144–172 (unfavourable chance to 2HKO)
Correct output: (80+160)–(95+190) = 240–285 (guaranteed 2HKO)

After checking this, I checked a few other multi-hit moves and got the following results:

Tail Slap: Incorrect
Tested: 252 Atk Cinccino Tail Slap (5 hits) vs. 0 HP / 0 Def Multiscale Dragonite: 85-105 (26.3 - 32.5%)
Calculator output: 85–105 (guaranteed 4HKO)
Correct output: (17+4(34))–(21+4(42)) = 153–189 (favorable chance to 2HKO)

Triple Axel: Incorrect
Tested: 252 Atk Cinccino Triple Axel (40 BP) (3 hits) vs. 0 HP / 0 Def Multiscale Dragonite: 222-264 (68.7 - 81.7%) -- approx. 2HKO
Calculator output: 222–264 (guaranteed 2HKO)*
Correct output: (38+148+224)–(46+176+264) = 410–486 (guaranteed OHKO)

*it also seems to calculate it as 40,40,40 instead of 20,40,60. This would cause problems even if Multiscale did work correctly, as the first hit would need to be half of a 20 BP hit: not half of a 40 BP hit.

Parental Bond: Correct
Tested: 252+ Atk Parental Bond Kangaskhan-Mega Double-Edge vs. 0 HP / 0 Def Multiscale Dragonite
Calculator output: 163–193
Correct output: (109+⌊0.25(219)⌋)–(129+⌊0.25(258)⌋) = 163–193

Surging Strikes: Incorrect
Tested: 252 Atk Choice Band Urshifu-Rapid-Strike Surging Strikes (3 hits) vs. 0 HP / 4 Def Shadow Shield Lunala on a critical hit:
Calculator output: 279–327
Correct output: (51+2(102))–(60+2(121)) = 255–302

As you can see, while this was corrected on Parental Bond following DaWob's bug report, no other multi-hit moves that I tested work correctly, resulting in large inaccuracies with the damage outputs. Especially considering that both Melmetal and Dragonite currently reside in the same tier, this issue needs fixing with regards to both the Multiscale interaction and how Triple Axel and Triple Kick have their damage calculated. I haven't tested any other generations, but I'm going to presume that the code was ported forward and that the bug, therefore, persists backwards.

Also, while I'm still thinking about it, it'd be nice if, after fixing Triple Axel/Triple Kick, you could to add the option to check how much damage they would do if they only hit once or twice, as each hit has that trolly independent accuracy check that cancels any subsequent attacks when it fails.
 
Last edited:

Users Who Are Viewing This Thread (Users: 1, Guests: 2)

Top