Programming Pokémon Showdown Damage Calculator

Tramuntana

formerly SJMistery
it defaults to the type-based Z move according to a quick check, so those would be the only cases that you would need to switch item to the Z crystal (particularly the signature one)
although i don't really have any idea why you'd use a type-based Z crystal when a signature one is better in basically every case... ah well, calculator is calculator ig

EDIT: upon re-testing, if you give a signature Z crystal to a mon that normally can't use it, it will still display the signature Z move, which is probably a bug
It is not. That function is mainly there for Balanced Hackmons, and similar modded tiers that allow everybody to slap any Z-Cristal they want to anything they want.
 

Pikachuun

the entire waruda machine
is a Pre-Contributor
It is not. That function is mainly there for Balanced Hackmons, and similar modded tiers that allow everybody to slap any Z-Cristal they want to anything they want.
false, as BH is limited to the mechanics of the base game.
unless you hack what a Z crystal binds to, you aren't going to have Zygarde-C use Let's Snuggle Forever via a Z crystal in-game. you CAN put it in a moveslot in hackmons tiers (banned in BH basically means Pure Hackmons only), which is intended, and the damage calculator does allow you to do as shown in the hide tag below, though (and also for moves like Inferno Overdrive correctly displays that it will have 1 BP):
1538404596239.png
it's a really minor bug at the end of the day so it doesn't really have to be fixed, but it's not really correct either
 

Tramuntana

formerly SJMistery
false, as BH is limited to the mechanics of the base game.
unless you hack what a Z crystal binds to, you aren't going to have Zygarde-C use Let's Snuggle Forever via a Z crystal in-game. you CAN put it in a moveslot in hackmons tiers (banned in BH basically means Pure Hackmons only), which is intended, and the damage calculator does allow you to do as shown in the hide tag below, though (and also for moves like Inferno Overdrive correctly displays that it will have 1 BP): it's a really minor bug at the end of the day so it doesn't really have to be fixed, but it's not really correct either
As far as my knowledge goes, you can easily hack tee base game to remove the restriction of all the exclusive items, so I assumed it would be included as a part of it. But that's not a section for Balanced Hackmons discussion, so I'll leave it at that.
 
When calculating damage with a damage-reducing berry (or I guess any item that gets consumed when hit by an attack), can the damage calculator take the item consuming into account when displaying the <number>HKO? Or maybe add one of those once/twice/thrice dropdown menus like the ones used for overheat and leaf storm? Right now the calculator assumes the damage-reducing berries last forever, so it might say an attack takes 5 hits to beat a Pokemon when it should only take 3 hits.
 
Last edited:
Normalize doesn't add the 20% bonus damage on moves that are already normal type and Stamina does not work with Multi-Hits moves (this one could be really useful actually, as the other one can be calculated easily)
 
Did you try closing your browser and restarting your computer? If yes, did the problems go away?
I mention it a bit later in my post, yes I did reset my PC. I've tried a lot of things to see whether the problem was on my end but it didn't fix the issue.
 

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
The calculator is of great help, but the one vs all, and all vs one functions don't work for me. I did not see any comment about it in this thread, or google, so I'd like to ask if it is currently unavailable.
As of today I've started experiencing a plethora of weird issues with the damage calculator that weren't there yesterday. I've recorded my screen to show what's going on:

1. 0:00 The Z button does nothing. It's supposed to work even if the Pokemon set doesn't have a Z-Crystal, but regardless of whether it does or doesn't the button doesn't turn the move into a Z move.

2. 0:37 The crit damage multiplier appears to be 2x in the S/M calc and possibly in the X/Y calc as well, even though it's supposed to be 1.5x as of gen 6.

3. 1:03 The RBY calc is all kinds of messed up. Moves are undefined, it says Abra is the default Pokemon when it's supposed to be Aerodactyl, etc. Says "something broke; please tell Austin" so I assume this is the right thread to post this in.

4. 1:28 The ADV calculator appears to be using the DPP Physical Special split.

I have no idea what is causing this. While attempting to figure out whether this was an issue on my end I've refreshed the page, cleared my cookies and cache, turned off all my extensions, restarted my browser and PC but nothing fixed it. I've asked around and most other people tell me the calculator works just fine for them, however I've confirmed that at least one other person is experiencing the same problems. One thing I figured out is that we were both using Chrome to access it, however the calculator worked fine on his mobile phone's browser but not on mine.

I use the calculator a lot and I appreciate the work you put into it, so I thought this would be worth bringing to your attention.
Sorry I didn’t get a notification for this today, I’ll have to fix it tomorrow :/. Z-moves not working was brought to my attention so I fixed that at least and I think it also fixed your gen 1 issues and possibly gen 3(?). Sorry there was a refactor that I guess broke a lot of things
 
Last edited:
Sorry I didn’t get a notification for this today, I’ll have to fix it tomorrow :/. Z-moves not working was brought to my attention so I fixed that at least and I think it also fixed your gen 1 issues and possibly gen 3(?). Sorry there was a refactor that I guess broke a lot of things
All the bugs I've noticed seem to be fixed now, so thank you!
 

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
The calculator is of great help, but the one vs all, and all vs one functions don't work for me. I did not see any comment about it in this thread, or google, so I'd like to ask if it is currently unavailable.
Was fixed
 
