• The moderators of this forum are Austin and pre.
  • Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon.

Programming Pokémon Showdown Damage Calculator

pre

shaving yaks and herding cats
is a Battle Simulator Administratoris a Programmeris a Super Moderator
Builder
What i think is a bug with the +1 All Stats button
from what i understand it is supposed to emulate the effects of z-celebrate/hold hands/happy hour

When clicking on the button and then checking Stored Power, it shows its BP as 140 (and calcs 140 BP) when in game it should be 120. likely a bug not certain but im psure thats a mistake
^In addition, Stored Power damage is being negatively affected by negative stat changes, when those should not affect it.

E.g. If you have +2 attack, Stored Power does 60 instead of 20. If you have +2 attack and -2 defense, it should still do 60.
These should both be fixed (along with other moves which rely on the number of boosts).
 

pre

shaving yaks and herding cats
is a Battle Simulator Administratoris a Programmeris a Super Moderator
Builder
Not all of the berries for natural gift work, and one isn't even there, which forces you to make up a move and adjust the BP to do an accurate calc.

In addition, Lum does not appear in the calc at all, much less to use for natural gift purposes (It's typically an 80 BP flying move).
Bet you thought this one wouldn't get addressed after so long... Fixed. :)
 
Another bug:
193770


idrk how to explain but
if theres a mon in the calc (say Aerodactyl, but can be anything), your damage will calc off them and itll say their name in the calcs eg.
252+ Atk Donphan Rock Tomb vs. 0 HP / 4 Def Aerodactyl: 192-228 (63.7 - 75.7%) -- guaranteed 2HKO

with Aegislash-Shield, however, instead of saying vs. Aegislash-Shield it just says vs the previous mon that was in that slot.
the calcs still calc vs aegi-shield tho

So if i have a groudon in one slot and replace with aegislash-shield, im calcing v aegi but the text still says groudon

not sure if other mons have similar problems but i just encountered this
 

FriendOfMrGolem120

aka. FOMG
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderatoris a defending SPL Champion
Moderator
Two things regarding the GSC calculator:
1. DVs will not be imported to the calc as how you copied them from the teambuilder which is especially annoying for Hidden Powers since the type of those depends entirely on the DVs.
2. EVs (technically stat experience) can't be set at all (and thus also not imported how you have them in your team). Many players reduce the attack of pokemon without physical moves to lower the damage from hitting yourself in confusion. Sometimes you want to calculate the damage you do with Struggle or in confusion which currently can't be set at all in the calc.
 
Is it possible without stupid amounts of coding to make showdown damage calculator (in particular all vs one and one vs all) damage formatted in number% - number% ? Been working on a spreadsheet to try comparing breakpoints between 2 sets but splitting and sorting the damage data as it isn't in proper syntax form makes things a nightmare and can not be automated.
 
Please use the package. The UI is not intended to be processed programmatically, you will have a much better time using the API directly.
not even for programs but manual usage and sorting/filtering to compare, the lack of a percentage is a pretty big wall block
 

Diophantine

慈陰
is a Tutor
At the time of writing this post, the damage calculator does not work for the Present glitch in Gen 2. While yes, this glitch only works with Gold and Silver (and not Crystal unless it's a link battle between Crystal and Gold/Silver) that is what Pokemon Showdown simulates. The correct Present mechanics are already implemented into Pokemon Showdown, and so it would be great to have this on the damage calc.
 
There's an error on Typhlosions page. If you pick the NU Typholosion, and change its item to none from Choice specs, it's attack drops as expected. But if you change it's the ability to none as well its attack shoots back up as if it has Choice specs still equipped.
 
Hello, was just looking at acrobatics and aerial ace on mega scizor, and doing damage callcs against marshadow. Acrobatics says it will do 92% min (max attack adamant) but aerial ace says 75% min. I think acrobatics is not being correctly calculated due to scizor holding a mega stone over another item
 
Hello ! When you're using the calculator and you take a Pokemon whose set name is very long (like "Scizor-Mega (Monotype Offensive Swords Dance (Steel))," or the BSS Aegislash blade set ) there's a shift in the calculator page. It does that with Mozilla Firefox, but seems to be working fine using Microsoft Edge. Here's a screen
Capture.PNG
 
Hello, was just looking at acrobatics and aerial ace on mega scizor, and doing damage callcs against marshadow. Acrobatics says it will do 92% min (max attack adamant) but aerial ace says 75% min. I think acrobatics is not being correctly calculated due to scizor holding a mega stone over another item
When you click a sample set whose name ends in "-Mega", the item doesn't import properly. Manually changing the form to the mega form and manually changing the item to the mega stone both work just fine. It breaks only when it tries to import a mega evolved sample set from Smogon.
mega.png
 
  • Like
Reactions: pre

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
I've got a question about the damage formula. I built my own calculator in a spreadsheet a while back but I've never been able to exactly match showdown's calcs. The min and max rolls will always be extremely close but a little bit off. My calculator is linked here (I've left this sheet open for edits so you can change things). I've looked through the github to try to find the exact damage formula used but I'm not really a programmer and kinda got lost in all the text.

Would anyone be able to check out my calculator and help me find out what is making my results slightly off? I feel like it has to come down to rounding somewhere and I've triple checked everything twice. The formula I'm using to get a damage percentage is shown below. This is getting me the results I show in the example below.

=(FLOOR.MATH(FLOOR.MATH(FLOOR.MATH(2*100/5+2)*BasePower*Attack/Defense)/50)+2)*Modifier/HP

Where the showdown calc gives this:
252+ SpA Life Orb Triage Charizard-Mega-Y Oblivion Wing vs. 252 HP / 252 SpD Kartana: 320-376 (99.3 - 116.7%) -- 87.5% chance to OHKO

My calculator gives the min roll as 99.0% and max roll as 116.5%.
This is for the PS calc, not to help you with your calc. You could post a thread in TP(after you’re read the section readme) or feel free to contribute to our calc :)
 
1570718085391.png
ultra necrozma seems to push the right part of the calc down cos its name is too long. if ultra necro is the right side mon,same thing happens
 

Heika

formerly HKT
Not sure it is the place for this, but I'd like to suggest a change regarding how the "+1 all stats" works. Currently if you use this feature and then change the selected pokemon, it will remains enabled, granting +1 in all stats to a second pokemon, which is subjectively annoying, and objectively makes no sens since if you got an omniboosted pokémon and switch it out, the omniboost will vanish (not with Baton pass but it's more of an exception than a rule).
Tl:dr: the way it currently works is in my opinion really unintuitive and prone to lead people into misscalculations
 
Multiscale and Shadow Shield are resisting every hit of a multihit.

252 Atk Cloyster Icicle Spear (5 hits) vs. 0 HP / 0 Def Multiscale Dragonite: 340-420 (105.2 - 130%)

252 Atk Cloyster Icicle Spear (5 hits) vs. 0 HP / 0 Def Dragonite: 680-840 (210.5 - 260%)

I'm not 100% certain if this is actually a bug because I can't currently test it, but it doesn't seem right.
 

Osra

1v1 and I
is a Pre-Contributor
Suggestion: make the pokemon selection drop down lists present solely the species of the pokemon and nothing else after selecting which set you'd like to calc with. If you manually clicked the set, odds are you don't need to be reminded of what the name of the set is afterwards, which would also help prevent scenarios stemming from convoluted set names like below-
1573008124245.png
 

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

Top