Programming Showdex - An Auto-Updating Damage Calculator Built into Showdown!

GenOne

DOU main. GMT-7. PS!: GenOne
is a Community Contributoris a Site Content Manager Alumnusis a Forum Moderator Alumnusis a Top Tiering Contributor Alumnusis a Contributor Alumnus
Amazing tool. I do have one potential question / feature request for XY and SM games as a DOU player who sometimes plays those oldgens.

In most scenarios, a Mega Pokemon is always going to mega evolve on its first possible turn, but the calc defaults to the base forme on the turn it is planning to mega evolve. Would it be possible to make the calc default to the mega forme's stats, with the option to toggle back to base forme if needed? Or at least make this an optional setting?

There are very few scenarios where a Pokemon that can mega wouldn't do so immediately although they do exist; some examples:
  • Pokemon that don't always hold a mega stone, such as Diancie who can either be a TR attacker or fast Mega Attacker
  • Weather setters like Charizard Y and Mega Tyranitar, who might avoid mega evolving right away for better weather control vs opposing weather teams
  • Pokemon with good base abilities, such as Clear Body Metagross, who will sometimes delay their mega evolution on a predicted Intimidate switch-in to avoid the Attack drop
But I do think that defaulting to the Mega Pokemon's stats is more helpful probably at least 75% of the time. So I'd rather have to toggle the "mega" setting off than on in most games I play.

Thanks for your time in reading this! And once again this calc is amazing.
 
Last edited:
Hey y'all!

Sorry about the MIA, we've taken a little hiatus to get our shit together, but now we're back in full force! Thanks for all the reports you've submitted to us, we've been collecting them and will address them in the next update, coming soon.

