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

I had a game where using Zapdos-G broke the calc. it also did this for Arceus-Water when I went to go try Ubers. Definitely a supporter of form change, for Aegislash, mega evolutions etc.

Is it possible that the sets could adjust themselves based on damage rolls somehow? i.e if you have a typical Ferrothorn in against Weavile, and the Weavile does damage, the calc can immediately go "that's banded!" and automatically adjust the EVs and item to account? I've had situations come up like that in testing, where it took me a second to realize I was playing a banded Ferrothorn yesterday and would be cool if the automatic sets would adjust themselves like that to save me and others the trouble
 
I had a game where using Zapdos-G broke the calc. it also did this for Arceus-Water when I went to go try Ubers. Definitely a supporter of form change, for Aegislash, mega evolutions etc.

Is it possible that the sets could adjust themselves based on damage rolls somehow? i.e if you have a typical Ferrothorn in against Weavile, and the Weavile does damage, the calc can immediately go "that's banded!" and automatically adjust the EVs and item to account? I've had situations come up like that in testing, where it took me a second to realize I was playing a banded Ferrothorn yesterday and would be cool if the automatic sets would adjust themselves like that to save me and others the trouble
I have nothing to do with this project, but the second part seems questionable to me. Showing you that something is banded / specs damage or adjusting EV spreads based on damage rolls is kinda like having someone in the back ghosting you. There's a difference between having an idea and testing that idea via the calc ("could this be banded damage?"), and having the tool explicitly tell you the answer to a question you didn't think of
 
I have nothing to do with this project, but the second part seems questionable to me. Showing you that something is banded / specs damage or adjusting EV spreads based on damage rolls is kinda like having someone in the back ghosting you. There's a difference between having an idea and testing that idea via the calc ("could this be banded damage?"), and having the tool explicitly tell you the answer to a question you didn't think of

I was thinking if banded/specs was the ONLY possible damage roll (as if you'd figured it out anyways and had to re-adjust for banded damage, but the calc would do it anyways).

I do see the issues with that looking back with how nutty some rolls can be. Realized as well that natures, EVs, and IVs go into consideration with some of those rolls and that it would most likely take multiple hits for confirmation, and that just doesn't seem like a plausible idea at this stage with so many variables already calculated.
 
I found another small bug: the opponent having one of the galarian formes of zapdos, moltres or articuno seems to crash the calc, though if you are the one using it this doesn't happen (tested on firefox). Also small qol suggestion, it would be useful if items/moves were categorized in to popular items/moves like showdown does in the teambuilder.
 
While we're on that subject; there's an issue I'm having where Mega Evolutions aren't calculated until after they Mega Evolve, so it messes with the calculations a bit (since they get stronger/bulkier after Mega Evolving).

A quick fix would be to just allow us to change the Pokémon's form manually so we can calculate the damage properly (ex: letting us swap to Aegislash-Blade or Darmanitan-Zen manually to calculate damage). This also works for Megas too since they're also forms technically.

Other than that, really nice job. This is amazing :heart:
Great idea, we totally agree! Keith just got done implementing this yesterday, so it'll be out with the next patch :) If the Pokemon has a different form (like Aegislash-Blade, Mega, Gmax, etc) then you can click on the name and switch to their other form. If there are multiple forms, you just click it again and cycle through the list (Mega Charizard-X & Charizard-Y). When the turn ends, we plan to revert it back to it's current form if they didn't end up changing form (so you don't forget to change the form back). Hopefully that made sense!
 
2) The issue I had was that nothing showed up at all during (unrated) random battles. It recognized that I was in a battle, but didn't show any info
4) Probably nothing fancy, just a line maybe. But maybe it would just make it look more busy and distract from the important stuff, not sure

Edit: I noticed the add-on description in Firefox says "Pokémon Showdown extension that harnesses the power of parabolic calculus to strategically extract your opponents' ELO."
Weird that it didn't show up in your Unrated Random Battle, I just played a game and it worked for me. Could you screenshot it for me?
And yeah I think adding lines would make it more busy, but we might look at some other way of separating them.
Yep the Firefox/Chrome description is tongue-in-cheek, but technically kind of true LOL Keith likes to troll a lil bit
 
I had a game where using Zapdos-G broke the calc. it also did this for Arceus-Water when I went to go try Ubers. Definitely a supporter of form change, for Aegislash, mega evolutions etc.

Is it possible that the sets could adjust themselves based on damage rolls somehow? i.e if you have a typical Ferrothorn in against Weavile, and the Weavile does damage, the calc can immediately go "that's banded!" and automatically adjust the EVs and item to account? I've had situations come up like that in testing, where it took me a second to realize I was playing a banded Ferrothorn yesterday and would be cool if the automatic sets would adjust themselves like that to save me and others the trouble
Oh shoot, thanks for letting us know! What format were you playing when Zapdos-G broke the calc? We'll have to look into that, in addition to Arceus-Water in Ubers. Also we'll be adding the form change feature in the next patch, we actually just implemented it yesterday and it's working pretty well so far. Just need to do a lot more testing on it, as there will surely be bugs (yay!)

And to answer your suggestion about the damage rolls, we do have plans to implement smarter Smogon set selection, but only based on what is revealed/obvious from the battle. Currently, we select the first set from the given format, so if Kartana has 3 OU sets, we just choose the first OU set from the list. Let's say the first set is Choice Scarf Kartana. Now if they end up taking Life Orb damage or using Swords Dance, then it's obvious that it should be the Life Orb Kartana set or a non-choice item set since you'd have to be crazy to put Swords Dance on a Choice Scarfed Kart. Our plan is to have the Pokemon's current set automatically update based on info that's revealed during the battle like what I described above.

However, we felt that just like 85percent said, it would be too much to switch the set based on calculated damage rolls, as we felt that was crossing the line from "helpful timesaver" to "unfair advantage". We think it's the player's responsibility to look at the damage, realize they must be choiced and adjust the calc accordingly, especially now since we've automated a lot of the manual work. A computer is really good at running calculations and it would feel like the computer is starting to play for you at that point. Essentially, we don't want to automate anything that requires intuition/game sense, that's on the player. We've considered arguments for both sides of this issue, but in this case, we would rather error on the side of maintaining competitive integrity at all costs, because that's really important to us.

All this is to say, you made a great suggestion which is certainly possible, but it's not the direction we want to take our extension in. I hope this doesn't sound like I hate your idea or anything, because honestly I could see it being really useful. Just maybe a lil too useful ya know :)
 
I found another small bug: the opponent having one of the galarian formes of zapdos, moltres or articuno seems to crash the calc, though if you are the one using it this doesn't happen (tested on firefox). Also small qol suggestion, it would be useful if items/moves were categorized in to popular items/moves like showdown does in the teambuilder.
Thanks for the heads-up, we're gonna investigate that bug :) and that QoL feature sounds great, we'll try to implement that in the next patch!
 
Weird that it didn't show up in your Unrated Random Battle, I just played a game and it worked for me. Could you screenshot it for me?
And yeah I think adding lines would make it more busy, but we might look at some other way of separating them.
Yep the Firefox/Chrome description is tongue-in-cheek, but technically kind of true LOL Keith likes to troll a lil bit
screenshot.png

as you can see, it's just an empty calc dex window. it does work in rated random battles though
 
Oh shoot, thanks for letting us know! What format were you playing when Zapdos-G broke the calc? We'll have to look into that, in addition to Arceus-Water in Ubers. Also we'll be adding the form change feature in the next patch, we actually just implemented it yesterday and it's working pretty well so far. Just need to do a lot more testing on it, as there will surely be bugs (yay!)

I was playing in standard national dex: and it only seemed to break when I was against it? It was odd. As for Arceus-Water, broke whenever Arceus hit the field. Haven't come across anything else, but if I do I'll let you know.
 
View attachment 453472
as you can see, it's just an empty calc dex window. it does work in rated random battles though
I can't seem to reproduce this bug at all :( Super weird that it works in rated but not unrated random battles.
If you don't mind, I'll need to ask some more questions to try and hone in on the problem...
  1. Does it happen at the start of the battle?
  2. Does it happen every battle?
  3. Try restarting and updating your browser if it's out of date or been open for a while. Especially try reopening Showdown. Does it still not work? (I assumed you prob already did this, but just in case)
We're going to add in an error handler instead of displaying a blank page in this next patch, so worst case scenario, we'll figure it out with that.
 
I can't seem to reproduce this bug at all :( Super weird that it works in rated but not unrated random battles.
If you don't mind, I'll need to ask some more questions to try and hone in on the problem...
  1. Does it happen at the start of the battle?
  2. Does it happen every battle?
  3. Try restarting and updating your browser if it's out of date or been open for a while. Especially try reopening Showdown. Does it still not work? (I assumed you prob already did this, but just in case)
We're going to add in an error handler instead of displaying a blank page in this next patch, so worst case scenario, we'll figure it out with that.
1.
Screenshot.png
This is what initially shows up, and then shortly after it goes blank
2.
After some experimentation, it doesn't seem to be an issue with the left and right panel setting. But with single panel, it seems to depend a bit on which window you have open when it tries to load in the sets. Not sure how to reliably reproduce it though
3. I did reopen showdown, but haven't restarted the browser yet, wanted to experiment a bit first, in case it gives you some info

Also another thing I noticed:
Screenshot 3.png

As you can see, for some reason in some of the battles it's the opponent's name vs the opponent's name


Lastly, I tested against a Ditto, and it was a bit iffy. While the HP seems to be shown correctly (= using Ditto base HP), the Ditto defaults to the sample set of whatever it is copying. So in my case it copied an Urshifu, which made it end up with the Choice Band set, including the Choice Band and no HP EVs (instead of the Choice Scarf and EV investment from the standard Ditto set it should copy):
1663338969256.png

In addition in calcs for the moves of the actual Urshifu:
1663338529711.png

As you can see, neither the 1HKO nor the 2HKO for Close Combat / Surging Strikes, respectively, are correct given the percent ranges that are shown. The reason is that the percent ranges seem to (incorrectly) be based on Urshifu's HP stat, not Ditto's. Below the correct ones against a Ditto, which are in line with the 1HKO / 2HKO shown:
1663338623527.png
 
Last edited:

Runo

Almost time to rest
is a Forum Moderatoris a Community Contributoris a Tiering Contributor
Hey I found two bugs:
  1. I'm like 80% sure that entry hazards are constantly calculated, and not just the first turn in. This has actually costed me so many games it wasn't even funny. It was at game 10 I think when I finally realized that the issue was entry hazards.
  2. when trying to adjust the EVs for Dexited mons without an actual set, the builder crashes when attempting to adjust SpA and SpD
 
I've noticed that selecting a Gligar on your team crashes the calc in Natdex formats. This does not apply to opposing Gligars. After testing a couple of Dexited Pokemon, including NFEs, Gligar is the only Pokemon this happens to.
 

Plague von Karma

Banned deucer.
1663590955082.png

Unsure how this is intended to work with old gens, but a few things I noticed wrt RBY;
  • Paralysis always seems to just halve, not quarter, which is how it works pre-Gen 6 (I think?)
    • It also doesn't track major status stat drop reapplication, but that's probably more trouble than it's worth? (opponent boosts or you take a stat drop that isn't the same stat as the one affected, the stat drop from burn/para is applied again; eg. zapdos agility and rhydon leer would reapply the opponent's paralysis speed drop)
  • EVs are autoset to 0 when they should generally be 252 across the board pre-Gen 3
Seems to almost be nailed down though!
 
Was looking for something like this a month ago or so, remembering that the gen5 era had something similar. Looks like my timing was just a bit off lol.

Something useful this could have is to pull data from pages like this: https://www.smogon.com/stats/2022-08/moveset/gen8ou-0.txt

Besides being extremely helpful with showing the chance a certain move is on a Pokémon, it can also be useful for Pokémon who doesn't have a Smogon set yet by auto-filling the top 4 used moves.
 
small bug that I just found, the calc doesn't show the correct nature in Challenge Cup 1v1, as can be seen here, all of my pokemon had either modest or adamant View attachment 453529
Ah, yeah, those Chinese IVs will definitely mess up the extension's internal spread guesser.

The Showdown server doesn't actually provide the original spread for your Pokémon in the battle, only the stats after the spread is applied (but before abilities/items/modifications), so the extension is currently (inefficiently) trying different combinations of natures, EVs and IVs to try and match the server-provided stats.

Typically if you find your Pokémon's nature to be wrong, you can be sure the spread guesser either found another Chinese spread combination matching the server-reported stats or failed completely if all the EVs and IVs are 0 (nature will be Adamant since that's the first nature the guesser tries).

