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

some things to maybe try:
clear cookies (back up teams first lol)
load up into random battles
check your wifi speed
re-connect to your wifi
try a different computer (if you have access to one)
try multiple different formats (not gen 9)
I did clear my cookies twice since then (forgot to back up my teams sad face)
this was a random battle but it didn't work for any other format
my wifi is goated
my wifi is goated
only have my PC atm
see line 2

like I said I'm just going to wait for the gen 9 update and see if it works then, until then I can live with calcing manually
 
the extension isnt automatically choosing any sets for me, even for random battles (thievul has parting shot because it used parting shot the last turn)
imagem_2022-12-08_233523585.png
 
Gotcha, thanks! Seems to be a problem with initializing the Pokémon into the calc, hence why none show up.

Could you follow the steps outlined in this post so I can see what's going on? Or if you visually get some error, that might be helpful too.

Thanks!
Had to compress the file because smogon wouldn't let me attach the log file but here it is.

Also I play Showdown on Chrome on a MacBook Air from 2014ish. My OS is 10.13.6
 

Attachments

Patch 1.1.0 is now live!
Did you miss us? Sorry we've been gone for so long, we've been working hard to support all these lovely new Gen9 mechanics lol GameFreak really stepped up their game this time to ensure we had to hard code fixes for specific edge cases (looking at you Ruin abilities).

Anyways, this patch includes support for basically all the new Gen9 mechanics & the new Gen9randbats, in addition to some QoL fixes from the unreleased patch 1.0.7 such as adding probabilities to randbats in the ability/item/move dropdowns, importing sets into Calcdex, viewing Showdown usage stats outside of the Showdown Usage set, and more! As always, you can read the full patch notes here.

Newly Supported Gen9 Mechanics
  • Terastallization
    • You can now view and edit your Tera type (which appears next to your normal typing(s)) and toggle terastallization on/off by clicking the “Tera” button next to Moves (ofc it will also auto-sync with the battle state), which will apply the new STAB modifiers and change your defensive typing
    • If not provided from the set, the Tera type will default to the mon’s first type
    • Would be quite unlucky if this ends up getting banned lol plz Finch have mercy
  • Protosynthesis/Quark Drive
    • You can manually toggle the boost on/off, and it automatically activates with Booster Energy or Sun/Electric Terrain. Provides a 1.3x boost for all stats except for Speed, in which case it’s 1.5x
    • If a Paradox mon doesn’t receive the Protosynthesis/Quark Drive boost and Sun/Electric terrain aren’t active (whichever applies), it will automatically change the item to the next highest usage item
  • Treasure of Ruin abilities
    • You can manually toggle these on/off, but in doubles, you can only have two active on your side at a time. So if you have two Dark Quartet mon out on your side in doubles, you’ll have to deactivate one of their abilities to be able to activate the ability for another Dark Quartet mon that you’re considering switching in (tho I doubt you’ll find yourself in this situation too often)
  • Smogon Usage sets for Gen9 mon
    • Thankfully the PS usage stats are out for November, which means most Pokemon in most formats will have a Showdown Usage set applied (”Download Usage Stats” must be enabled in settings). This is awesome, as it would have been pretty annoying to have a blank set for all the new mon and having to manually set all the EVs, moves, ability, etc every battle until Smogon sets are finally released
    • Unfortunately in some formats that began at the end of November there is a lack of Showdown usage data (such as VGC), but this should definitely be fixed once the December stats are released
  • Gen9 randbats is supported!
    • Right before we were about to release this patch, Gen9 randbats arrived, so of course we had to delay the patch so we could include support for it (as a smooth brain randbats enjoyer myself, I need those sweet juicy calcs).
    • Randbat sets now have “roles” such as “Bulky Attacker”, “AV Pivot”, etc. that you can view and switch between from the set dropdown. Definitely take a look at the differences between the sets, as it can be pretty clear when they use a certain move what set they are. We plan to add automatic set switching when a move/Tera type is revealed that can’t be in the current set in the next patch, as there are a lot of instances where it’s pretty obvious which set it is (e.g. they use Defog which is only in the Support set and not in the Attacker set).
    • In the moves dropdown, you can view the probability % for each move to appear in THAT ROLE. This % is specific to each role, which you can change from the set dropdown. If you see that there’s no % next to the revealed move in the dropdown, it’s probably because hint hint cough cough you should probably change the set to another one.
    • Tera types have also been added to the sets, along with probability %s. We’ve included the those in a separate list at the top of the Tera dropdown.
  • New tooltip for Final Stats
    • You can now hover over the colored final stat to view a tooltip showing all the boosts/debuffs that are being applied, such as 0.75x from Beads of Ruin, 1.5x from Assault Vest, so you can understand how the calc arrived at that number
    • To note, some abilities/moves like Supreme Overlord are a base power increase and not a stat boost, so that’s why you won’t see it reflected in the final stats, but rather in the move tooltip
  • Rage Fist, Supreme Overlord, Last Respects, Glaive Rush, Raging Bull, Sharpness, Double Shock, Purifying Salt, Salt Cure, Well-Baked Body, Wind Power, Wind Rider, Electromorphosis, Earth Eater, Zero to Hero, Commander, Armor Tail, Population Bomb (only reflects damage from 10 hits), and Rocky Payload have all been tested and are supported
    • For Rage Fist, Supreme Overlord, Last Respects, and Glaive Rush (opposing mon damage), the move tooltip will reflect the base power (BP) increase, e.g. after taking two hits, hovering over the move Rage Fist will show the BP as 150 in the tooltip (colored green to indicate a positive change, red for negative change)
    • Hopefully these work as intended, but if not let us know, as PS is still fixing bugs with some of these moves/abilities too
  • Snow
    • Provides a 1.5x defense boost for ice types in the snow