We're also aware of some lag problems some of you have experienced, which made you lose some games. We're sorry for that too and are working on diagnosing the problem(s) (hopefully it's a singular problem, but you never know with these things hahaha).

We appreciate your guys' patience as we work through these bugs :)
 
But anyways is there a way to install this plugin on there?
Unfortunately, no, not at this moment.

:pikuh:

iirc, the macOS desktop client for Showdown is basically a self-contained Safari browser that loads the Showdown website. Showdex is a browser WebExtension that needs to hook directly into the website, as well as the browser providing crucial WebExtension APIs (like chrome.runtime.onMessageExternal()) to load, read the battle state, etc.

Don't think that it's possible for Showdex to load into the desktop client without modifying the original source code (not to mention, it's not that easy getting Showdex on Safari either, which the homie Christian took the liberty of doing). We would need to fork the desktop client and release (& maintain) a separate version that includes Showdex. This is something that can be done (and we had a few people ask for this before), but at the moment, we got lots of bugs to fix, so we probably won't be looking into this anytime soon, sadly.

For the time being, using your browser is the only way to use Showdex. Hope that explains it :o
 
not sure if this one has been reported yet, sorry if it has (me no read)

bug: tera toggle grays/locks out if the turn is skipped in which a pokemon terastallizes. the tera type cannot be changed after this. since you can only set the regular types of a pokemon after this, it won't count the double-STAB/adaptability bonus either, if applicable.

steps to reproduce:
* be in a battle
* a pokemon on either side of the field terastallizes
* skip the turn as this happens
* the calcdex tab will now lock/grey out the tera toggle for which side tera'd

v. 1.1.4
 
This thing is sick. Have one suggestion for it, I play a LOT of OMs and would love to be able to change what a pokemon uses as its attacking stat (fortemons for example) so i could set my goodra to use its special defense while attacking.
 
anybody else have the issue where pokemon are randomly switched out?

every time i click skip turn, a pokemon is randomly switched out, usually the one in slot 5 or 2

EDIT: when i don't skip turn, this issue never happens, i view this as a sign i should just be more patient


EDIT 2: i fixed the issue, it was a hardware issue, my b
 
Last edited:
Amazing tool. I do have one potential question / feature request for XY and SM games as a DOU player who sometimes plays those oldgens.

In most scenarios, a Mega Pokemon is always going to mega evolve on its first possible turn, but the calc defaults to the base forme on the turn it is planning to mega evolve. Would it be possible to make the calc default to the mega forme's stats, with the option to toggle back to base forme if needed? Or at least make this an optional setting?

There are very few scenarios where a Pokemon that can mega wouldn't do so immediately although they do exist; some examples:
  • Pokemon that don't always hold a mega stone, such as Diancie who can either be a TR attacker or fast Mega Attacker
  • Weather setters like Charizard Y and Mega Tyranitar, who might avoid mega evolving right away for better weather control vs opposing weather teams
  • Pokemon with good base abilities, such as Clear Body Metagross, who will sometimes delay their mega evolution on a predicted Intimidate switch-in to avoid the Attack drop
But I do think that defaulting to the Mega Pokemon's stats is more helpful probably at least 75% of the time. So I'd rather have to toggle the "mega" setting off than on in most games I play.

Thanks for your time in reading this! And once again this calc is amazing.
Sorry about the late reply, but thanks for the kind words! c:

Great suggestion, I'll add it in as a setting to use Mega formes (if available) for the upcoming release. Since there may be too many conditions to implement some kind of catch-all "smart" behavior (as you've pointed out some cases), I'm thinking we could provide 3 possible options for this (instead of making it an on/off toggle):
  • Always: will always default to a Pokémon's Mega forme (if available),
  • XY/SM: will only default to a Pokémon's Mega forme in gens 6 (XY) & 7 (SM),
  • Never: won't default to a Pokémon's Mega forme (default).
Of course, you'll always be able to switch formes (i.e., toggle the Mega forme "off") using the forme switcher that currently exists in the Calcdex. Additionally, if the battle reports a Pokémon to already be Mega'd (e.g., in Hackmons), then this setting would have no effect.

Let me know if this sounds good to you (I'm open to suggestions!). Otherwise, I'll implement it like this.

Thanks!!
 
not sure if this one has been reported yet, sorry if it has (me no read)

bug: tera toggle grays/locks out if the turn is skipped in which a pokemon terastallizes. the tera type cannot be changed after this. since you can only set the regular types of a pokemon after this, it won't count the double-STAB/adaptability bonus either, if applicable.

steps to reproduce:
* be in a battle
* a pokemon on either side of the field terastallizes
* skip the turn as this happens
* the calcdex tab will now lock/grey out the tera toggle for which side tera'd

v. 1.1.4
Nope, you're the first actually haha.

Seems you're describing a feature we added back in v1.1.3 (current version being v1.1.4, at the time of writing) where the Max/Tera toggles in the Moves table will disable once used by the player (so you can keep track of whether your opponent used their Max/Tera).

While it's by design that you won't be able to enable the Tera toggle again until the battle's over, it's strange that you're unable to change the Tera type as well (next to the Pokémon's actual types). You should always be able to edit the Tera type regardless of the Tera toggle state for applicable Gen 9 battles.

Also, the battle reports the actual Tera type when a Pokémon Terastallizes (this is also when the Calcdex will disable the Tera toggle), which is synced into the Calcdex. I remember it should also work when you hit the "Skip Turn" button since the Tera data would still exist in the battle state... unless Showdown changed how they handle Terastallization again lmao. (I'll look into this tho.)

I'll probably add a setting for the auto-disabling of the Max/Tera toggles (enabled by default, as to mimic the v1.1.3 behavior), so you can turn this feature off if you'd like. Hopefully that will solve any problems on your end since the toggle will remain enabled (once you turn off that setting).

Thanks for your report! c:
 
This thing is sick. Have one suggestion for it, I play a LOT of OMs and would love to be able to change what a pokemon uses as its attacking stat (fortemons for example) so i could set my goodra to use its special defense while attacking.
Thanks!! Glad you're liking it :)

Great suggestion, I'll see what I can do. Currently, if you have the Edit Moves setting enabled (under Calcdex > Advanced) with a wide enough browser window, next to the BP value, you can edit which attacking stat (ATK/SPA) of your Pokémon and defending stat (DEF/SPD) of your opponent's Pokémon to use for that specific move's calculation.

But for this upcoming version, in addition to making the ATK/SPA vs. DEF/SPD toggles visible for smaller screens (will probably have to put them on their own lines instead of being horizontally next to each other in order to get them to fit), I'll make all 4 possible stats available, i.e., ATK/DEF/SPA/SPD (of your Pokémon) vs. ATK/DEF/SPA/SPD (of your opponent's Pokémon). So if desired, you can calculate damage based on your Pokémon's SPD stat against your opponent Pokémon's ATK stat lol. (For special cases like Pain Split, these options would have no effect, as it currently is now.)
 
anybody else have the issue where pokemon are randomly switched out?

everytime i click skip turn, a pokemon is randomly switched out, usually the one in slot 5 or 2

never happened before i installed the calc (chrome extension)

seems like a pretty major bug, hopefully its user error but idk how to explain this from my side as a mistake

EDIT: when i don't skip turn, this issue never happens, i view this as a sign i should just be more patient
Welp, that's not good :o

That shouldn't be happening, but I'll look into this. As a fellow "Skip Turn" abuser myself, I'd consider this a major bug too. Might also explain the weird happenings with the Tera types that sh0shin reported in an earlier post after he clicked on "Skip Turn" as well.

Thanks for your report! (Also appreciate you further verifying this bug by not hitting "Skip Turn", which is super helpful to know!!)
 

GenOne

DOU main. GMT-7. PS!: GenOne
is a Community Contributoris a Site Content Manager Alumnusis a Forum Moderator Alumnusis a Top Tiering Contributor Alumnusis a Contributor Alumnus
Sorry about the late reply, but thanks for the kind words! c:

Great suggestion, I'll add it in as a setting to use Mega formes (if available) for the upcoming release. Since there may be too many conditions to implement some kind of catch-all "smart" behavior (as you've pointed out some cases), I'm thinking we could provide 3 possible options for this (instead of making it an on/off toggle):
  • Always: will always default to a Pokémon's Mega forme (if available),
  • XY/SM: will only default to a Pokémon's Mega forme in gens 6 (XY) & 7 (SM),
  • Never: won't default to a Pokémon's Mega forme (default).