However, this is something that can be fixed when we incorporate the Teambuilder since we'll be able to read what team you chose when you queue for a battle (in which we'll have the spread info as shown in your first screenshot).

In the meantime, we're about to deploy the next version real soon (v1.0.2), so I'll see if I can sneak in a small temporary workaround to improve the spread guesser.

Thanks for your report!
 
1.
View attachment 453531This is what initially shows up, and then shortly after it goes blank
2.
After some experimentation, it doesn't seem to be an issue with the left and right panel setting. But with single panel, it seems to depend a bit on which window you have open when it tries to load in the sets. Not sure how to reliably reproduce it though
3. I did reopen showdown, but haven't restarted the browser yet, wanted to experiment a bit first, in case it gives you some info

Also another thing I noticed:
View attachment 453532
As you can see, for some reason in some of the battles it's the opponent's name vs the opponent's name


Lastly, I tested against a Ditto, and it was a bit iffy. While the HP seems to be shown correctly (= using Ditto base HP), the Ditto defaults to the sample set of whatever it is copying. So in my case it copied an Urshifu, which made it end up with the Choice Band set, including the Choice Band and no HP EVs (instead of the Choice Scarf and EV investment from the standard Ditto set it should copy):
View attachment 453537
In addition in calcs for the moves of the actual Urshifu:
View attachment 453535
As you can see, neither the 1HKO nor the 2HKO for Close Combat / Surging Strikes, respectively, are correct given the percent ranges that are shown. The reason is that the percent ranges seem to (incorrectly) be based on Urshifu's HP stat, not Ditto's. Below the correct ones against a Ditto, which are in line with the 1HKO / 2HKO shown:
View attachment 453536
Nice finds!

Interesting, the fact that it showed the UI before going blank means it crashed during initialization, which is usually caused by a problematic Pokémon, but could be for a variety of reasons. Each Calcdex is uniquely assigned to a battle, only updating when that battle updates, but it's entirely possible the function I hook into to dispatch battle updates could be funky in single-panel mode. I'll look into this before deploying the next v1.0.2 update.

For the dupe names in the Hellodex, we've noticed that too and fixed that for v1.0.2. Only happens when you (as a player in the battle) are player 2 in the data layer. (Speaking of which, being player 2 also causes you to be on the bottom in the Calcdex, which is something I fixed in v1.0.2 so you'll always be on top if you're logged-in. If you don't like that, we plan on making that configurable once we provide a settings panel, most likely in the next next update.)

DAMN... thought I put Ditto in the grave, but here it is once again, coming back to haunt me lolol. In all seriousness, you might be onto something there... I may have forgotten to correctly set the HP of the transformed Ditto when plugging in all the data into the actual damage calculator. I'll make sure this is fixed before v1.0.2.

But on the real, really appreciate you taking the time to investigate and document all this! You've saved me hella debugging time, for sure.

ditto-dance.gif
 
Hey I found two bugs:
  1. I'm like 80% sure that entry hazards are constantly calculated, and not just the first turn in. This has actually costed me so many games it wasn't even funny. It was at game 10 I think when I finally realized that the issue was entry hazards.
  2. when trying to adjust the EVs for Dexited mons without an actual set, the builder crashes when attempting to adjust SpA and SpD
  1. F... I'm sorry to hear that :pikuh: I'm 100% sure that entry hazards are constantly being calculated and can now see how that can be very problematic, especially since you can't configure manually hazards like you can on calc.ps (they're automatically set under-the-hood as to not further clutter the already cluttered UI). Regardless, thank you for your sacrifice in the name of bug hunting and I'll make sure your L's won't be in vain for the upcoming v1.0.2 update!
  2. I'm assuming you're in Gen 8 National Dex when using those Dexited Pokémon? I'll test a few myself, but if you can provide a couple sets (or even just the names, honestly) of the Pokémon you know for sure crashes the Calcdex, that'd be very helpful!
 
I've noticed that selecting a Gligar on your team crashes the calc in Natdex formats. This does not apply to opposing Gligars. After testing a couple of Dexited Pokemon, including NFEs, Gligar is the only Pokemon this happens to.
Oh, I just asked Runoisch for some Dexited Pokémon (who mentioned a similar bug), but that's prefect, I'll start out trying Gligar. Thanks!
 