Thx for fix. Now, i'd like to make some suggestions for the group damage result output display ( one vs all, all vs one)
1. Summary row : providing % and absolute number of pokemon koed in 1, 2 etc turns
2. Usage column : assuming your program has access to the smogon usage database, a column with usage % would be incredibly useful for filtering. If i wish to know how well will X pokemon sweep in Y tier , I can filter the results in descending usage order and focus on the highest ones
3. Group copy-pasting. Basically , allow for users to input multiple names per search (in the search fuction of the 1 vs all table). This way, if i want to check how multiple sweepers perform against the x top used mons or whatever, I can write the defending top mons in a notepad, input each sweeper in a calculator in a tab, and paste in the searcher the top mons i want to check as opponents quickly
 
Minor complaint: When I change the weather and then change something else (such as a Pokemon's move or ability), the weather automatically reverts to none. This makes doing calculations in a certain weather condition annoying. Can it please not happen anymore?
 
Bug concerning Eviolite (as far as I can tell):
1. Calculate Muk (Blank set) vs. Mew (Blank set) Body Slam.
2. Calculate Bronzor (Blank set) vs. Mew (Blank set) Body Slam.
3. Calculate Bronzor with Eviolite (Blank set) vs. Mew (Blank set) Body Slam.
4. Calculate Muk (Blank set) vs. Mew (Blank set) Body Slam again.
5. Compare Muk results.

-> Damage changes (because Muks HP changes)

Edit: doesn´t seem to be about Eviolite. Muk seems to copy the HP of whatever you calculated before (only happens with the blank Muk set). + Altaria seems to have a similar issue.
 
Last edited:

UnleashOurPassion

Permanently tired
is a Battle Simulator Driver
Minor accuracy thing: Moves cannot deal 0 damage (source: bulbapedia. Someone might need to factcheck this)

-6 0- Atk Happiny Tackle vs. +6 252 HP / 252+ Def Aggron through Reflect: 0-0 (0 - 0%) -- aim for the horn next time
 
That might not be a bug. I know someone tested in BW and found that they can, since Reflect and other final modifiers get applied after ensuring 1 damage. Someone should probably test if that's still the case in ORAS and SM though.
 
Minor accuracy thing: Moves cannot deal 0 damage (source: bulbapedia. Someone might need to factcheck this)

-6 0- Atk Happiny Tackle vs. +6 252 HP / 252+ Def Aggron through Reflect: 0-0 (0 - 0%) -- aim for the horn next time
I can't replicate this issue, at least for Gen 7. It always shows at least 1 damage being dealt.

-6 0- Atk Defeatist burned Happiny Return vs. +6 252 HP / 252+ Def Eviolite Fur Coat Lairon with an ally's Friend Guard with an ally's Aurora Veil: 1-1 (0.3 - 0.3%) -- possibly the worst move ever
 
That makes sense though. Pretty much everything there isn't a final modifier except for Friend Guard. So it applies everything except friend guard, gets zero damage, then forces it to be 1. And then it multiplies by 3072/4096 if we base it off of the BW base damage formula, which isn't enough to make it round down.

Test with something that reduces damage by 0.5x or more either on its own or in combination (like reflect).

For reference, this is what all the damage formulas for BW and later are assumed to be based on.
 
And then it multiplies by 3072/4096 if we base it off of the BW base damage formula, which isn't enough to make it round down.
Doesn't Pokemon always round down when calculating anything? If it didn't, then 255 EVs will give 1 more point than 252 EVs.
 
No, BW and onward it has different methods of rounding applied to certain scenarios. Applying and chaining modifiers rounds "half-to-zero", e.g.:
round(0.5)=0
round(0.6)=1
round(-0.5)=0

I believe there are other scenarios that just do integer division though, it really depends.

It might apply to HGSS too, but nobody ever looked at a disassembly like they did for BW. It might not apply to current gens, but again, nobody has looked at the disassembly for ORAS and SM as far as I know, so we just assume it's the same and say "good enough".

edit: tl;dr rby, gsc, adv (maybe), and bw are the only gens we actually know exactly how damage is calculated
 
yea its broken because someone refactored without unit tests a year ago. :(

the person that posted here must have a really old cached version, i remember it had issues with the cache before too.
 

Paperblade

Puzzle Hunt Champion
bug concerning Metronome

Rather than doing damage at intervals of 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, it's doing 1.0, 1.1, 1.1*1.2 (1.32), 1.1*1.2*1.3 (1.716), 1.1*1.2*1.3*1.4 (2.4024).

For example, blank set Blaziken using Blaze Kick vs. blank set Mew, at 2/3/4/5 consecutive uses, with an unboosted hit for reference:

0 Atk Blaziken Blaze Kick vs. 0 HP / 0 Def Mew: 108-127 (31.6 - 37.2%) -- 83.8% chance to 3HKO


Capping at 5 consecutive hits also means we can't calc a 2.0 hit
 
In the calc, the interaction between teravolt/mold breaker and filter seems broke, for instance :
252 SpA Life Orb Teravolt Kyurem-Black Hidden Power Fire vs. 252 HP / 252+ SpD Filter Aggron-Mega: 101-121 (29.3 - 35.1%) -- 13.2% chance to 3HKO
252 SpA Life Orb Kyurem-Black Hidden Power Fire vs. 252 HP / 252+ SpD Filter Aggron-Mega: 101-121 (29.3 - 35.1%) -- 13.2% chance to 3HKO
This imply teravolt doesn't break filter while, https://play.pokemonshowdown.com/battle-gen7ou-848056428 , as the damages in here show, teravolt does ignore filter actually in the game. (And it fits to the theorical damage dealt by kb on m aggron : 252 SpA Life Orb Kyurem-Black Hidden Power Fire vs. 252 HP / 252+ SpD Aggron-Mega: 135-161 (39.2 - 46.8%) -- guaranteed 3HKO )
The error might be on the simulator, but it seems more logical that the calc is the one being wrong.
 

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

Top