TL;DR - App: App Link, skip to Part 3 for usage tips.
Disclaimer: Many of the examples used in this forum post will be focused on the ADV OU metagame. The principles may apply to other metagames. However, the code (as of now) is only geared towards the Gen 3 experience. Functionality for other generations may be added in the future.
In the famous words of the great BKC from his hit 2026 video DPP OU’s Sleep Ban & The Future of Breloom : “since 2026 started, I have not really felt like cranking it.” I think about those words a lot. But more to the point of this post, I think about an older BKC quote, from his 2019 video Analysis + Pokémon Showdown Live: The ADV OU Regice Experiment : “the bulk has to be doing something”. Sometimes, I question whether as teambuilders we internalize this challenge nearly as much as we ought to. There are plenty of possible Pokemon spreads sitting just 4 EVs away from key defensive benchmarks—e.g. eliminating the chance to be OHKOed by a given move. Now, the mathematician in me can’t help but wonder: have we done enough to optimize our Pokemon’s investment? What if we could reconfigure a little bit to achieve the same benchmarks and spare a handful of EVs to break some pesky Speed ties? These are the questions that make me want to crank it—and by it, I mean the calculator.
The Pokemon Damage Calculator (AKA “the Damage Calc”, or simply "the calc") is one of the most convenient tools available for assisting with the competitive Pokemon decision-making process. It is a major help in battles, but it’s similarly useful for teambuilding. Take Tyranitar: using the calc will show that 252 HP investment is enough to survive a Metagross Meteor Mash, a +1 Salamence Earthquake, or even an opposing Tyranitar’s Brick Break (at least 93.8% of the time). That makes set optimization fairly accessible to those who are the least bit curious what their Pokemon are capable of. Beyond the physical side, 252 HP also clears a surprising variety of Special benchmarks. Timid Starmie’s Hydro Pump, Modest Suicune’s Hydro Pump, and Torrent-boosted Hydro Pump from Swampert are all able to be eaten up to allow Tyranitar to trade damage should the situation call for it. Okay, maybe the variety was overstated, but the point still stands that 252 HP is a great catch-all amount of investment for a standard bulky Tyranitar to strive for. Though, I’m not sure if Tyranitar is capable of surviving an Earthquake from Adamant Dugtrio if it only has 252 HP. Or what if Starmie was Modest instead of Timid? And can I manage to live one more Surf from Swampert with just a few more EVs? These thoughts naturally creep up through the course of experiencing hundreds of repeated interactions. So, I like to go into the calc to find out how much more investment it would take to get to such-and-such benchmark. And I would do this over and over and over until I had way too many niche benchmarks floating around in my head. (With only 148 additional SpD EVs, the standard 252 HP Tyranitar will survive a max roll Mystic Water-boosted Modest Starmie’s Hydro Pump, by the way.) I got tired of writing them down or re-calculating them, so I thought about another piece of advice that was given to me by an old friend (who is decidedly not BKC): “if you’re going to do something more than once, you should probably automate it.” So, to save myself hours in the calc—and to save the less hyper-fixated among you a couple minutes—I decided to try my hand at a coding project. The premise…
What is the smallest amount of defensive investment that a given Pokemon needs in order to live a given attack?
Part 1: HP or Def?
It may not be immediately obvious what the difference between HP and Def is. To some degree, it is true that more HP means a Pokemon can live more hits. Though, more Def also means a Pokemon can live more hits. However, there is a bit more nuance that makes the stats distinct. Think about the defending Pokemon as a field of crops. An attack on the defending Pokemon acts like a swarm of locusts coming to eat the crops. If your Pokemon has a lot of Def, that’s like the crops making it hard for the locusts to chew through them. Each locust can only gnaw so deep, so the swarm can only clear so many of the crops as compared to a field with softer crops. If your Pokemon has a lot of HP, that’s like the field being very large and having loads of crops. The locusts might be able to chew through tons of them very quickly, but the field is too large for the locusts to have made a significant dent. To be more literal, high Def means a Pokemon takes less damage while high HP means that the damage that has been taken is a lower percentage of the Pokemon’s total health pool.
I have seen in a handful of competitive spaces where novice players congregate a seemingly simple question: “Is it better to invest in HP or Def?” There is a fairly common rule of thumb that gets repeated in response to this inquiry: “Invest in the lower stat”, but I don’t think some of the players who parrot this quite understand what exactly is meant by this advice or why exactly it works. As an exercise to build intuition about how defensive investment affects damage calculation, let’s look at a couple examples. For the sake of simplicity, let’s use Metagross’s Earthquake on a couple unfortunate punching bags for the sake of demonstration.
Example 1: Blissey
Blissey has extremely lopsided defensive base stats. It has a gargantuan 255 base HP—the highest in the generation and seemingly for all future generations to come. The tradeoff is that Blissey’s base Def is a pitiful 10. Even Feebas, one of the frailest Pokemon ever conceived, has a base Def stat that exceeds Blissey by twofold—an impressive base 20. Hence, Blissey exists as one of the vastest fields with some of the most paper-thin crops. One might naively assume that this makes Blissey a completely unsalvageable Pokemon in the matchup vs physical attackers, and this would all but be confirmed if you saw just how much damage Metagross slams Blissey with while limited to clicking its third-strongest neutral attack:
252+ Atk Metagross Earthquake vs. 0 HP / 0 Def Blissey: 517-609 (79.4 - 93.5%) -- guaranteed 2HKO after Leftovers recovery
(Now that’s a lot of damage!)
Though, it seems a bit unfair that Metagross is allowed to invest entirely into its offenses while Blissey is as untrained as a day-one Jiu Jitsu white belt. For the sake of fairness, Blissey can allocate 252 EVs to make her bulk a little bit better for withstanding the metal monster.
I think a lot of new players would blindly believe that the best way to train a Pokemon is to go all-in on the strengths and leave the weaknesses to the side. This works well enough for offensive Pokemon—Breloom is a lot more effective when it goes all-in on physical attacks than when it goes all-in on special ones. The calculator will surely elucidate for us just how impregnable a fully HP-invested Blissey can be.
252+ Atk Metagross Earthquake vs. 252 HP / 0 Def Blissey: 517-609 (72.4 - 85.2%) -- guaranteed 2HKO after Leftovers recovery
Huh. Blissey couldn’t even lob off 10 percentage points of damage even with maximal investment. It just might be over for Blissey as a physical wall… Well, for the heck of it, let’s see what happens if we shift those EVs over to Blissey’s miserable Def stat.
252+ Atk Metagross Earthquake vs. 0 HP / 252 Def Blissey: 243-287 (37.3 - 44%) -- 99.9% chance to 3HKO after Leftovers recovery
No way! That can’t be right. Just by choosing to put the EVs in a different spot, Blissey is all of a sudden taking half as much damage?
Here’s why: those 252 EVs are buying two very different things depending on where they are allotted. Keep in mind that every 4 EVs amounts to 1 stat point. Hence, 252 EVs correlates to 63 stat points. As such, when we allot these 63 points into Blissey’s HP, we bump it up from 651 to 714. Basically, we have made the field about 10% bigger. However, if we allot the points to Def, we jump from 56 to 119. Effectively, that makes the crops more than twice as tough! Hence, every physical hit dealt to Blissey deals less than half of the damage.
If you’re interested in the exact mechanism, here is the relevant piece of the damage formula:
I have cut out all of the conditional parameters such as STAB, type effectiveness, Flash Fire, damage-doubling conditions such as Pursuit on a switch-out, and whether or not the attack was used on a US holiday. These multiplicative effects will not change how EV investment scales the result. The formula has Defense in the denominator. It makes sense that doubling Def would roughly translate to halving damage. Blissey presents the most blatant case of demonstrating this since its natural Def is so low that 63 stat points of investment would roughly double its total Def. On the flipside, 63 points is not that much when compared to Blissey’s ludicrously high natural HP. This example therefore motivates the logic behind the “invest in the lower stat” rule of thumb. It serves as a shorthand for the idea that one should invest where 252 EVs buys the biggest percentage increase in stats.
Example 2: Steelix
Steelix, despite being a less-represented member of the ADV OU metagame, highlights the opposite case from Blissey. Its base Def of 200 dwarfs its base HP of 75. Following the same logic as before, we’d expect that Steelix would want to invest in its HP. Let’s check the baseline first.
252+ Atk Metagross Earthquake vs. 0 HP / 0 Def Steelix: 136-160 (46.7 - 54.9%) -- 66.8% chance to 2HKO
Not bad considering that Steelix is weak to Ground. Now let’s max out Def—which we expect will matter less than HP—to see what the result is.
252+ Atk Metagross Earthquake vs. 0 HP / 252 Def Steelix: 119-140 (40.8 - 48.1%) -- guaranteed 3HKO
That’s good enough to avoid a chance for a 2HKO, but now let’s see what happens if we shift all of the investment to HP:
252+ Atk Metagross Earthquake vs. 252 HP / 0 Def Steelix: 136-160 (38.4 - 45.1%) -- guaranteed 3HKO
Unsurprisingly, HP wins out. The rule seems to work. However, note how much closer the comparison was this time. 63 stat points take Steelix’s Def from 436 to 499, which is about a 14% increase. On the other hand, 63 points increases HP from 291 to 354, which is a 22% increase. Compared to Blissey, whose Def more than doubled while its HP barely moved, Steelix’s difference is pretty modest. The rule of thumb still points in the right direction, but it doesn’t necessarily give much intuition about how much of a difference to expect.
Natures
An element of the damage calculation that I have yet to factor in is nature. Every stat, other than HP, can be boosted or hindered by a nature. A positive nature adds 10% to a stat while a negative nature subtracts 10% from a stat.
Since Steelix’s Def is naturally massive, a +Def nature will give an absolutely huge boost. You might be tempted to assume that this would give Steelix a much bigger advantage than a similar nature would to the fragile Def of Blissey. Let’s compare based on the 252 HP / 0 Def calculations from the previous section:
252+ Atk Metagross Earthquake vs. 252 HP / 0+ Def Steelix: 124-146 (35 - 41.2%) -- 69.4% chance to 3HKO after Leftovers recovery (about 9% less damage as compared to 252 HP / 0 Def Steelix)
252+ Atk Metagross Earthquake vs. 252 HP / 0+ Def Blissey: 475-559 (66.5 - 78.2%) -- guaranteed 2HKO after Leftovers recovery (about 9% less damage as compared to 252 HP / 0 Def Blissey)
The damage reduction is the same. That’s because nature is multiplicative. Moreover, Def is in the denominator of the damage formula. Therefore, a 10% boost to Def will result in roughly a 9% cut to damage regardless of whether the baseline Def is 56 or 436. The absolute size of the boost—a handful of points for Blissey and dozens of points for Steelix—doesn’t really matter; only the percentage does, which is the same for every Pokemon so long as both Pokemon have the same nature.
You may have heard that the positive effect of a nature should go towards a Pokemon’s highest stat. That’s solid advice if you’re optimizing raw stat totals, but don’t mistake it for meaning that a + nature helps a high-Def Pokemon more than a low-Def Pokemon in terms of taking less percentage damage. The damage is reduced by 9% regardless.
So far, we have only examined situations where one particular attack has been involved. That makes the decision for where to invest very simple: either invest in HP or Def (or SpD if the attack was special). In these single-attack cases, the rule of thumb will point you in the right direction. This can also be easily verified using the Damage Calc. Practical teambuilding is rarely this simple, however. A Pokemon usually needs to survive a mixture of physical and special attacks. Having to consider both sides at the same time complicates our calculations. HP widens the field against both physical and special locusts, but Def and SpD only toughen the crops against their own type of swarm. Though, all three stats are pulling from the same limited pool of EVs. How do we determine if widening the field is worth more than stopping one type of locust when both types of attacks are in play? The “rule of thumb” will only get us so far, especially when we venture beyond the extreme cases of Blissey and Steelix.
Part 2: Mixed Bulk
You’re probably familiar with Mixed Attackers. Pokemon like Salamence or Metagross can leverage their high natural Atk and SpA in conjunction with their diverse movepools to threaten physical and special walls at the same time. Mixed bulk is the defensive mirror of this idea, but it’s a trickier concept to realize without a cost. A Pokemon that is tasked with walling both sides of the physical-special split often pays for it in tempo. Mixed walls will be forced to switch into medium-damage moves, spend turns recovering (sometimes up to three for Rest users like Suicune), and often act as magnets for devastating wallbreaking moves such as Explosion. That lost tempo is repaid by role compression. Having a Pokemon that combines the defensive capabilities of two walls can afford more flexibility with the freed-up team slot.
Example A: Suicune and Swampert
Suicune and Swampert are two of the tier’s most prominent bulky Water-types thanks to a strong blend of high defensive stats and Water’s favorable type matchups (only being weak Grass and Electric). Suicune has incredible natural bulk with base 100 HP and base 115 in both Def and SpD. With access to Calm Mind to further bolster its SpD, Suicune is often best served by pumping its Def to grant itself as many turns as possible versus physical attackers to snowball its boosts before it has to Rest. For example, a Suicune spread with 240 HP / 220+ Def is capable of turning Choice Band Aerodactyl’s dangerous Double-Edge into only a chance to 4HKO—meaning Suicune can tank three max roll hits, Rest off the damage, and repeat the cycle until Aerodactyl runs out of PP (note: this is called a Rest Loop).
252 Atk 30 IVs Choice Band Aerodactyl Double-Edge vs. 240 HP / 220+ Def Suicune: 113-133 (28.1 - 33.1%) -- 88.8% chance to 4HKO after Leftovers recovery
Swampert, on the other hand, takes advantage of its secondary Ground-type to invalidate the common Rock-type coverage of many of the tier’s most potent physical attackers. However, Swampert needs to be cautious of the 4x super effective coverage of Hidden Power Grass from powerful special attackers such as Zapdos or Moltres. Swampert will often choose to invest some SpD to guarantee survival against these attacks to afford it a turn to pick off a weakened Zapdos in the late game or trade a massive Torrent-boosted Water move into Moltres.
252+ SpA 30 IVs Zapdos Hidden Power Grass vs. 240 HP / 44 SpD Swampert: 340-400 (84.7 - 99.7%) -- guaranteed 2HKO after Leftovers recovery
(The calc is the same for Modest Moltres since it shares a base 125 SpA stat with Zapdos.)
In both cases, it is observed that the bulky Waters may choose to bolster their “weak” side in order to combat the opponent’s attempts to exploit those weaknesses.
Example B: Tyranitar
Tyranitar is widely considered the best Pokemon in the ADV metagame. It boasts tremendous breaking power with its massive base 134 Atk stat, has sweeping potential after a couple Speed boosts from Dragon Dance, and can leverage its wide movepool to run mixed attacking sets. This is not to mention how much permanent sandstorm warps the tier. Beyond its offensive utility, though, Tyranitar can perform some important defensive roles for a team as well. Its defensive benchmarks, while not quite as easy-to-achieve as Suicune or Swampert’s, can allow Tyranitar to squeeze an extra turn out against some of its would-be counters. Rather than examining Tyranitar through the lens of “where does investment help its defenses the most?”, I find more practical application in “how can we most efficiently reach Tyranitar’s key defensive thresholds?” As it turns out, Metagross’s Meteor Mash and Suicune’s Hydro Pump are two of the more common attacks that Tyranitar is expected to face and barely capable of surviving at full health.
252+ Atk Metagross Meteor Mash vs. 252 HP / 0 Def Tyranitar: 341-402 (84.4 - 99.5%) -- guaranteed 2HKO after Leftovers recovery
252+ SpA Suicune Hydro Pump vs. 252 HP / 0 SpD Tyranitar: 336-396 (83.1 - 98%) -- guaranteed 2HKO after Leftovers recovery
It’s good to have identified these two attacks as being within Tyranitar’s ability to survive. However, having to commit 252 EVs just to defensive benchmarks is quite costly. Supposing that we want our Tyranitar to be as potent an offensive threat as possible—i.e. with 252 Atk or SpA EVs—we are limited to a measly 4 EVs to use in Speed. This could prove costly as Pokemon such as Swampert or opposing Tyranitar may be contributing slightly more to their Speed stat to get the jump on our Tyranitar. Without divesting from our offenses, is there a way that Tyranitar can still survive Metagross’s Meteor Mash and Suicune’s Hydro Pump while saving a few EVs for its Speed? We can start by playing with the numbers in the Damage Calc. We can see that Tyranitar will still survive Metagross’ Meteor Mash with 248 HP, saving us 4 EVs, but that’s barely enough to consistently outspeed the Swampert and opposing Tyranitar spreads that we are concerned with. Instead, I’d like to introduce a new concept that will help us to optimize Tyranitar’s defensive investment. I call it the “calibration rule”.
The calibration rule can be used when we have a specific defensive Pokemon trying to defend against a specific physical attack and a specific special attack. The rule states that the defensive Pokemon should divest from HP until it has only enough to survive the weaker of the two attacks. Then, increase the Def or SpD stat until the defending Pokemon survives the stronger attack. Let’s work through this rule using the previous example.
252+ SpA Suicune Hydro Pump vs. 224 HP / 0 SpD Tyranitar: 336-396 (84.6 - 99.7%) -- guaranteed 2HKO after Leftovers recovery
This is the lowest we can bring Tyranitar’s HP where it still survives Suicune’s Hydro Pump. Though, as anticipated, Tyranitar now faints to a Meteor Mash from Metagross.
252+ Atk Metagross Meteor Mash vs. 224 HP / 0 Def Tyranitar: 341-402 (85.8 - 101.2%) -- 12.5% chance to OHKO
While Metagross’s locust swarm is no stronger than it was before, it is capable of entirely wiping out Tyranitar’s field instead of leaving a small handful of survivors. To remedy this, we can re-invest some EVs into Tyranitar’s Def stat.
252+ Atk Metagross Meteor Mash vs. 224 HP / 16 Def Tyranitar: 336-396 (84.6 - 99.7%) -- guaranteed 2HKO after Leftovers recovery
So the total investment comes out to 224 + 16, or 240 EVs. This is less than the 252 HP that is commonly invested, or the 248 HP required to live both Meteor Mash and Hydro Pump with only HP investment. This means that we get 8-12 more EVs that we can push Tyranitar’s Speed stat forward with (as compared to the previously-established baselines). Now you won’t have to play the “guess who’s faster” game against opposing Tyranitar or Swampert anymore… Well, until all of those players read this forum post and copy this strategy…
If you can believe it, there is actually another optimization that can be made on this calibration rule spread. Consider 232 HP / 8 Def Tyranitar. This costs the same total number of defensive EVs as the 224 HP / 16 Def spread. The damage calcs are as follows:
252+ Atk Metagross Meteor Mash vs. 232 HP / 8 Def Tyranitar: 338-398 (84.7 - 99.7%) -- guaranteed 2HKO after Leftovers recovery
252+ SpA Suicune Hydro Pump vs. 232 HP / 0 SpD Tyranitar: 336-396 (84.2 - 99.2%) -- guaranteed 2HKO after Leftovers recovery
Both thresholds have been cleared. Though, in this case, we have cleared them with slightly more HP investment. As you can imagine, this makes Tyranitar slightly better against special attacks than the 224 HP / 16 Def spread. As such, we could include a caveat to the calibration rule. If a spread is reached via the calibration rule but reconfiguring the spread still allows both benchmarks to be cleared, then pick the spread that has higher HP investment (unless you have a hyper-specific reason not to). The calibration rule alone does not account for finding the “best” spread; it just finds one that will work.
All told, this is a fairly minor gap with the calibration rule. However, there is an example that highlights another limitation of the rule—a limitation that undermines the rule’s capability to find the absolute lowest investment for surviving an attack.
Suppose you want Dragon Dance Salamence to survive a 0 SpA Ice Punch from Gengar. We’ll assume that physical hits are negligible—in other words, Salamence already survives the physical hits that we want it to without any investment. The calibration rule would suggest that we climb up to 144 SpD (with 30 IVs due to HP Flying) to avoid an OHKO from max roll Ice Punch.
0 SpA Gengar Ice Punch vs. 0 HP / 144 SpD 30 IVs Salamence: 278-328 (83.9 - 99%) -- guaranteed 2HKO after Leftovers recovery
While 144 SpD clears the benchmark, it isn’t actually the cheapest way to get there. With a spread of 8 HP / 132 SpD, totaling 140 EVs, Salamence is capable of achieving the same benchmark.
0 SpA Gengar Ice Punch vs. 8 HP / 132 SpD 30 IVs Salamence: 282-332 (84.6 - 99.6%) -- guaranteed 2HKO after Leftovers recovery
What a strange result. The calibration rule only adjusts one stat at a time, so the method is blind to ways of mixing HP and SpD that might be more optimal than a pure-SpD spread on EV cost. The reason that something like this can occur goes back to something that was discussed in Part 1: damage always rounds down to the nearest whole number. This is the case for every individual damage roll. As you raise SpD, the highest damage roll does not decrease smoothly. It drops in small, discrete steps, and exactly where the next step lands depends on the precise arithmetic for that roll. Since HP does not affect the damage dealt, it can reach the required percentage threshold a different way. While the raw damage number stays the same, the bigger pool of HP means that the same damage roll translates to a lower percentage of the total health. Sometimes this is cheaper than however much it will take for SpD alone to complete the next discrete step. Because the calibration rule only adjusts one stat at a time, there is no way to verify that tweaking the HP and SpD together might reach the goal sooner than adjusting the stats separately.
Little discrepancies like this are exactly why I stopped trying to patch the calibration rule with caveat after caveat. The rule of thumb—”invest in the lower stat”—and the calibration rule are useful because they build intuition and get close to the optimal EV spread almost every time. However, getting close almost every time means that many applications of these rules will have to be checked by hand. With over 380 Pokemon, hundreds of moves, and thousands of EV combinations to check, it is horribly inefficient to have to tweak every set even after applying these rules. That’s the type of problem that should be solved by a computer that can search through possible spreads much faster than a human can. So, rather than chasing every edge case by hand, I decided to write a brute-force algorithm that can find the optimal spreads directly.
Part 3: The App (https://tetra-min-ev-survival-calc.streamlit.app/)
(Note: The app is not active 24/7 due to streamlit’s hosting policies. However, you can “wake up” the app at any time to use it. The “waking up” process should take no longer than 3 minutes. Reload the page if necessary.)
The meat of this project was building the application that allows for finding “optimal” spreads. To note, when I say “optimal”, I mean for the scenarios that you as the user will input. There may be cases that you have not considered that will exploit a weakness in the spread that you get, or you may be overvaluing survival against a situation that has too high an opportunity cost for it to justify. For example, Zapdos can survive a +1 Jolly Tyranitar Rock Slide with 236 HP / 248+ Def after Sandstorm damage. This comes at the cost of specializing Zapdos for a role that it is more commonly valued for—threatening Water- and Flying-types—since the significant Def investment is marginally useful at best in serving this role. The application will not be able to decide whether scenarios such as this are worth prioritizing, so use the application at your own discretion. Beyond this point, I will focus discussion on what is seen in the application and what all of the options can do for you.
The Defender
At the very top of the application is a slider that controls the Level of the Defending and Attacking Pokemon. It can be dragged with the mouse or controlled with arrow keys for finer adjustments. Currently, there is no way to consider scenarios involving defenders and attackers that have different levels. This is because it is extremely rare to face Pokemon of different levels than your own in standard competitive play. I recommend that you perform your own calculations with the Damage Calc if you are wanting to experiment with lower-level Pokemon.
Below the “Defender” header, you can pick from any of the 386 Pokemon that are usable in the various ADV formats. You can scroll to find the Pokemon in the alphabetical dropdown list or delete the default Pokemon (i.e. Abra) and type in the Pokemon that you want to examine. When you select a Pokemon, the “Defender Ability” will change to match the abilities that the Pokemon can have. The dropdown can be selected to change the ability to any of the legal abilities of the defender. The ability selected may not always affect damage calculation (e.g. Rock Head, Pressure), but abilities that do affect damage calculation such as Thick Fat and Volt Absorb will function as they do in-game. Some modern-generation abilities may be selectable, but they will not be functional at this time—they may be functional in the future if I decide to expand this project for multiple generations.
There are three checkboxes below the ability. One says “Defender using Hidden Power?”. Selecting this will allow you to change the IVs of the HP, Def, and SpD stats since they may affect the EV calculation later (Atk/SpA/Spe do not affect the calculation and are thus not asked for). You may find this useful if, for example, you are planning to use an Aerodactyl set that has a Hidden Power Flying IV configuration that drops each of its HP, Def, and SpD to 30 IVs. Be sure to lock in your preferred Hidden Power IV configuration before running the rest of your calculations since changing it later may invalidate results that you’ve already obtained. Note that Hidden Power Flying has another IV configuration that allows it to retain 31 IVs in HP, Atk, and Def at the cost of dropping to 30 in SpA, SpD, and Spe.
The next checkbox reads “Leftovers”. This will assume that the defending Pokemon is holding Leftovers, which will add 1/16th max HP chip healing for scenarios that take place over the course of multiple turns. The final checkbox says “Sandstorm”. This will assume that permanent Sandstorm is active and apply 1/16th max HP chip damage at the end of each turn. The app resolves end-of-turn effects such as Leftovers and Sandstorm in the proper in-game order. It knows that Sandstorm damage is applied after the attack and before Leftovers. A resultant spread will only be valid if it survives the full sequence—including a final tick of Sandstorm damage.
Entry Hazards
In ADV, the only entry hazard is Spikes. Spikes can be stacked up to three layers and deal damage to any Pokemon that switches in and is not Flying-type and does not have the ability Levitate (as a shorthand: the Pokemon is “grounded”). (The damage is 1/8 max HP for one layer, 1/6 for two layers, and 1/4 for three layers.) Adding layers will factor the damage into the calculation for surviving the given scenarios.
There is a dropdown menu for “Spikes Timing”. The options are “Switch” and “Revenge”. Switch will assume that the defending Pokemon will be switching into the Spikes and immediately taking the attacks provided. Revenge will assume that the defending Pokemon will switch in after a KO has been dealt. The defender will take Spikes damage and then resolve end-of-turn effects such as Sandstorm and Leftovers. In cases where Sandstorm and Leftovers cancel out, there may not be much difference between the modes, but since Sandstorm affects much of the tier and Leftovers is the most common held item, it is a worthwhile consideration for cases when Sandstorm and Leftovers do not cancel out.
Stat Floors
The “Enable Stat Floors” checkbox allows you to input pre-allocated EVs. There may be situations where you know how much Speed or Attack that your set is required to have. You can input those stats here and use the application to verify that you have enough unassigned EVs leftover to survive the given scenario that you have presented. You can use the + and - signs to move the stats 4 EVs in either direction or delete and type in the investment that you want. If you manually type the number, click Enter afterwards to save the value. You are allowed to type in any whole number between 0 and 252, including non multiples of four, but note that stats are only incremented by every multiple of four EVs.
Additionally, Stat Floors can be assigned for HP, Def, and SpD. This may be useful if you have a particular bulk benchmark in mind that you would like to stress test against other scenarios. For example, say that you know that 8 HP / 0 Def / 188 SpD allows Salamence to survive a -1 Rock Slide from 252+ Atk Tyranitar or a 0 SpA Ice Punch from Gengar assuming that Sandstorm is active. (This is similar to the scenario from Part 2 but requires additional SpD investment to overcome the added Sandstorm damage.) Now you want to see if that spread is capable of surviving a 252+ Atk Metagross Meteor Mash and a 0 SpA Swampert Ice Beam. Input 8 HP and 188 SpD into their respective Stat Floor sections and run a new calculation. If the result doesn’t change, then both scenarios are covered by the spread that was inputted into the Stat Floor.
(It should go without saying, but if you attempt to pre-allocate more than 508 EVs, the app will not be able to return a spread.)
The Attackers
It is not required to enable either attacker—though the application is not very useful if you don’t choose at least one. Physical and special attackers are divided into their own sections. Moves that have fixed damage such as Seismic Toss and Night Shade are selectable in both sections to improve quality of life. Enabling either attacker will pull up dropdown menus for the attacker, which attack they are using, and which ability they have. Like defenders, most abilities will not affect damage calculation, but some such as Pure Power will be functional. Conditional damage-boosting abilities such as Blaze, Torrent, Overgrow, Swarm, and Guts will populate a new checkbox that asks if the ability is active—meaning the condition has been met.
There is a checkbox for adjusting the Atk or SpA IV of the attacking Pokemon in case that Pokemon is using a Hidden Power that affects these stats. (Note: Hidden Power can affect other stats, but those stats are not relevant to this calculation.) Additionally, there are checkboxes that correspond to possible held items that the Pokemon may have that will affect the damage calculation. The items will only populate if the move selected will have its damage affected. For example, a Marowak using AncientPower will have the opportunity to select among three different items: Choice Band (since AncientPower is physical), Hard Stone (since AncientPower is a Rock-type move), and Thick Club (since it is Marowak’s signature item). Choosing any one of the possible items will cause the other item checkboxes to disappear to avoid stacking otherwise unstackable damage modifiers.
If the move is a multi-hit move, a slider will appear that asks how many hits of the multi-hit will land. Any whole number from 1 to 5 is selectable.
Below the checkboxes, there will be a ticker box that asks for how many attacks are used. This corresponds to how many turns in a row an attack will land on the defending Pokemon to check the minimum invested to avoid a chance of a XHKO, where X is the number you entered (e.g. 3 checks for a spread that no longer has a chance to be 3HKO’d without crits). Leftovers and Sandstorm interactions can be considered between each of these hits depending on whether these options were selected earlier. Attack Stage corresponds to the stage of boosts that the attacking Pokemon has on their relevant attacking stat. For example, if the defending Pokemon is Salamence, you may want to set the physical attacking Pokemon’s stage to -1 to reflect Intimidate. Alternatively, if a Suicune has set up to +6 with Calm Mind, you may input that to see how much Salamence needs to survive the incoming Surf.
There is an EV slider which will set the attacking Pokemon’s investment in their attacking stat. The default is 252 but can be set to any multiple of 4 between 0 and 252. Also, the nature can be selected in a dropdown menu. The options are +, Neutral, and -. The default is +.
After all of the defender and attacker options have been configured, there are two more options. One is to allow defensive natures to be considered when calculating the optimal EV spread. The application will test defensive natures and pick whichever one minimizes total EV expenditure. The second option is to “Combine Physical + Special”. This will attempt to find a spread that allows the defender to survive the physical hit sequence and then the special hit sequence together. Right now, the code cannot cleanly handle one specific edge case: if the defender is faster and KOs the first attacker, it might take an extra tick of Sandstorm damage or Leftovers healing that cannot currently be accounted for. Because of this, I recommend that you use this feature with extra scrutiny.
Results
Clicking the Calculate button will provide a “Results” section. We’ll use the Tyranitar vs Metagross and Suicune example from Part 2 to provide an example of how the Results might look. We will assume that Tyranitar only has to survive one Meteor Mash or one Hydro Pump, no Spikes are on the field, no Stat Floors are selected, none of Tyranitar’s IVs have been affected, and defensive natures are not allowed to be assigned to Tyranitar. A screenshot of this scenario will be included below.
Sure enough, the calculator agrees with our by-hand calculation from earlier. The first result is the 232 HP / 8 Def spread that I mentioned in Part 2. The “Total Defensive Investment” has been summed to 240 EVs. Additionally, there is a skeleton of a Showdown import in case you want to copy this spread into your builder. Only information that has been given such as the item (i.e. Leftovers), ability, and calculated EVs will be reported. A nature is also reported, but it defaults to Hardy for defensively-neutral natures (Bold for +Def and Calm for +SpD). Change this nature at your own discretion, but note that natures that positively or negatively impact Def or SpD may deviate from the intended optimization of the spread.
You may notice that additional results populate. In this case, the calibration rule spread of 224 HP / 16 Def and a third spread of 208 HP / 24 Def / 8 SpD have been reported. Both of these spreads also only have a Total Defensive Investment of 240 EVs. You might decide to pick one of these spreads for specific purposes, but in general, the higher HP investment variant is preferred (as discussed in Part 2) and defaults to the top of the results.
If you have further questions, have bugs to report, want additional functionality, or want to share cool results that you found, please feel free to reply to this post. If you want to express your undying gratitude, follow me on Smogon and subscribe to my YouTube channel (https://www.youtube.com/@Tetrafolium). Shoutouts to Rainer24 for proofreading this post.
Disclaimer: Many of the examples used in this forum post will be focused on the ADV OU metagame. The principles may apply to other metagames. However, the code (as of now) is only geared towards the Gen 3 experience. Functionality for other generations may be added in the future.
In the famous words of the great BKC from his hit 2026 video DPP OU’s Sleep Ban & The Future of Breloom : “since 2026 started, I have not really felt like cranking it.” I think about those words a lot. But more to the point of this post, I think about an older BKC quote, from his 2019 video Analysis + Pokémon Showdown Live: The ADV OU Regice Experiment : “the bulk has to be doing something”. Sometimes, I question whether as teambuilders we internalize this challenge nearly as much as we ought to. There are plenty of possible Pokemon spreads sitting just 4 EVs away from key defensive benchmarks—e.g. eliminating the chance to be OHKOed by a given move. Now, the mathematician in me can’t help but wonder: have we done enough to optimize our Pokemon’s investment? What if we could reconfigure a little bit to achieve the same benchmarks and spare a handful of EVs to break some pesky Speed ties? These are the questions that make me want to crank it—and by it, I mean the calculator.
The Pokemon Damage Calculator (AKA “the Damage Calc”, or simply "the calc") is one of the most convenient tools available for assisting with the competitive Pokemon decision-making process. It is a major help in battles, but it’s similarly useful for teambuilding. Take Tyranitar: using the calc will show that 252 HP investment is enough to survive a Metagross Meteor Mash, a +1 Salamence Earthquake, or even an opposing Tyranitar’s Brick Break (at least 93.8% of the time). That makes set optimization fairly accessible to those who are the least bit curious what their Pokemon are capable of. Beyond the physical side, 252 HP also clears a surprising variety of Special benchmarks. Timid Starmie’s Hydro Pump, Modest Suicune’s Hydro Pump, and Torrent-boosted Hydro Pump from Swampert are all able to be eaten up to allow Tyranitar to trade damage should the situation call for it. Okay, maybe the variety was overstated, but the point still stands that 252 HP is a great catch-all amount of investment for a standard bulky Tyranitar to strive for. Though, I’m not sure if Tyranitar is capable of surviving an Earthquake from Adamant Dugtrio if it only has 252 HP. Or what if Starmie was Modest instead of Timid? And can I manage to live one more Surf from Swampert with just a few more EVs? These thoughts naturally creep up through the course of experiencing hundreds of repeated interactions. So, I like to go into the calc to find out how much more investment it would take to get to such-and-such benchmark. And I would do this over and over and over until I had way too many niche benchmarks floating around in my head. (With only 148 additional SpD EVs, the standard 252 HP Tyranitar will survive a max roll Mystic Water-boosted Modest Starmie’s Hydro Pump, by the way.) I got tired of writing them down or re-calculating them, so I thought about another piece of advice that was given to me by an old friend (who is decidedly not BKC): “if you’re going to do something more than once, you should probably automate it.” So, to save myself hours in the calc—and to save the less hyper-fixated among you a couple minutes—I decided to try my hand at a coding project. The premise…
What is the smallest amount of defensive investment that a given Pokemon needs in order to live a given attack?
Part 1: HP or Def?
It may not be immediately obvious what the difference between HP and Def is. To some degree, it is true that more HP means a Pokemon can live more hits. Though, more Def also means a Pokemon can live more hits. However, there is a bit more nuance that makes the stats distinct. Think about the defending Pokemon as a field of crops. An attack on the defending Pokemon acts like a swarm of locusts coming to eat the crops. If your Pokemon has a lot of Def, that’s like the crops making it hard for the locusts to chew through them. Each locust can only gnaw so deep, so the swarm can only clear so many of the crops as compared to a field with softer crops. If your Pokemon has a lot of HP, that’s like the field being very large and having loads of crops. The locusts might be able to chew through tons of them very quickly, but the field is too large for the locusts to have made a significant dent. To be more literal, high Def means a Pokemon takes less damage while high HP means that the damage that has been taken is a lower percentage of the Pokemon’s total health pool.
I have seen in a handful of competitive spaces where novice players congregate a seemingly simple question: “Is it better to invest in HP or Def?” There is a fairly common rule of thumb that gets repeated in response to this inquiry: “Invest in the lower stat”, but I don’t think some of the players who parrot this quite understand what exactly is meant by this advice or why exactly it works. As an exercise to build intuition about how defensive investment affects damage calculation, let’s look at a couple examples. For the sake of simplicity, let’s use Metagross’s Earthquake on a couple unfortunate punching bags for the sake of demonstration.
Example 1: Blissey
Blissey has extremely lopsided defensive base stats. It has a gargantuan 255 base HP—the highest in the generation and seemingly for all future generations to come. The tradeoff is that Blissey’s base Def is a pitiful 10. Even Feebas, one of the frailest Pokemon ever conceived, has a base Def stat that exceeds Blissey by twofold—an impressive base 20. Hence, Blissey exists as one of the vastest fields with some of the most paper-thin crops. One might naively assume that this makes Blissey a completely unsalvageable Pokemon in the matchup vs physical attackers, and this would all but be confirmed if you saw just how much damage Metagross slams Blissey with while limited to clicking its third-strongest neutral attack:
252+ Atk Metagross Earthquake vs. 0 HP / 0 Def Blissey: 517-609 (79.4 - 93.5%) -- guaranteed 2HKO after Leftovers recovery
(Now that’s a lot of damage!)
Though, it seems a bit unfair that Metagross is allowed to invest entirely into its offenses while Blissey is as untrained as a day-one Jiu Jitsu white belt. For the sake of fairness, Blissey can allocate 252 EVs to make her bulk a little bit better for withstanding the metal monster.
I think a lot of new players would blindly believe that the best way to train a Pokemon is to go all-in on the strengths and leave the weaknesses to the side. This works well enough for offensive Pokemon—Breloom is a lot more effective when it goes all-in on physical attacks than when it goes all-in on special ones. The calculator will surely elucidate for us just how impregnable a fully HP-invested Blissey can be.
252+ Atk Metagross Earthquake vs. 252 HP / 0 Def Blissey: 517-609 (72.4 - 85.2%) -- guaranteed 2HKO after Leftovers recovery
Huh. Blissey couldn’t even lob off 10 percentage points of damage even with maximal investment. It just might be over for Blissey as a physical wall… Well, for the heck of it, let’s see what happens if we shift those EVs over to Blissey’s miserable Def stat.
252+ Atk Metagross Earthquake vs. 0 HP / 252 Def Blissey: 243-287 (37.3 - 44%) -- 99.9% chance to 3HKO after Leftovers recovery
No way! That can’t be right. Just by choosing to put the EVs in a different spot, Blissey is all of a sudden taking half as much damage?
Here’s why: those 252 EVs are buying two very different things depending on where they are allotted. Keep in mind that every 4 EVs amounts to 1 stat point. Hence, 252 EVs correlates to 63 stat points. As such, when we allot these 63 points into Blissey’s HP, we bump it up from 651 to 714. Basically, we have made the field about 10% bigger. However, if we allot the points to Def, we jump from 56 to 119. Effectively, that makes the crops more than twice as tough! Hence, every physical hit dealt to Blissey deals less than half of the damage.
If you’re interested in the exact mechanism, here is the relevant piece of the damage formula:
L = Level of the attacking Pokemon
BP = Base Power of the attacking move
A = Attack or Special Attack stat of the attacking Pokemon
D = Defense or Special Defense stat of the defending Pokemon
Damage
Note that damage rounds down to the nearest whole number but can never be less than 1.
BP = Base Power of the attacking move
A = Attack or Special Attack stat of the attacking Pokemon
D = Defense or Special Defense stat of the defending Pokemon
Damage
L=100 assumes the attacking Pokemon is Level 100 and simplifies the formula accordingly.Note that damage rounds down to the nearest whole number but can never be less than 1.
I have cut out all of the conditional parameters such as STAB, type effectiveness, Flash Fire, damage-doubling conditions such as Pursuit on a switch-out, and whether or not the attack was used on a US holiday. These multiplicative effects will not change how EV investment scales the result. The formula has Defense in the denominator. It makes sense that doubling Def would roughly translate to halving damage. Blissey presents the most blatant case of demonstrating this since its natural Def is so low that 63 stat points of investment would roughly double its total Def. On the flipside, 63 points is not that much when compared to Blissey’s ludicrously high natural HP. This example therefore motivates the logic behind the “invest in the lower stat” rule of thumb. It serves as a shorthand for the idea that one should invest where 252 EVs buys the biggest percentage increase in stats.
Example 2: Steelix
Steelix, despite being a less-represented member of the ADV OU metagame, highlights the opposite case from Blissey. Its base Def of 200 dwarfs its base HP of 75. Following the same logic as before, we’d expect that Steelix would want to invest in its HP. Let’s check the baseline first.
252+ Atk Metagross Earthquake vs. 0 HP / 0 Def Steelix: 136-160 (46.7 - 54.9%) -- 66.8% chance to 2HKO
Not bad considering that Steelix is weak to Ground. Now let’s max out Def—which we expect will matter less than HP—to see what the result is.
252+ Atk Metagross Earthquake vs. 0 HP / 252 Def Steelix: 119-140 (40.8 - 48.1%) -- guaranteed 3HKO
That’s good enough to avoid a chance for a 2HKO, but now let’s see what happens if we shift all of the investment to HP:
252+ Atk Metagross Earthquake vs. 252 HP / 0 Def Steelix: 136-160 (38.4 - 45.1%) -- guaranteed 3HKO
Unsurprisingly, HP wins out. The rule seems to work. However, note how much closer the comparison was this time. 63 stat points take Steelix’s Def from 436 to 499, which is about a 14% increase. On the other hand, 63 points increases HP from 291 to 354, which is a 22% increase. Compared to Blissey, whose Def more than doubled while its HP barely moved, Steelix’s difference is pretty modest. The rule of thumb still points in the right direction, but it doesn’t necessarily give much intuition about how much of a difference to expect.
Natures
An element of the damage calculation that I have yet to factor in is nature. Every stat, other than HP, can be boosted or hindered by a nature. A positive nature adds 10% to a stat while a negative nature subtracts 10% from a stat.
Since Steelix’s Def is naturally massive, a +Def nature will give an absolutely huge boost. You might be tempted to assume that this would give Steelix a much bigger advantage than a similar nature would to the fragile Def of Blissey. Let’s compare based on the 252 HP / 0 Def calculations from the previous section:
252+ Atk Metagross Earthquake vs. 252 HP / 0+ Def Steelix: 124-146 (35 - 41.2%) -- 69.4% chance to 3HKO after Leftovers recovery (about 9% less damage as compared to 252 HP / 0 Def Steelix)
252+ Atk Metagross Earthquake vs. 252 HP / 0+ Def Blissey: 475-559 (66.5 - 78.2%) -- guaranteed 2HKO after Leftovers recovery (about 9% less damage as compared to 252 HP / 0 Def Blissey)
The damage reduction is the same. That’s because nature is multiplicative. Moreover, Def is in the denominator of the damage formula. Therefore, a 10% boost to Def will result in roughly a 9% cut to damage regardless of whether the baseline Def is 56 or 436. The absolute size of the boost—a handful of points for Blissey and dozens of points for Steelix—doesn’t really matter; only the percentage does, which is the same for every Pokemon so long as both Pokemon have the same nature.
You may have heard that the positive effect of a nature should go towards a Pokemon’s highest stat. That’s solid advice if you’re optimizing raw stat totals, but don’t mistake it for meaning that a + nature helps a high-Def Pokemon more than a low-Def Pokemon in terms of taking less percentage damage. The damage is reduced by 9% regardless.
So far, we have only examined situations where one particular attack has been involved. That makes the decision for where to invest very simple: either invest in HP or Def (or SpD if the attack was special). In these single-attack cases, the rule of thumb will point you in the right direction. This can also be easily verified using the Damage Calc. Practical teambuilding is rarely this simple, however. A Pokemon usually needs to survive a mixture of physical and special attacks. Having to consider both sides at the same time complicates our calculations. HP widens the field against both physical and special locusts, but Def and SpD only toughen the crops against their own type of swarm. Though, all three stats are pulling from the same limited pool of EVs. How do we determine if widening the field is worth more than stopping one type of locust when both types of attacks are in play? The “rule of thumb” will only get us so far, especially when we venture beyond the extreme cases of Blissey and Steelix.
Part 2: Mixed Bulk
You’re probably familiar with Mixed Attackers. Pokemon like Salamence or Metagross can leverage their high natural Atk and SpA in conjunction with their diverse movepools to threaten physical and special walls at the same time. Mixed bulk is the defensive mirror of this idea, but it’s a trickier concept to realize without a cost. A Pokemon that is tasked with walling both sides of the physical-special split often pays for it in tempo. Mixed walls will be forced to switch into medium-damage moves, spend turns recovering (sometimes up to three for Rest users like Suicune), and often act as magnets for devastating wallbreaking moves such as Explosion. That lost tempo is repaid by role compression. Having a Pokemon that combines the defensive capabilities of two walls can afford more flexibility with the freed-up team slot.
Example A: Suicune and Swampert
Suicune and Swampert are two of the tier’s most prominent bulky Water-types thanks to a strong blend of high defensive stats and Water’s favorable type matchups (only being weak Grass and Electric). Suicune has incredible natural bulk with base 100 HP and base 115 in both Def and SpD. With access to Calm Mind to further bolster its SpD, Suicune is often best served by pumping its Def to grant itself as many turns as possible versus physical attackers to snowball its boosts before it has to Rest. For example, a Suicune spread with 240 HP / 220+ Def is capable of turning Choice Band Aerodactyl’s dangerous Double-Edge into only a chance to 4HKO—meaning Suicune can tank three max roll hits, Rest off the damage, and repeat the cycle until Aerodactyl runs out of PP (note: this is called a Rest Loop).
252 Atk 30 IVs Choice Band Aerodactyl Double-Edge vs. 240 HP / 220+ Def Suicune: 113-133 (28.1 - 33.1%) -- 88.8% chance to 4HKO after Leftovers recovery
Swampert, on the other hand, takes advantage of its secondary Ground-type to invalidate the common Rock-type coverage of many of the tier’s most potent physical attackers. However, Swampert needs to be cautious of the 4x super effective coverage of Hidden Power Grass from powerful special attackers such as Zapdos or Moltres. Swampert will often choose to invest some SpD to guarantee survival against these attacks to afford it a turn to pick off a weakened Zapdos in the late game or trade a massive Torrent-boosted Water move into Moltres.
252+ SpA 30 IVs Zapdos Hidden Power Grass vs. 240 HP / 44 SpD Swampert: 340-400 (84.7 - 99.7%) -- guaranteed 2HKO after Leftovers recovery
(The calc is the same for Modest Moltres since it shares a base 125 SpA stat with Zapdos.)
In both cases, it is observed that the bulky Waters may choose to bolster their “weak” side in order to combat the opponent’s attempts to exploit those weaknesses.
Example B: Tyranitar
Tyranitar is widely considered the best Pokemon in the ADV metagame. It boasts tremendous breaking power with its massive base 134 Atk stat, has sweeping potential after a couple Speed boosts from Dragon Dance, and can leverage its wide movepool to run mixed attacking sets. This is not to mention how much permanent sandstorm warps the tier. Beyond its offensive utility, though, Tyranitar can perform some important defensive roles for a team as well. Its defensive benchmarks, while not quite as easy-to-achieve as Suicune or Swampert’s, can allow Tyranitar to squeeze an extra turn out against some of its would-be counters. Rather than examining Tyranitar through the lens of “where does investment help its defenses the most?”, I find more practical application in “how can we most efficiently reach Tyranitar’s key defensive thresholds?” As it turns out, Metagross’s Meteor Mash and Suicune’s Hydro Pump are two of the more common attacks that Tyranitar is expected to face and barely capable of surviving at full health.
252+ Atk Metagross Meteor Mash vs. 252 HP / 0 Def Tyranitar: 341-402 (84.4 - 99.5%) -- guaranteed 2HKO after Leftovers recovery
252+ SpA Suicune Hydro Pump vs. 252 HP / 0 SpD Tyranitar: 336-396 (83.1 - 98%) -- guaranteed 2HKO after Leftovers recovery
It’s good to have identified these two attacks as being within Tyranitar’s ability to survive. However, having to commit 252 EVs just to defensive benchmarks is quite costly. Supposing that we want our Tyranitar to be as potent an offensive threat as possible—i.e. with 252 Atk or SpA EVs—we are limited to a measly 4 EVs to use in Speed. This could prove costly as Pokemon such as Swampert or opposing Tyranitar may be contributing slightly more to their Speed stat to get the jump on our Tyranitar. Without divesting from our offenses, is there a way that Tyranitar can still survive Metagross’s Meteor Mash and Suicune’s Hydro Pump while saving a few EVs for its Speed? We can start by playing with the numbers in the Damage Calc. We can see that Tyranitar will still survive Metagross’ Meteor Mash with 248 HP, saving us 4 EVs, but that’s barely enough to consistently outspeed the Swampert and opposing Tyranitar spreads that we are concerned with. Instead, I’d like to introduce a new concept that will help us to optimize Tyranitar’s defensive investment. I call it the “calibration rule”.
The calibration rule can be used when we have a specific defensive Pokemon trying to defend against a specific physical attack and a specific special attack. The rule states that the defensive Pokemon should divest from HP until it has only enough to survive the weaker of the two attacks. Then, increase the Def or SpD stat until the defending Pokemon survives the stronger attack. Let’s work through this rule using the previous example.
252+ SpA Suicune Hydro Pump vs. 224 HP / 0 SpD Tyranitar: 336-396 (84.6 - 99.7%) -- guaranteed 2HKO after Leftovers recovery
This is the lowest we can bring Tyranitar’s HP where it still survives Suicune’s Hydro Pump. Though, as anticipated, Tyranitar now faints to a Meteor Mash from Metagross.
252+ Atk Metagross Meteor Mash vs. 224 HP / 0 Def Tyranitar: 341-402 (85.8 - 101.2%) -- 12.5% chance to OHKO
While Metagross’s locust swarm is no stronger than it was before, it is capable of entirely wiping out Tyranitar’s field instead of leaving a small handful of survivors. To remedy this, we can re-invest some EVs into Tyranitar’s Def stat.
252+ Atk Metagross Meteor Mash vs. 224 HP / 16 Def Tyranitar: 336-396 (84.6 - 99.7%) -- guaranteed 2HKO after Leftovers recovery
So the total investment comes out to 224 + 16, or 240 EVs. This is less than the 252 HP that is commonly invested, or the 248 HP required to live both Meteor Mash and Hydro Pump with only HP investment. This means that we get 8-12 more EVs that we can push Tyranitar’s Speed stat forward with (as compared to the previously-established baselines). Now you won’t have to play the “guess who’s faster” game against opposing Tyranitar or Swampert anymore… Well, until all of those players read this forum post and copy this strategy…
If you can believe it, there is actually another optimization that can be made on this calibration rule spread. Consider 232 HP / 8 Def Tyranitar. This costs the same total number of defensive EVs as the 224 HP / 16 Def spread. The damage calcs are as follows:
252+ Atk Metagross Meteor Mash vs. 232 HP / 8 Def Tyranitar: 338-398 (84.7 - 99.7%) -- guaranteed 2HKO after Leftovers recovery
252+ SpA Suicune Hydro Pump vs. 232 HP / 0 SpD Tyranitar: 336-396 (84.2 - 99.2%) -- guaranteed 2HKO after Leftovers recovery
Both thresholds have been cleared. Though, in this case, we have cleared them with slightly more HP investment. As you can imagine, this makes Tyranitar slightly better against special attacks than the 224 HP / 16 Def spread. As such, we could include a caveat to the calibration rule. If a spread is reached via the calibration rule but reconfiguring the spread still allows both benchmarks to be cleared, then pick the spread that has higher HP investment (unless you have a hyper-specific reason not to). The calibration rule alone does not account for finding the “best” spread; it just finds one that will work.
All told, this is a fairly minor gap with the calibration rule. However, there is an example that highlights another limitation of the rule—a limitation that undermines the rule’s capability to find the absolute lowest investment for surviving an attack.
Suppose you want Dragon Dance Salamence to survive a 0 SpA Ice Punch from Gengar. We’ll assume that physical hits are negligible—in other words, Salamence already survives the physical hits that we want it to without any investment. The calibration rule would suggest that we climb up to 144 SpD (with 30 IVs due to HP Flying) to avoid an OHKO from max roll Ice Punch.
0 SpA Gengar Ice Punch vs. 0 HP / 144 SpD 30 IVs Salamence: 278-328 (83.9 - 99%) -- guaranteed 2HKO after Leftovers recovery
While 144 SpD clears the benchmark, it isn’t actually the cheapest way to get there. With a spread of 8 HP / 132 SpD, totaling 140 EVs, Salamence is capable of achieving the same benchmark.
0 SpA Gengar Ice Punch vs. 8 HP / 132 SpD 30 IVs Salamence: 282-332 (84.6 - 99.6%) -- guaranteed 2HKO after Leftovers recovery
What a strange result. The calibration rule only adjusts one stat at a time, so the method is blind to ways of mixing HP and SpD that might be more optimal than a pure-SpD spread on EV cost. The reason that something like this can occur goes back to something that was discussed in Part 1: damage always rounds down to the nearest whole number. This is the case for every individual damage roll. As you raise SpD, the highest damage roll does not decrease smoothly. It drops in small, discrete steps, and exactly where the next step lands depends on the precise arithmetic for that roll. Since HP does not affect the damage dealt, it can reach the required percentage threshold a different way. While the raw damage number stays the same, the bigger pool of HP means that the same damage roll translates to a lower percentage of the total health. Sometimes this is cheaper than however much it will take for SpD alone to complete the next discrete step. Because the calibration rule only adjusts one stat at a time, there is no way to verify that tweaking the HP and SpD together might reach the goal sooner than adjusting the stats separately.
Little discrepancies like this are exactly why I stopped trying to patch the calibration rule with caveat after caveat. The rule of thumb—”invest in the lower stat”—and the calibration rule are useful because they build intuition and get close to the optimal EV spread almost every time. However, getting close almost every time means that many applications of these rules will have to be checked by hand. With over 380 Pokemon, hundreds of moves, and thousands of EV combinations to check, it is horribly inefficient to have to tweak every set even after applying these rules. That’s the type of problem that should be solved by a computer that can search through possible spreads much faster than a human can. So, rather than chasing every edge case by hand, I decided to write a brute-force algorithm that can find the optimal spreads directly.
Part 3: The App (https://tetra-min-ev-survival-calc.streamlit.app/)
(Note: The app is not active 24/7 due to streamlit’s hosting policies. However, you can “wake up” the app at any time to use it. The “waking up” process should take no longer than 3 minutes. Reload the page if necessary.)
The meat of this project was building the application that allows for finding “optimal” spreads. To note, when I say “optimal”, I mean for the scenarios that you as the user will input. There may be cases that you have not considered that will exploit a weakness in the spread that you get, or you may be overvaluing survival against a situation that has too high an opportunity cost for it to justify. For example, Zapdos can survive a +1 Jolly Tyranitar Rock Slide with 236 HP / 248+ Def after Sandstorm damage. This comes at the cost of specializing Zapdos for a role that it is more commonly valued for—threatening Water- and Flying-types—since the significant Def investment is marginally useful at best in serving this role. The application will not be able to decide whether scenarios such as this are worth prioritizing, so use the application at your own discretion. Beyond this point, I will focus discussion on what is seen in the application and what all of the options can do for you.
The Defender
Below the “Defender” header, you can pick from any of the 386 Pokemon that are usable in the various ADV formats. You can scroll to find the Pokemon in the alphabetical dropdown list or delete the default Pokemon (i.e. Abra) and type in the Pokemon that you want to examine. When you select a Pokemon, the “Defender Ability” will change to match the abilities that the Pokemon can have. The dropdown can be selected to change the ability to any of the legal abilities of the defender. The ability selected may not always affect damage calculation (e.g. Rock Head, Pressure), but abilities that do affect damage calculation such as Thick Fat and Volt Absorb will function as they do in-game. Some modern-generation abilities may be selectable, but they will not be functional at this time—they may be functional in the future if I decide to expand this project for multiple generations.
There are three checkboxes below the ability. One says “Defender using Hidden Power?”. Selecting this will allow you to change the IVs of the HP, Def, and SpD stats since they may affect the EV calculation later (Atk/SpA/Spe do not affect the calculation and are thus not asked for). You may find this useful if, for example, you are planning to use an Aerodactyl set that has a Hidden Power Flying IV configuration that drops each of its HP, Def, and SpD to 30 IVs. Be sure to lock in your preferred Hidden Power IV configuration before running the rest of your calculations since changing it later may invalidate results that you’ve already obtained. Note that Hidden Power Flying has another IV configuration that allows it to retain 31 IVs in HP, Atk, and Def at the cost of dropping to 30 in SpA, SpD, and Spe.
The next checkbox reads “Leftovers”. This will assume that the defending Pokemon is holding Leftovers, which will add 1/16th max HP chip healing for scenarios that take place over the course of multiple turns. The final checkbox says “Sandstorm”. This will assume that permanent Sandstorm is active and apply 1/16th max HP chip damage at the end of each turn. The app resolves end-of-turn effects such as Leftovers and Sandstorm in the proper in-game order. It knows that Sandstorm damage is applied after the attack and before Leftovers. A resultant spread will only be valid if it survives the full sequence—including a final tick of Sandstorm damage.
Entry Hazards
There is a dropdown menu for “Spikes Timing”. The options are “Switch” and “Revenge”. Switch will assume that the defending Pokemon will be switching into the Spikes and immediately taking the attacks provided. Revenge will assume that the defending Pokemon will switch in after a KO has been dealt. The defender will take Spikes damage and then resolve end-of-turn effects such as Sandstorm and Leftovers. In cases where Sandstorm and Leftovers cancel out, there may not be much difference between the modes, but since Sandstorm affects much of the tier and Leftovers is the most common held item, it is a worthwhile consideration for cases when Sandstorm and Leftovers do not cancel out.
Stat Floors
Additionally, Stat Floors can be assigned for HP, Def, and SpD. This may be useful if you have a particular bulk benchmark in mind that you would like to stress test against other scenarios. For example, say that you know that 8 HP / 0 Def / 188 SpD allows Salamence to survive a -1 Rock Slide from 252+ Atk Tyranitar or a 0 SpA Ice Punch from Gengar assuming that Sandstorm is active. (This is similar to the scenario from Part 2 but requires additional SpD investment to overcome the added Sandstorm damage.) Now you want to see if that spread is capable of surviving a 252+ Atk Metagross Meteor Mash and a 0 SpA Swampert Ice Beam. Input 8 HP and 188 SpD into their respective Stat Floor sections and run a new calculation. If the result doesn’t change, then both scenarios are covered by the spread that was inputted into the Stat Floor.
(It should go without saying, but if you attempt to pre-allocate more than 508 EVs, the app will not be able to return a spread.)
The Attackers
There is an EV slider which will set the attacking Pokemon’s investment in their attacking stat. The default is 252 but can be set to any multiple of 4 between 0 and 252. Also, the nature can be selected in a dropdown menu. The options are +, Neutral, and -. The default is +.
Results
Clicking the Calculate button will provide a “Results” section. We’ll use the Tyranitar vs Metagross and Suicune example from Part 2 to provide an example of how the Results might look. We will assume that Tyranitar only has to survive one Meteor Mash or one Hydro Pump, no Spikes are on the field, no Stat Floors are selected, none of Tyranitar’s IVs have been affected, and defensive natures are not allowed to be assigned to Tyranitar. A screenshot of this scenario will be included below.
Sure enough, the calculator agrees with our by-hand calculation from earlier. The first result is the 232 HP / 8 Def spread that I mentioned in Part 2. The “Total Defensive Investment” has been summed to 240 EVs. Additionally, there is a skeleton of a Showdown import in case you want to copy this spread into your builder. Only information that has been given such as the item (i.e. Leftovers), ability, and calculated EVs will be reported. A nature is also reported, but it defaults to Hardy for defensively-neutral natures (Bold for +Def and Calm for +SpD). Change this nature at your own discretion, but note that natures that positively or negatively impact Def or SpD may deviate from the intended optimization of the spread.
You may notice that additional results populate. In this case, the calibration rule spread of 224 HP / 16 Def and a third spread of 208 HP / 24 Def / 8 SpD have been reported. Both of these spreads also only have a Total Defensive Investment of 240 EVs. You might decide to pick one of these spreads for specific purposes, but in general, the higher HP investment variant is preferred (as discussed in Part 2) and defaults to the top of the results.
If you have further questions, have bugs to report, want additional functionality, or want to share cool results that you found, please feel free to reply to this post. If you want to express your undying gratitude, follow me on Smogon and subscribe to my YouTube channel (https://www.youtube.com/@Tetrafolium). Shoutouts to Rainer24 for proofreading this post.
Last edited:







