How to maximize your Defenses

X-Act

np: Biffy Clyro - Shock Shock
is a Site Content Manager Alumnusis a Top Programmer Alumnusis a Top Smogon Discord Contributor Alumnusis a Top Researcher Alumnusis a Top CAP Contributor Alumnusis a Top Tiering Contributor Alumnusis a Top Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
NOTE: THIS VERSION MAY BE OUT OF DATE - PLEASE CHECK THE WEBSITE: http://www.smogon.com/dp/articles/defenses

(Before reading the article, you can take a look at this accompanying applet.)


How to maximize your Defenses

Introduction

You are on Netbattle, trying to give your Dusclops good defensive effort values (EVs). You decide to use all of your EVs to boost its defenses, so you have 510 effort values to work with. You notice that Dusclops has 130 base Defense and 130 base Special Defense, so you put 252 EVs in Defense, 252 EVs in Special Defense and the remaining 6 EVs in HP. You then realize that you can give Dusclops a nature that boosts either its Defense or Special Defense. So now its defenses aren’t equal, and… you start to wonder if your previous EV distribution was such a good idea after all…

Or suppose you want to make your Salamence be able to take hits a little better. You can reserve 80 EVs, say, for this purpose, and you’re trying to distribute them to Salamence’s defenses in the best way possible. So, you look at Salamence’s stats. It has 95 base HP, 80 base Defense and 80 base Special Defense. You notice Salamence’s Intimidate trait, so you decide that Salamence can already take physical hits moderately well, and hence you put the 80 EVs in Special Defense. However, you start to wonder if this decision is justified. Maybe putting them in HP would have been better…

If the above conforms to what you usually think about when trying to find good defensive EVs for your Pokemon, and want to start building the best defensive Pokemon given the EVs you have left, continue reading.

Overall Harm

To understand how to distribute your defensive EVs, it is important to understand what the Overall Harm that a Pokemon can sustain is.

The Overall Harm is a number representing the fraction of the HP a Pokemon would lose if it was to be dealt a physical move and a special move of the same power in succession. It is defined using the following formula:

Overall Harm = (k(D + IS) + 4DS) / HDS

where:

k is a constant representing the damage being dealt by the foe
D is your Defense stat
S is your Special Defense stat
H is your HP stat
I is 2/3 if your Pokemon has the Intimidate trait, 1 otherwise

Thus, to distribute your EVs for maximum defenses, you need to choose H, D and S in the above formula such that the Overall Harm is the lowest possible.

The DefenseEffortValues Applet

The DefenseEffortValues applet uses the formula for the Overall Harm displayed above, and cycles through all possible EV distributions to give you the EV distribution that provides you with the lowest possible overall harm. (The value for k used in the applet is 20000. You can read later for an explanation of the choice of this value.)

You can click here to use the applet. There is an explanation of how to use the applet in the website. Make sure you have the latest Java console installed on your computer, otherwise it won’t work.

For the Dusclops example written in the introduction, the applet tells us to put 252 EVs in HP, 160 EVs in Defense and 88 EVs in Special Defense, with a nature that boosts Special Defense. The stats would then be 284 HP, 336 Defense and 352 Special Defense.

For the Salamence example, assuming it has an Adamant Nature, the applet tells us to put 60 EVs in HP and 20 EVs in Special Defense for the best overall defense. This gives us a 346 HP stat, 196 Defense stat and 201 Special Defense stat.

You may skip all the following sections if you’re not interested in how the formula for the overall harm was obtained.

How the Overall Harm formula was obtained

To be able to understand how the Overall Harm formula was found, we first need to know how the game actually calculates the damage that your Pokemon is dealt. This is done by the so-called Damage Formula, which can be written in the following manner:

Damage = ((Harm Dealt) / (Your Defense)) + 2) * TypeModifiers * RandomNumber

(Harm Dealt is equal to 42 * Foe’s Attack * Move Base Power / 50 if the foe is a Level 100 Pokemon.) We need to find out what happens to the damage dealt if the same Pokemon uses the same move over and over, and you increase or decrease your Defense (or Special Defense) stat. Because of this, the foe’s attack stat and move base power is kept constant throughout, and so are the Type Modifiers. We assume that the random number generated is always the maximum, too, so the damage formula becomes:

Damage = (k / D) + 2

where k is the constant damage that the foe is dealing, and D is your defense stat.

We now need to factor your HP in the calculation. If 60 damage is dealt to a Pokemon with 300HP, it will lose 1/5 of its total HP, whereas 60 damage dealt to a Pokemon with 480HP will only make it lose 1/8 of its total HP. Here, we see why the HP stat is also important. Hence, we can conclude that

Physical Damage as a Fraction of HP = ((k / D) + 2) / H