Of course, you'll always be able to switch formes (i.e., toggle the Mega forme "off") using the forme switcher that currently exists in the Calcdex. Additionally, if the battle reports a Pokémon to already be Mega'd (e.g., in Hackmons), then this setting would have no effect.

Let me know if this sounds good to you (I'm open to suggestions!). Otherwise, I'll implement it like this.

Thanks!!
The second option would be $$$ to have as default I think, with the other two being toggle-able settings:
  • XY/SM: will only default to a Pokémon's Mega forme in gens 6 (XY) & 7 (SM),
Outside of XY and SM Smogon Doubles and Singles tiers respectively, I would definitely rather the calc default to "never" as megas are not relevant in other standard Smogn tiers. The only use case for "always" would be in a custom-made meta that bend rules.
 

GenOne

DOU main. GMT-7. PS!: GenOne
is a Community Contributoris a Site Content Manager Alumnusis a Forum Moderator Alumnusis a Top Tiering Contributor Alumnusis a Contributor Alumnus
The second option would be $$$ to have as default I think, with the other two being toggle-able settings:
  • XY/SM: will only default to a Pokémon's Mega forme in gens 6 (XY) & 7 (SM),
Outside of XY and SM Smogon Doubles and Singles tiers respectively, I would definitely rather the calc default to "never" as megas are not relevant in other standard Smogn tiers. The only use case for "always" would be in a custom-made meta that bend rules.
Also if I can request a super picky thing, can Diancie be made an exception since it more commonly is a TR setter than mega attacker? No worries if not due to needing to follow consistent logic
 
Before I get into my request I just wanna say this extension is absolutely amazing and I can't imagine how I used to play this game without it :)

This only applies in randbats but I don't think there's currently a way to make calcs with an enemy zoroark if it still has its illusion intact. Showdex just considers zoroark as the pokemon it's disguised as. Obviously you can't just make the app instantly identify zoroarks for competitve reasons but it'd be nice if there was a way to just make zoroark calcs at any time.

This situation happens decently often though I'd understand if it isn't something that high up on the priority list.
 
Nope, you're the first actually haha.

Seems you're describing a feature we added back in v1.1.3 (current version being v1.1.4, at the time of writing) where the Max/Tera toggles in the Moves table will disable once used by the player (so you can keep track of whether your opponent used their Max/Tera).

While it's by design that you won't be able to enable the Tera toggle again until the battle's over, it's strange that you're unable to change the Tera type as well (next to the Pokémon's actual types). You should always be able to edit the Tera type regardless of the Tera toggle state for applicable Gen 9 battles.