Some Known Issues
  • The Tera types for your team won’t be filled in until you switch the mon in, this time due to how Showdown implemented Tera in the battle state, as that data isn’t provided from the server until the mon is active on the field. Hopefully they’ll change this in the future, but if not, we plan to eventually start reading the sets directly from teambuilder, at which point we could detect the Tera type before the battle even starts
  • Acrobactics/Knock Off damage is incorrect when a Paradox mon has their Protosynthesis/Quark Drive active from Booster Energy, due to how the damage calc API currently works. In order to allow you to activate Protosynthesis/Quark Drive manually with an “active” toggle, we have to set your item to Booster Energy (unless field conditions are met), bc if we set Sun/Electric Terrain, it could affect the damage of other moves
    • Turn on “Editable Move Properties” (it’s at the bottom of the settings page) to manually fix issues like Acrobatics/Knock Off damage by increasing the BP while we wait for these issues to be ironed out
  • Collision Course/Electro Drift don’t correctly apply the 1.3x boost for supereffective hits (waiting for calc.ps to fix this)
New Features from Patch 1.0.7
We didn’t end up getting this patch out in time before Keith left for vacation, but we added some useful features in the unreleased patch 1.0.7 that you might be interested in:
  • Added set probabilities to ability/item/move dropdown options in Randbats and we now sort the lists by their probability as well, which means that moves/items/abilities with 100% probability will always be included in the default set (huge thanks to pre for adding this feature to his API) [thanks IIIJLIII for the suggestion]
  • You can now view Showdown usage stats displayed in other sets (i.e. you’re viewing the Smogon Choice Specs Dragapult set, you can now see the usage % for each of the moves, items, abilities, etc. without having to change the set to “Showdown Usage”)
  • For non-ladder games, we now display the player’s elo if it’s available in the given format (such as in private/tournament battles) [thanks Iodyne for the suggestion]
  • You can now import sets from your clipboard (follows PokePaste syntax)
  • Fixed Hellodex win/loss counter messing up after viewing battle replay
  • Added a new setting that allows you to choose what stats are shown by default for you or your opponent’s side, i.e. Show Base Stats, EVs, IVs for my opponent’s side but hide the Base Stats and IVs on my side [thanks Iodyne for the suggestion]
Planned Future Updates
  • Add auto-set switching for Gen9 randbats
  • Fix some of the few moves that aren’t supported yet, such as Terrain Pulse and Beat Up, as they require us to manually patch the Calc API ourselves
  • Add a developer console with advanced power user commands
  • Allow set favoriting on a per-Pokemon basis
  • Allow you to open the Porydex usage page for a mon instead of the Smogon page
  • Read from Teambuilder sets directly instead of trying to guess the EVs/IVs/nature with brute force maths
  • Improve resizing on larger screen sizes
  • Create a One vs All, All vs One calc for teambuilding (Teamdex) which will allow you to use the calc outside of battle. This is going to be a huge feature that will take quite some time, and I hope to share our ideas on it soon, as we’d love to get community feedback so we can make it as useful as possible for you