where H is your HP stat. Rearranging, we get

Physical Damage as a Fraction of HP = (k + 2D) / HD

Similarly,

Special Damage as a Fraction of HP = (k + 2S) / HS

where S is your Special Defense stat. Adding the above two formulae together and rearranging the formula, we get the Overall Harm that the Pokemon will take as a fraction of its HP:

Overall Harm = ((k + 2D) / HD) + ((k + 2S) / HS)
= (S(k + 2D) + D(k + 2S)) / HDS
= (kS + 2DS + kD + 2DS) / HDS
= (k(D + S) + 4DS) / HDS

Overall Harm = (k(D + S) + 4DS) / HDS

All that remains is to choose a suitable value of k. This can be basically any number that you can dream of. However, higher values of k produce better values (otherwise the value for the overall harm would be too small). 20000 seems to be a good all-round value. (Incidentally, it’s very near the value generated when a Level 100 Pokemon with 317 attack stat uses a 75 base power move).

Biased Overall Harm

Sometimes, you don’t need your Pokemon to take hits equally well from both attacks and special attacks. Maybe you prefer your Pokemon to take hits better from the physical side, or from the special side. This is where the Biased Overall Harm comes in.

First, we introduce a bias factor B. B is a number between 0 and 1 inclusive, which provides the degree of bias you want from the physical side. B=0 would make the Overall Harm formula take care of the special side exclusively; B=1 would make the formula take care of only the physical side; B=0.5 would make the Overall Harm formula take care of both equally (like it is right now). Of course, B can take any value you like between 0 and 1, which gives you varying degrees of bias.

Let’s see how we are going to incorporate this number in the Overall Harm formula now.

First of all, we rewrite the overall harm formula as follows:

Overall Harm = [(k + 2D) / HD] + [(k + 2S) / HS]

Recall that the first pair of square brackets is the damage you take from a physical hit, and the second pair of square brackets is the damage you take from a special hit of the same power. We now need to vary this damage according to the value of B. Here is how it’s done:

Biased Overall Harm = (2B)[(k + 2D) / HD] + (2 – 2B)[(k + 2S) / HS]

Let’s see what happens when B = 1:

Biased Overall Harm = (2(1))[(k + 2D) / HD] + (2 – 2(1))[(k + 2S) / HS]
= 2[(k + 2D) / HD] + 0[(k + 2S) / HS]
= 2[(k + 2D) / HD]

So, when B = 1, the overall harm formula returns the damage from two physical hits, and so the applet will exclusively raise the defense stat to try to lower the overall damage harm as much as possible.

When B = 0:

Biased Overall Harm = (2(0))[(k + 2D) / HD] + (2 – 2(0))[(k + 2S) / HS]
= 0[(k + 2D) / HD] + 2[(k + 2S) / HS]
= 2[(k + 2S) / HS]

This returned the damage from two special hits, and so the applet would try to increase the special defense stat as much as possible in this case.

And when B = 0.5:

Biased Overall Harm = (2(0.5))[(k + 2D) / HD] + (2 – 2(0.5))[(k + 2S) / HS]
= 1[(k + 2D) / HD] + 1[(k + 2S) / HS]
= [(k + 2D) / HD] + [(k + 2S) / HS]

This returned the usual, unbiased, overall harm formula we wrote before, as it should have done.

Raising Your Defenses

Sometimes, you raise your defenses during the match, either via moves, via items or via traits.

The item Soul Dew makes the Special Defense stat of Latios and Latias 1.5 times of what it was before. The item Metal Powder makes both the Defense and Special Defense of Ditto 1.5 times of what they were before.

The trait Marvel Scale makes the Defense of Milotic 1.5 times of what it was before if it is afflicted by a Special condition.

You can also raise your defense and special defense stats using moves such as Curse, Calm Mind, Amnesia, Iron Defense, etc.

The effect of these things in the overall harm formula is very minor: you just replace D and S, if necessary, by the modified defense and/or special defense stats.

Pokemon with Intimidate

When a Pokemon with the Intimidate trait switches into the foe, it makes the opponent’s physical attack stat 2/3 of what it was before. This means that, in the above formula, the physical damage as a fraction of HP would be

Physical Damage as a Fraction of HP = ((2/3)k + 2D) / HD

The special damage as a fraction of HP would still be the same. Hence, overall,

Overall Harm = (((2/3)k + 2D) / HD) + ((k + 2S) / HS)
= (S((2/3)k + 2D) + D(k + 2S)) / HDS
= ((2/3)kS + 2DS + kD + 2DS) / HDS
= (k(D + (2/3)S) + 4DS) / HDS

Overall Harm for Pokemon with Intimidate = (k(D + (2/3)S) + 4DS) / HDS

