Programming Pokémon Showdown Damage Calculator

From what I can tell, the listed sets are just ripped directly from the strategy dex.

I suppose a way to get around this problem without hardcoding filler moves for every Pokemon would be to have a set called "most used" or something, which would be like a blank set but the moves would be the four most used non-status moves from the most recent usage stats, though accounting for multiple formats might be a hassle, if not for the coder than for the user who suddenly has to deal with a much longer list of sets.
 
The damage calc does not take into consideration the grounding effects of the item iron ball.

ex 1: A flying/levitate mon holding an iron ball in psychic terrain will not take damage from a priority attack, but the calc says it will.

ex 2: A flying/levitate mon using an electric move under electric terrain will gain the terrain boost if holding an iron ball. This is not considered in the damage calc.
 
Last edited:
Hi, I think I've found a problem with the calculator - when I lower the base defence stat and DVs sometimes the pokemon takes less damage from physical attacks even though it's defence has been lowered. Unless there's some mechanic regarding DVs I don't know about this must be wrong - as the defence stat is reduced physical attacks should do more damage.

For context, I'm using the gen 1 calculator. I lower pokemon's defence stat to make counter more effective. It would actually be really useful if you could directly change the defence stat, instead of having to mess around with the base/dvs :)
 

Hamlette

Banned deucer.
The multiple hits feature seems to be bugged when the mon has nonzero stage changes.
Tested with Superpower on Regirock (with Sturdy) at various stages.
At +0 the damage displayed for two hits is, as expected, 1.67 times the damage displayed for 1 hit ((1+0.67)/1 = 1.67)
At +1 the damage displayed for two hits is twice the damage for 1 hit, even though it should be 1.67 ((1.5+1)/1.5=1.67)
etc.,refer to chart
The error grows as stages grow to ridiculous levels (at +6, the damage displayed for two hits is 4.5 times the one hit damage, when it should be 1.875)

I have not tested with other moves than Superpower, but I suspect the same error occurs

Screenshot comparison for damage at +6 with one and two hits
 

Ropalme1914