Any and all feedback is super appreciated as always, and thank you so much to everyone for your support thus far! Hope ya'll enjoy <3
 
Last edited:
I did clear my cookies twice since then (forgot to back up my teams sad face)
this was a random battle but it didn't work for any other format
my wifi is goated
my wifi is goated
only have my PC atm
see line 2

like I said I'm just going to wait for the gen 9 update and see if it works then, until then I can live with calcing manually
Saw your post with the error message and yeah, that was because the battle was Gen 9 (which unfortunately isn't the cause of the non-downloading sets). But the Gen 9 update is out now so feel free to try it out and let me know how that goes!

My other suspicion (since your OS/browser/version seems nominal) is that you may have some other extension that is blocking access to pkmn.github.io. Can you try enabling Showdex on Incognito (without enabling any other extensions) to see if that works?

SCR-20221216-kgs.png
 
the extension isnt automatically choosing any sets for me, even for random battles (thievul has parting shot because it used parting shot the last turn)
View attachment 472552
Ah, yikes. Seems like you have a similar problem as Togkey when it comes to downloading sets. (As you can see in the sets dropdown, there are 3 dots on the right that indicates that the sets are downloading.)

Going to assume you haven't changed the Site access permissions from their defaults, so could you try to load the extension in Incognito (as outlined in this post) to make sure other extensions you have installed aren't interfering with the sets downloading?

Thanks!
 
Had to compress the file because smogon wouldn't let me attach the log file but here it is.

Also I play Showdown on Chrome on a MacBook Air from 2014ish. My OS is 10.13.6
Thanks for the logs! Found two interesting errors that shouldn't have appeared (should've failed silently):