Of course, this will hold for as long as the foe stays Intimidated.

Pokemon with Leftovers

A Pokemon with Leftovers recovers 1/16 of its HP at the end of each turn. Thus, at the end of the turn, the physical and special damage as a fraction of HP will both be 1/16 less, and hence

Overall Harm = ((k + 2D) / HD – 1/16) + ((k + 2S) / HS – 1/16)
= ((k + 2D) / HD) + ((k + 2S) / HS) – (1/16 + 1/16)
= ((k(D + S) + 4DS) / HDS) – 1/8

Overall Harm for Pokemon with Leftovers = ((k(D + S) + 4DS) / HDS) – 0.125

This means that attaching Leftovers to a Pokemon will not affect the way you distribute your defensive EVs to guarantee the maximum defenses possible. This is why the Leftovers item is not mentioned anywhere in the applet.
 
Wow. Very impressive. Defensive stats are probably the most difficult area of advanced gameplay for new players. This should help even the odds a little.
 
Wait, I don't get it. Why does a Dusclops with 284 HP, 336 Defense and 352 Special Defense be more effective than a Dusclops with 284 HP, 352 Defense and 336 Special Defense, or a Dusclops with 284 HP, 344 Defense and 344 Special Defense?
 
Wait, I don't get it. Why does a Dusclops with 284 HP, 336 Defense and 352 Special Defense be more effective than a Dusclops with 284 HP, 352 Defense and 336 Special Defense, or a Dusclops with 284 HP, 344 Defense and 344 Special Defense?

A Dusclops with 284HP, 352 Def and 336 SpDef is, of course, as effective as one with 284HP, 336 Def and 352 SpDef. The applet finds the best distribution, but, there may be other distributions that are as good.

For your second example, a Dusclops with 284HP, 344 Def and 344 SpDef is impossible to obtain. The nearest to that you can do is 284HP, 343 Def and 344 SpDef, by putting 252 EVs in HP, 64 EVs in Def and 192 EVs in SpDef, and make Dusclops have a +Def nature. If your example were possible, it would actually be slightly better than the one the applet found, but, since it's impossible, the applet didn't find it.
 
I tested the applet. It was pretty good, but when I placed 65/140/70 in (Skarmory), it gave me 334/317/262
 
I tested the applet. It was pretty good, but when I placed 65/140/70 in (Skarmory), it gave me 334/317/262

Of course it did.

The applet gives you the overall defensive EV spread from both physical and special hits. The stats that the applet gave you would make Skarmory take better physical AND special hits than the usual 334/416/177 stats.

Skarmory is usually designed to only take physical hits well, leaving it prone to special hits, so this applet is not of good use for Skarmory's purpose. If you just want to be super physically defensive and not specially defensive, then you don't need any applets to tell you how to do so: just slap 252 EVs in HP and 252 EVs in Defense.
 
Whoa, I never would have thought that my article would be accepted as part of the site. Thanks.

I can give you permission to upload the applet in the site too, if you want. My site is on Geocities, which has very limited bandwidth.
 
I put swamperts base stats in there and it gives me more special defense then defense even though he has even base stats is there a reason for this that I am unaware of?


It happened with meganium as well
 
thecrazylazyguy said:
I put swamperts base stats in there and it gives me more special defense then defense even though he has even base stats is there a reason for this that I am unaware of?


It happened with meganium as well

No reason at all.

If a Pokemon has equal Defense and Special Defense base stats, the applet will inevitably make one of those stats larger than the other (because of the personality that boosts either one of the stats). In such a case, because of the way the applet is written, the personality boost will always be the SpDef stat, so it will end up larger than the other stat. In that case, you can switch the stats of the defense and special defense, and the Pokemon will still have maximized defenses.

If you actually choose a nature from the list that doesn't boost either defense nor SpDef, the applet should make the defensive stats equal.
 
If you don't choose a nature, it will either choose to boost Defense or Special Defense. This will, of course, make your Pokemon have better overall defenses, but it will be extremely difficult to make the defenses equal that way.

According to the applet, it's better to make one stat 10 more than the other in order to maximise your defenses. If you want, go in Netbattle and try to give Swampert better EVs (i.e. try to make the defenses nearer to each other). You'll notice that the resulting stats will be inferior to those given by the applet.
 
This is cool. It's obviously not the 100% best way to make EV decisions, but some Pokemon with otherwise complex EV choices could find this handy. However, I disagree with what you have to say about leftovers since it doesn't restore 1/16 of your health but rather 1/16 of your max HP rounded down. That means the less you have to subtract from your HP to get to a number divisible by 16, the less the overall harm will be. It would probably only shift 4 EVs on a few calculations, but it's worth including because it is a factor.