Ace Poker Player
is a Tiering Contributoris a Contributor to Smogonis a Smogon Media Contributoris a Site Content Manager Alumnusis a Social Media Contributor Alumnusis a Forum Moderator Alumnus
1604862475875.png
Utility Umbrella is broken for rain. It still works fine for sun tho (although I would suggest that it appears on the calc: currently it just doesn't mention weather instead of saying, for example, "Utility Umbrella Blissey in Rain")
 
Not a bug, but a suggestion.

Suggest giving knock off the over "x" turns effect, such as stat lowering moves like Leaf Storm and Overheat.
This would be used to calculate if the move 2hkos or 3hkos with the difference in power after the opponent losing their item.
any updates? this would be really helpful, currently you have to calc the first use, write it down, remove opponents item, calc the second use and add it together. Adding the once/twice button reduces the process to one click. Sticky Hold should be taken into account.
 
There seems to be a bug with Zamazenta's damage calculation, i am unsure which one is correct but it doesn't seem to account for the Defense boost when calculating as seen by the damage calcs below, you can test this yourself on the calculator


252 Atk Garchomp Earthquake vs. 64 HP / 0 Def Zamazenta-Crowned: 236-282 (69.2 - 82.6%) -- guaranteed 2HKO

252 Atk Garchomp Earthquake vs. +1 64 HP / 0 Def Zamazenta-Crowned: 236-282 (69.2 - 82.6%) -- guaranteed 2HKO

EDIT: You can replicate this by moving the toggle on Zamazenta's defense from -- to -1
screenshots for proof below.
1605132889315.png

1605132941718.png

EDIT 2:
This also seems to work on regular Zamazenta or any Pokemon which has the ability Dauntless Shield so it is a problem with the ability itself.

EDIT 3:

https://replay.pokemonshowdown.com/gen8customgame-1221678901-h302w1asyyr1scy4j9rxe7kmng63novpw

Damage seems to work properly on PS so its just an error with calc.

EDIT 4:

I have now come to the conclusion after a few months and more analysis that the entire ability is completely bugged on Calculator, when changing a pokemon's ability to Dauntless Shield, it only adds the text +1 to the calc but doesn't actually change the damage as seen below:


252 Atk Zamazenta Close Combat vs. 0 HP / 0 Def Garchomp: 205-243 (57.4 - 68%) -- guaranteed 2HKO
252 Atk Zamazenta Close Combat vs. +1 0 HP / 0 Def Garchomp: 205-243 (57.4 - 68%) -- guaranteed 2HKO
 
Last edited:
Flail and Reversal calculations are wrong for gen2, gen3 and gen4. The calculator is currently applying the formula for gen5+ to all generations.

These are the correct formulas:

For gen2-4, compute floor(64*(current HP)/(max HP)) and read the following table:
0-1 --> power 200
2-5 --> power 150
6-12 --> power 100
13-21 --> power 80
22-42 --> power 40
43-64 --> power 20

For gen5+, compute floor(48*(current HP)/(max HP)) and read the following table:
0-1 --> power 200
2-5 --> power 150
6-12 --> power 100
13-21 --> power 80
22-42 --> power 40
43-48 --> power 20
 
Flail and Reversal calculations are wrong for gen2, gen3 and gen4. The calculator is currently applying the formula for gen5+ to all generations.

These are the correct formulas:

For gen2-4, compute floor(64*(current HP)/(max HP)) and read the following table:
0-1 --> power 200
2-5 --> power 150
6-12 --> power 100
13-21 --> power 80
22-42 --> power 40
43-64 --> power 20

For gen5+, compute floor(48*(current HP)/(max HP)) and read the following table:
0-1 --> power 200
2-5 --> power 150
6-12 --> power 100
13-21 --> power 80
22-42 --> power 40
43-48 --> power 20

https://www.smogon.com/dp/articles/damage_formula
https://www.smogon.com/bw/articles/bw_complete_damage_formula
https://www.trainertower.com/dawoblefets-damage-dissertation/#custom-bp

I don't have the data for generations 2 and 3 but the table you wrote for gen5+ disagrees with the links I posted above.
The numbers for gen 4 are correct though
According to the articles above, the table for gen5+ is

0-1 --> power 200
2-4 --> power 150
5-9 --> power 100
10-16 --> power 80
17-32 --> power 40
33-48 --> power 20

In the source code of the calculator, the gen 5 formula is indeed used for all generations.
 
Last edited:

SparksBlade

is a Tournament Directoris a Community Leaderis a Community Contributoris a member of the Battle Simulator Staffis a Top Dedicated Tournament Host
Community Leader
I know randbats sets aren't the highest priority compared to the other stuff, but can Luxray and Heracross be updated so that they don't have flame orb+non-guts ability? Currently Luxray shows as intimidate+flame orb, and Heracross as moxie+flame orb.
 
When importing sets for Calyrex-Ice or Calyrex-Shadow the Calculator imports 2 Custom Sets with the exact same moves, nature, EV spread and IVs, only difference being that one of those sets is for Glastrier/Spectrier respectively, instead of the Calyrex forms. Not that big of a deal, but certainly really annoying for someone who tries to keep his custom sets in order.
 
The new DLC 2 Pokémon (Slowking-Galar, Calyrex, Glastrier, Spectrier, and the rider forms) aren't in the random battle damage calculator
 
Silver Powder appears not to be working (not boosting bug type moves). I tested this on heracross, yanma and yanmega in gens 3, 4, and 8; none seem to be working.
 
Silver Powder appears not to be working (not boosting bug type moves). I tested this on heracross, yanma and yanmega in gens 3, 4, and 8; none seem to be working.
Looking at the code on GitHub (I hope I have the right to do so '_'), this has been fixed but maybe they are waiting to fix more things before pushing it to the live version
 
Triple Kick isn't getting calc'd properly with Technician. This is against a Corviknight, so the attacks are neutral.
Triple Kick and Thundurus Kick should deal the same damage if I'm not mistaken.

Screenshot 2020-12-26 at 11.15.54 AM.png
 
Triple Kick isn't getting calc'd properly with Technician. This is against a Corviknight, so the attacks are neutral.
Triple Kick and Thundurus Kick should deal the same damage if I'm not mistaken.

View attachment 302581
The problem is not about Triple Kick + Technician, it's just Triple Kick alone.
It seems to be computed like a move that does 3 hits where each hit uses the input base power (which defaults to 10).
So by default, it's similar to a 30bp move.
On the other hand, its counterpart Triple Axel seems to be hard coded as a 40bp move so it's computed like a move that does 3 hits of 40bp each.
So neither move is really computed exactly like it should.
To mimic Triple Axel, Triple Kick should have a hardcoded base power of 20 though.
 

SparksBlade

is a Tournament Directoris a Community Leaderis a Community Contributoris a member of the Battle Simulator Staffis a Top Dedicated Tournament Host
Community Leader
Neuroforce currently doesn't work in the calc.

0 SpA Neuroforce Heatran Lava Plume vs. 0 HP / 4 SpD Abomasnow: 496-588 (154.5 - 183.1%) -- guaranteed OHKO

0 SpA Heatran Lava Plume vs. 0 HP / 4 SpD Abomasnow: 496-588 (154.5 - 183.1%) -- guaranteed OHKO
 

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

Top