Also, the battle reports the actual Tera type when a Pokémon Terastallizes (this is also when the Calcdex will disable the Tera toggle), which is synced into the Calcdex. I remember it should also work when you hit the "Skip Turn" button since the Tera data would still exist in the battle state... unless Showdown changed how they handle Terastallization again lmao. (I'll look into this tho.)

I'll probably add a setting for the auto-disabling of the Max/Tera toggles (enabled by default, as to mimic the v1.1.3 behavior), so you can turn this feature off if you'd like. Hopefully that will solve any problems on your end since the toggle will remain enabled (once you turn off that setting).

Thanks for your report! c:
example

1680123233602.png
 
Feature request:

Can we get a native calculator within calcdex without opening a battle?
Because of the new calculator update we cant see megas unless we turn it to S/M and even then we then cant see other gens past S/M.

So getting a native calculator to open and use with ease would be good.
 
I have a few suggestions:
1. Automatically update items every turn in random battle.
Eg Buzzwole deals Choice Band damage, but Showdex doesn't update and still shows as Choice Scarf. It should update the damage and show as Choice Band.
Similarly, if Guzzlord deals Choice Specs damage, it should be updated instead of AV.

2. Should be able to turn off DMax mode, when the opponent is DMax.
I want to know if my Pokemon can get revenge kill if the opponent doesn't DMax. However, once the Pokemon has DMax, it cannot be turned off.
 
The second option would be $$$ to have as default I think, with the other two being toggle-able settings:
  • XY/SM: will only default to a Pokémon's Mega forme in gens 6 (XY) & 7 (SM),
Outside of XY and SM Smogon Doubles and Singles tiers respectively, I would definitely rather the calc default to "never" as megas are not relevant in other standard Smogn tiers. The only use case for "always" would be in a custom-made meta that bend rules.
Sounds good!

With things like these, I like to err on the side of having more options, especially for those playing custom metas, as you've mentioned. We often find that when someone asks "Can I do this...?", there's already an existing option for it!

Also if I can request a super picky thing, can Diancie be made an exception since it more commonly is a TR setter than mega attacker? No worries if not due to needing to follow consistent logic
Sure can! Will note that in the tooltip for the XY/SM option.

Thanks again for the suggestion c:
 
Before I get into my request I just wanna say this extension is absolutely amazing and I can't imagine how I used to play this game without it :)

This only applies in randbats but I don't think there's currently a way to make calcs with an enemy zoroark if it still has its illusion intact. Showdex just considers zoroark as the pokemon it's disguised as. Obviously you can't just make the app instantly identify zoroarks for competitve reasons but it'd be nice if there was a way to just make zoroark calcs at any time.

This situation happens decently often though I'd understand if it isn't something that high up on the priority list.
Thanks for the kind words! c:

Ah ya, iirc, someone requested this before, but it looked to be a pain-in-the-ass since Calcdex's syncing mechanism is a bit finicky (Pokémon don't have consistent IDs in the data layer, so there's a hacky workaround to inject a constant, consistent ID for each Pokémon created by the Showdown client), so wasn't something we could implement real quick.

For those who are curious, when Zoroark is copying another Pokémon from its Illusion, the client (in the data layer that the Calcdex directly syncs from) only reports it if its your Zoroark. Otherwise (for your opponent's side), the client will initialize a new Pokémon if the copied Pokémon wasn't revealed before, or pretend like that previously revealed Pokémon is out (i.e., you as a player have no idea about the Zoroark, even in the data layer, which is obviously necessary for competitive integrity). When Illusion ends, the client will either replace the prior initialized Pokémon or add a new Pokémon (if it copied a prior revealed Pokémon) as the revealed Zoroark. Speaking of which, there were old bugs in the Calcdex that caused a player to have 7 Pokémon w/ 2 of them being duplicates (but would clip at 6, so the Zoroark in the 7th position wouldn't be accessible), but that's been long patched now (thankfully ... knock on Sudowoodo).

But now that I'm thinking about it again, I think what we can do is allow you to "add" a temporary Pokémon (not just Zoroark, to cover all bases) if the player has any empty slots (e.g., not all their Pokémon have been revealed yet), but only in Randoms. "Add" is in quotes cause as soon as a new Pokémon is detected by the syncing mechanism (e.g., it's been revealed in battle), we can either (a) replace the closest matching "added" Pokémon with the revealed one (as to preserve whatever changes you may have made for unrevealed properties, like its ability or item), or (b) yeet one of your "added" Pokémon since there was no close match.

So for instance, imagine in a Randoms battle, your opponent has 5 of 6 Pokémon revealed (with their last being a Zoroark), but if you know this, you can "add" the 6th Pokémon to be Zoroark. Once its Illusion is revealed and Zoroark is reported by the client, we'll attach a generated ID to both your added Zoroark and the client-reported one to enable the normal syncing behavior. On the other hand, if you didn't know that and you "added" a random Pokémon, once Zoroark's Illusion is revealed, that random Pokémon you added will be completely replaced with the client-revealed Zoroark.

Hope that makes some bit of sense haha. Let me know if this is something you'd be interested in!

Edit: I meant Illusion, not Imposter, sorry.
 
Last edited:
BUG: hydro steam in sun counts as a water move in sun (-50% damage) it's not counting hydro steam's special stuff (bonus dmg in sun)

thanks for the great calc btw, really love not having to click between the dmg calc tab and type stuff in it all game
Ah, that's a bug with the underlying damage calculator Showdex uses (i.e., @smogon/calc, the same one used on calc.ps), which the Smogon Dev Team has addressed in one of their most recent commits (97f5ce6, if you're curious).

I've already applied the newest changes to Showdex's version of @smogon/calc for the upcoming v1.1.5 patch, but won't be released until a few more critical bugs are addressed. (I keep saying that it'll be out "soon" LOL, but we unfortunately have day jobs now, so they've been eating up a considerable amount of our time these past couple weeks. I really do appreciate everyone's patience tho!)

Regardless, thanks for reporting this & glad you're enjoying the calc! c:
 
Thanks for the helpful screenshot! Yeah, that shouldn't be happening at all.

I've had this issue as well, you aren't the only one. Pokemon Tera's, Showdex doesn't realize it has Tera'd, doesn't make the pokemon the Tera typing, and then locks both sides' ability to click the Tera button. Very strange bug LOL.
A very strange bug indeed. Kinda looks like Showdown may have slightly changed how the Terastallization state is being reported, so I'll look into this for v1.1.5. (But I'll still make the Max/Tera disabling thing a setting as well.)

Thanks for helping me out with this guys!
 

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

Top