View attachment 454024
Unsure how this is intended to work with old gens, but a few things I noticed wrt RBY;
  • Paralysis always seems to just halve, not quarter, which is how it works pre-Gen 6 (I think?)
    • It also doesn't track major status stat drop reapplication, but that's probably more trouble than it's worth? (opponent boosts or you take a stat drop that isn't the same stat as the one affected, the stat drop from burn/para is applied again; eg. zapdos agility and rhydon leer would reapply the opponent's paralysis speed drop)
  • EVs are autoset to 0 when they should generally be 252 across the board pre-Gen 3
Seems to almost be nailed down though!
Actually, v1.0.1 has no support for the legacy mechanics used in gens 1 and 2, particularly the SPC stat (for gen 1) and DVs. Technically, the EVs don't do anything since they don't exist pre-gen 3. (Also, if you're playing [not spectating] a legacy gen battle, you may find the Calcdex to only show blank fields and no Pokémon.)

Took a bit longer than initially expected, but the upcoming v1.0.2 update has full legacy support now!

SCR-20220918-tc0.png


As for the Paralysis, yeah, it should be a 75% SPE reduction pre-gen 7 (including gen 6) and a 50% SPE reduction in gens 7+. Might've been a bug when the battle data doesn't initialize fast enough, so the Calcdex defaults to gen 8, but never updates the gen once the battle data becomes available.

But that should be fixed in the upcoming update too!

SCR-20220919-ot5.png

SCR-20220919-oue.png
SCR-20220919-oup.png
 

Runo

Almost time to rest
is a Forum Moderatoris a Community Contributoris a Tiering Contributor
  1. I'm assuming you're in Gen 8 National Dex when using those Dexited Pokémon? I'll test a few myself, but if you can provide a couple sets (or even just the names, honestly) of the Pokémon you know for sure crashes the Calcdex, that'd be very helpful!
These are sorted in the order they were discovered. This is NOT a complete list.
Affected
Dewgong
Ursaring
Smeargle
Ambipom
Ariados
Venomoth
Ampharos (Mega may also be affected)
Donphan

Not affected
Pyroar
Alolan-Muk (Regular Muk may be affected)
Meloetta
Zebstrika
Servine
Staraptor
Camerupt-Mega (Base form may be affected)
Mega-Beedrill (Base form may be affected)

The mons affected are incredibly random, so working to find out exactly what mons are affected will be a time consuming effort that I can't afford at the moment. Again, if they have sets then they're perfectly fine, so maybe port over some Ultra Sun/Moon or Older sets just so the void is filled.
 
Was looking for something like this a month ago or so, remembering that the gen5 era had something similar. Looks like my timing was just a bit off lol.

Something useful this could have is to pull data from pages like this: https://www.smogon.com/stats/2022-08/moveset/gen8ou-0.txt

Besides being extremely helpful with showing the chance a certain move is on a Pokémon, it can also be useful for Pokémon who doesn't have a Smogon set yet by auto-filling the top 4 used moves.
That's actually not a bad workaround for missing sets!

We pull data from pkmn.cc's API for the sets, but upon closer inspection, it seems they also have APIs for the stats as well: https://pkmn.github.io/smogon/data/stats/gen8ou.json (basically what you linked in a more machine-readable format). Having those stats made available in the calculator is very doable.

Don't want to delay the v1.0.2 release too long though (since it takes some time for approval on each browser's extension store), so I'll be adding this to the list of planned features, most likely in the next next version (v1.0.3).

Thanks for the suggestion!
 
These are sorted in the order they were discovered. This is NOT a complete list.
Affected
Dewgong
Ursaring
Smeargle
Ambipom
Ariados
Venomoth
Ampharos (Mega may also be affected)
Donphan

Not affected
Pyroar
Alolan-Muk (Regular Muk may be affected)
Meloetta
Zebstrika
Servine
Staraptor
Camerupt-Mega (Base form may be affected)
Mega-Beedrill (Base form may be affected)

The mons affected are incredibly random, so working to find out exactly what mons are affected will be a time consuming effort that I can't afford at the moment. Again, if they have sets then they're perfectly fine, so maybe port over some Ultra Sun/Moon or Older sets just so the void is filled.
More than enough to get me started, thanks! Hopefully I can find a pattern, or better yet, realize it was some dumb mistake I made on my end (so it'll be easily fixable).
 

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

Top