= ((k(D + S) + 4DS) / HDS) – 2rounddown(H/16)/H

This formula is slightly more accurate for Pokemon with leftovers. I'm sure there's a more practical way to express "rounddown"(maybe mathfloor?), but it conveys the meaning well enough. Obviously the intimidate variety exists as well, and a variety with a plus instead of a minus would be ideal to include to factor in sandstorm damage when you don't have lefties.

One more practical addition might be an option to factor in the Marvel Scale trait. It would be useful for Milotic spreads to be able to see how having the boosted defense would change the calculation. For that matter, it would be really cool to have the option to assume your Pokemon have boosted defense and special defense in general so you could see how boosted stats alter what your ideal spread would be(when Suicune has no CMs, X is the ideal spread, but if it has 1 CM, Y is the ideal - I'll average these two for the actual EV spread I use!). That would also be a simple solution to let people factor in items like the Soul Dew and the Deepseascale since they could just set the assumed defense or special defense boost to 1 stage or 2 stages.

Good job in creating a useful program though. On anything I wanted to take both kinds of hits, I'd certainly use it as a starting point for a spread.

Also, a point directed at those worrying about Skarmory and other single side defenders, if you want to use this to calculate their EV spreads when you don't have 510 EVs to work with(say, the optimum EV spread for Skarmory when you have 100 EVs in attack and speed combined), just set the base special defense to 255 instead of the true value and the nature to a +defense nature. It should give you a spread with 0 EVs in special defense which is what you wanted. The opposite procedure holds true if you just want to maximize special defense without worrying about physical defense.
 
The Marvel Scale part is interesting; I think I'll add that option. To be honest, I forgot all about it.

I know about Leftovers healing 1/16 of the HP rounded down. In the article, I tried to be as simple as possible in my arguments. If you want a more accurate reason of why I didn't factor in Leftovers, here it is:

If H is exactly divisible by 16, floor(H/16)/H = (H/16)/H = 1/16 = 0.0625

If H is not exactly divisible by 16, it can be written as H = 16Q + R, where R (which is a number between 1 and 15) is the remainder that you get when you divide H by 16. Hence,

floor(H/16)/H = floor((16Q+R)/16)/H = Q/H. Since Q = (H-R)/16, floor(H/16)/H would be equal to (H-R)/(16H) = H/16H - R/16H = 1/16 - R/16H = 0.0625 - R/16H.

This means that the leftovers recovery will only be R/16H less than usual. Since R is between 1 and 15, and H is 211 at least (in the case of Dugtrio), this is at most 15/(16*211) = 0.00444.

Hence, the full Leftovers recovery will be between 0.11612 and 0.125 of your HP, and it near the 0.11612 for low HP Pokemon such as Dugtrio. But since low HP Pokemon will get their HP boosted first anyway (if you care about their defenses, that is), Leftovers recovery will not be such an issue for defensive EV distribution.

This is the long-winded reason why I chose to omit the Leftovers recovery.
 
Marvel Scale, Soul Dew, Metal Powder, and Calm Mind should make 4 EVs difference at worst. This is because they boost multiplicatively with your final stat, after EVs and nature, not additively or at any intermediate step. Well, I suppose technically they could be slightly more or less influential thanks to rounding at intermediate steps in the damage formula, thus expanding that to a possible 8 EVs difference.

It's Math.floor() in Java IIRC.
 
Having 1.5X or double in a defensive stat could have a very profound impact on how much HP you would ideally want, and it could change the balance between the two defenses. I'd also remind you that nature is the same way; it's just a boost in the end. For example, a theoretical Pokemon with 65/140/120 defensive bases, a Hardy nature, and 510 EVs to spare gets an ideal 252/48/208 EV spread. However, making him Bold makes 252/16/240 the ideal, and making him Careful makes 252/80/176 ideal. That's just a 110% multiplier too. Items like Metal Powder are much bigger in how much they multiply by, though they work in the mathematically same way as a nature boost. A final multiplier on one of your defensive stats is really important, mostly because it only multiplies one of the defenses and not both defenses and HP. If both defenses and HP were multiplied by the same number, I think you would be right that it would only matter for 4 EVs.
 
AA is right. Just look at Intimidate: it largely affects your Defense EVs distribution. All it's doing is making the opponent's attack stat 2/3 of what it was; yet the applet barely gives you any Defense EVs if you have Intimidate.

So, let's see, I need to implement Marvel Scale, Calm Mind, Bulk Up/Curse, Soul Dew and Metal Powder?
 
Could you do the math for when you want uneven defense and special defense?

When you want both equal is pretty simple, but that is way out of my league.. The main reason I ask is for EVing Snorlax.. When you want a lot of special def, and a little physical def..

Have a nice day.
 
Back
Top