• 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

Alakazam

Hey there, Delilah
is a member of the Site Staffis a Forum Moderatoris a Contributor to Smogon
Moderator
^ would like to add on to this, 1v1 as well lost all of our Gen 7 sets on calc that were published Gen 7, which is kind of crazy considering how important the extremely specific EVs of each set are for making accurate plays in the metagame. Gen 7 will be entering 1v1 Old Gens soon, and the support of the calc would be extremely beneficial for future 1v1 Classics and Old Gen tournaments. Don't want to reiterate, but there doesn't seem to be a reason at all to remove any of these old analyses, and I can't wait until this issue is resolved
 

pre

shaving yaks and herding cats
is a Battle Simulator Administratoris a Programmeris a Super Moderator
Builder
Removal of old gen sets for these metagames was a deliberate decision by Honko: https://github.com/smogon/damage-calc/issues/343#issuecomment-521694883. "...Balanced Hackmons, Monotype, 1v1, and CAP. The last four are only whitelisted for the current gen."

I see no problem including sets for old metagames with a new calc design where sets are lazily loaded on demand, but I am not a fan of forcing all users to download large amounts of super niche sets that they'll never use with the current architecture. At least in the short term I'm OK with extending the whitelist to include Gen 7 as well during this transitional period, but will draw the line at supporting generations further back than that until the calculator has been redesigned.
 

Eien

is a Tutoris a member of the Site Staffis an official Team Rateris a Battle Simulator Administratoris a Super Moderatoris a Community Contributoris a Tiering Contributoris a Top Contributoris a Smogon Media Contributor
Monotype Leader
Removal of old gen sets for these metagames was a deliberate decision by Honko: https://github.com/smogon/damage-calc/issues/343#issuecomment-521694883. "...Balanced Hackmons, Monotype, 1v1, and CAP. The last four are only whitelisted for the current gen."

I see no problem including sets for old metagames with a new calc design where sets are lazily loaded on demand, but I am not a fan of forcing all users to download large amounts of super niche sets that they'll never use with the current architecture. At least in the short term I'm OK with extending the whitelist to include Gen 7 as well during this transitional period, but will draw the line at supporting generations further back than that until the calculator has been redesigned.
Monotype is literally an official tier and one of the largest communities on Smogon and PS. We also have one of the largest ladder usages amongst Smogon tiers as well. I completely disagree with the idea that we are “super niche” compared to certain metagames on the list that aren’t limited. This is a breaking change for our community.
 
Couldn't agree more with TDA. I really want to expand on the importance of the calc for 1v1 specifically. In this metagame, matchups are key as the battles are won and lost based on them and them alone. For new players, knowing what they have to EV to either live or beat is crucial for creativity and ease of access. We've published over 50 analyses, in part to show players what the EV benchmarks are going to be for metagame sets; this change makes it extremely inconvenient. Gen 7 is still relatively popular and playable on the ladder; as we start to head into 1v1 PL season where Gen 7 1v1 will play a major competitive role, we strongly urge the readdition of these sets until the new calc is released.
 
Hey, guys, I reported this to the Bug Reports thread here, but I just wanted to let you know that the Damage Calculator is down at the moment. No one can select anything on it right now.

Edit: It appears some users are able to still use the Damage Calculator, and some are not able to use it. Apologies for misrepresenting the problem at first. I'm investigating what I can right now.

Additional Edit: This is what I could determine. For me, I cannot select any Pokémon in the Sword and Shield part of the Damage Calculator. All other Gens appear to be fine for me to select Pokémon, but in terms of generating damage calculations, it is coming up with a "Loading ??? - ???" message where each calc would normally be. Additionally, I'm not sure if this is related, but if I switch between an older Gen and the S/S current Gen calcs, in S/S it shows a much smaller text box where I would be able to manually type in a set (as opposed to just select a set from the scroll-down menu options). Unfortunately, my coding knowledge is not extensive, so I certainly won't guess as to what the issue could be. I do know that I'm not alone in experiencing this issue though.

For additional information to hopefully help resolve this issue...
-I'm using Safari as a browser (as was another user who confirmed experiencing this same issue), but a few other users have reached out to me saying that they have used the Damage Calculator on Safari successfully soon after I posted this message here.
-I have had no other known issues with my Safari browser recently or today.
-I'm on a Mac computer.
 
Last edited:
Hi, I was asked by the Help Chat to post here.

I wanted to calculate EVs for my pokemon but on lvl 50. As far as I know I get 1 stat point for exactly 8 EV points. When I have less than 8, it grants 0 stat points.

So I took Wash-Rotom and set the HP EVs to 172 (which is 21.5 when divided by 8). I thought it should give 21 extra HP but the calculator showed 22.

So my question is: Is the rounding wrong or is my assumption wrong?


Granted points should be something like:

C++:
//stat bonus calculation:
//to explain the code (which I think it does itself):
//floor is the rounding down function no matter what
// getHPEVs is a sample function to get EVs. Could have used an enum for the type but meh. We don't have coding lessons here. ;)
// multiply by 0.25 is the same as dividing by 4 (4 EV points are one stat point) but faster.
// then we have a factor that uses the quotient of the current level and the max level. 
// I hope I don't have to say that getCurrentLvl and getMaxLvl should return doubles/floats
int bonus = (int)floor( getHPEVs() * 0.25 * (getCurrentLvl() / getMaxLvl()) );
 
Last edited:

Cheese5555

too cheesy
Hi, I was asked by the Help Chat to post here.

I wanted to calculate EVs for my pokemon but on lvl 50. As far as I know I get 1 stat point for exactly 8 EV points. When I have less than 8, it grants 0 stat points.

So I took Wash-Rotom and set the HP EVs to 172 (which is 21.5 when divided by 8). I thought it should give 21 extra HP but the calculator showed 22.

So my question is: Is the rounding wrong or is my assumption wrong?


Granted points should be something like:

C++:
//stat bonus calculation:
//to explain the code (which I think it does itself):
//floor is the rounding down function no matter what
// getHPEVs is a sample function to get EVs. Could have used an enum for the type but meh. We don't have coding lessons here. ;)
// multiply by 0.25 is the same as dividing by 4 (4 EV points are one stat point) but faster.
// then we have a factor that uses the quotient of the current level and the max level.
// I hope I don't have to say that getCurrentLvl and getMaxLvl should return doubles/floats
int bonus = (int)floor( getHPEVs() * 0.25 * (getCurrentLvl() / getMaxLvl()) );
if you have an odd iv number then the first 4 evs increase the stat by one, and then every 8 from then on. if you have even iv then it works as you described it. this is because at level 50 the sum of the ev/4 and the ivs are divided by two and then floored. (you can read more at https://www.smogon.com/dp/articles/mechanics_level50 or https://bulbapedia.bulbagarden.net/wiki/Statistic#Formula)
 
For the Sword/Shield Smogon Analysis link, the URL comes out to 'https://smogon.com/dex/undefined/pokemon/abomasnow/', which should probably be SS (it works for SM analyses).
Tried this on Edge & Firefox.

Edit: gonna made a branch on github to see if I can try & fix this
Edit: lack permission to push up to a branch (and also getting errors when I try and run it locally) so whoever can should just have to change smogonAnalysis() function in shared_analysis.js to:
JavaScript:
function smogonAnalysis(pokemonName) {
    var generation = ["rb", "gs", "rs", "dp", "bw", "xy", "sm", "ss"][gen - 1];
    return "https://smogon.com/dex/" + generation + "/pokemon/" + pokemonName.toLowerCase() + "/";
}
 
Last edited:
I noticed Body Press isn't calculating properly. Its using the attack stat rather than your defense stat to calculate damage. I know you guys are still very much updating for gen 8 but I thought I'd leave a notice just in case it was overlooked.
 

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

Top