Code:
pkmn.github.io/randbats/data/gen8randombattlenodmax.json:1 Failed to load resource: the server responded with a status of 404 ()
(index):1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at XMLHttpRequest.<anonymous> (index.js:26:25)
Code:
pkmn.github.io/randbats/data/gen8randombattleblitz.json:1 Failed to load resource: the server responded with a status of 404 ()
(index):1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at XMLHttpRequest.<anonymous> (index.js:26:25)
Seems to have attempted to fetch sets for gen8randombattlenodmax and gen8randombattleblitz, which shouldn't be the case (should've been gen8randombattle only). Since the error exists in the console (again, it should've failed silently by loading in the Pokémon w/o any sets), that indicates some kind of fatal error, which may explain why no Pokémon show up in the first place.

I'll take a closer look into this. Thanks again!
 
So I checked to see if it was implemented and it was not. Terestialzation boosts (almost) any non priority/milti-hit move that are below 60bp, after modifiers, to 60bp. That means that Water Gun is 60, Nuzzle with or without Charge becomes 60, and Earthquake in Grassy Terain becomes 60: https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9425737

One other thing is I found while testing is that the add-on is causing Fire Fox beta on Android to break the page after 20-30 seconds in battle. Sprites continues to move and clicking the calcdex button animates, but everything else becomes unresponsive. I couldn't select any moves, open the chat, select anything in the calculator, anything. It also hangs waiting for the opponent to select their move if it was that part of the battle. The only thing I could do was click the main/home button, and that reloaded the page. There was no problem watching other players with the calcdex open. It worked weeks ago (the last time i posted here), but even turning off all other add-ons it doesn't work anymore.
 
Saw your post with the error message and yeah, that was because the battle was Gen 9 (which unfortunately isn't the cause of the non-downloading sets). But the Gen 9 update is out now so feel free to try it out and let me know how that goes!

My other suspicion (since your OS/browser/version seems nominal) is that you may have some other extension that is blocking access to pkmn.github.io. Can you try enabling Showdex on Incognito (without enabling any other extensions) to see if that works?

View attachment 475829
The sets load now btw, not sure what changed but ty
 
Anyone can explain to me please what i am missing here (in the image below). Because the damage of Flower Trick was 38.9% and is not Life Orb damage since Mewoscarada not lost hp (so it can only be Choice Band), and the Showdex says the damage on toxtricity is 48.6% to 57.5%.

.
 
Last edited:
Anyone can explain to me please what i am missing here (in the image below). Because the damage of Flower Trick was 38.9% and is not life orb damage since Mewoscarada not lost hp (so it can only be Choice Band), and the Showdex says the damage on toxtricity is 48.6% to 57.5%.

.
i believe you have clicked the tera button for meowscarada, when it has not terastalized
 
Anyone can explain to me please what i am missing here (in the image below). Because the damage of Flower Trick was 38.9% and is not Life Orb damage since Mewoscarada not lost hp (so it can only be Choice Band), and the Showdex says the damage on toxtricity is 48.6% to 57.5%.

.
This is a good catch actually, thanks for bringing it to our attention! As ry4242 said, it's due to "Tera" being activated, and it's actually a bug with detecting Tera with the Protean ability. We realized that since they both use the "typeChange" property, we have to do some extra work to make sure we distinguish Protean type-changing from Tera type-changing. Essentially, thanks for finding this bug for us, and we'll put out a fix for it in the next patch :) in the meantime you'll have to turn the tera off manually, sorry about that!
 
So I checked to see if it was implemented and it was not. Terestialzation boosts (almost) any non priority/milti-hit move that are below 60bp, after modifiers, to 60bp. That means that Water Gun is 60, Nuzzle with or without Charge becomes 60, and Earthquake in Grassy Terain becomes 60: https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9425737

One other thing is I found while testing is that the add-on is causing Fire Fox beta on Android to break the page after 20-30 seconds in battle. Sprites continues to move and clicking the calcdex button animates, but everything else becomes unresponsive. I couldn't select any moves, open the chat, select anything in the calculator, anything. It also hangs waiting for the opponent to select their move if it was that part of the battle. The only thing I could do was click the main/home button, and that reloaded the page. There was no problem watching other players with the calcdex open. It worked weeks ago (the last time i posted here), but even turning off all other add-ons it doesn't work anymore.
Ah, the 60 BP boost seems like an issue with the mechanics that should be addressed by calc.ps team. Whenever they implement this, I'll go ahead and update Showdex's version of calc.ps.

Yikes, we were literally like (before deploying v1.1.0) should we test this on Android? Maybe we should've, but we wanted to get Gen 9 out ASAP for the majority of users. We'll look into this though for the next patch, thanks!
 
In the conventional calculator https://calc.pokemonshowdown.com/ there is the option of hazard (Stealth Rock, Steelsurge and Spikes). Will there be this in the showdex as well? it would be nice to have this automatically so that you can see, before switching in, how many hits you can survive after hazard damage.
 
In the conventional calculator https://calc.pokemonshowdown.com/ there is the option of hazard (Stealth Rock, Steelsurge and Spikes). Will there be this in the showdex as well? it would be nice to have this automatically so that you can see, before switching in, how many hits you can survive after hazard damage.
Currently it actually does account for hazard damage if that's what you're asking! So if you hover over the damage % numbers, it'll say like "25 - 35% damage after Stealth Rock damage", which lets you know that it's taking the hazard damage into account (this only applies to mon that aren't currently on the field, as obviously you only take hazard damage when you switch in). It detects the hazards automatically from the battle state, but we currently don't have a toggle/indication for it in the UI, as we were really limited in space. Eventually we might try to figure out a way to display it/allow you to toggle it manually.
 
One other thing. Would it be possible to add a feature that makes the calculator always open on the left? Because in the battles in battle options there is the option "Open new battles on the right side". I wanted it to be in the left corner so I didn't have to drag it every time.

Is this already possible and I didn't see it, or could it be a feature to be implemented?

The layout I liked looks like this:

 
One other thing. Would it be possible to add a feature that makes the calculator always open on the left? Because in the battles in battle options there is the option "Open new battles on the right side". I wanted it to be in the left corner so I didn't have to drag it every time.

Is this already possible and I didn't see it, or could it be a feature to be implemented?

The layout I liked looks like this:

Sure, this is something that can be done!

Something to be aware of though is that Showdown's page URL is dependent on the active panel on the left (which would've normally been the battle), so when the Calcdex opens on the left, the page URL becomes the room ID of the Calcdex's panel. Refreshing the page will reopen the Calcdex's panel, but will show an error saying that the room doesn't exist since there's no battle, hence no Calcdex. (Normally, when the battle is on the left, refreshing the page would initialize the battle since the page URL corresponds to the battle's ID, causing the Calcdex to initialize after.) This is something that should be addressed on Showdown's end though.

That being said, this isn't a big deal if you don't find yourself refreshing the page mid-battle that often. Just a heads up.

We'll include this as a setting with the next patch, most likely with 3 options:
  • Auto (default) – Left/Right depending on the Open new battles on the right side battle option,
  • Left – Always force the Calcdex to open on the left, and
  • Right – Always force the Calcdex to open on the right.
Thanks for the suggestion!
 

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

Top