View Full Version : Complicated EV/Stat Question

26th June 2007, 08:16 PM
Frankly, this is a question for someone who's either found the game's programming code or who has a lot of time for testing. ^_^;

Okay, so I know how EVs work, in general. Maximum 510 per Pokemon, 255 per stat, and every 4 EVs yield a 1-point stat boost. I get that much.

What I'm trying to figure out is whether stats are calculated on a fractional basis. That is, uh...

Okay, as an example... let's say that some Lv. 100 Pokemon (lovingly named "A") has 300 HP. And let's say that A doesn't have any EVs whatsoever. Now, depending on how stats are calculated, it's possible that the programming calculates this as, say, 300.4 HP, and it's rounded down to 300 for battling purposes. I'm not sure exactly how stats are calculated, but it makes sense that they might be done in this manner.

Let's assume for the moment that this is the case and take a look at EVs, assuming they're done in the same way. Now, 4 EVs = 1 stat point. So if EVs are calculated in the same way as we've assumed stats themselves are, then 1 EV = 0.25 stat points.

Therefore, let's say that A gets 3 EVs in HP. Suddenly that HP is 301.15, which rounds down to 301. Only 3 EVs have been earned, but the stat increased by a point nonetheless. From now on, it will still take 4 EVs to increase that stat by another point, but this changes things a little.

What I'm trying to get at is whether the hard-and-fast rule of "4 EVs = 1 point" really applies, or whether it's possible that, for example, 3 EVs = 1 point, 7 EVs = 2 points, 11 EVs = 3 points, and so on. This could change EV training methods, as it may be worthwhile to go slightly beyond the standard 252 EVs in any stat to get that extra point. (In the example above, one could train to 255 EVs in order to boost the HP one last time.)

So, in summary, here are my questions.

1. Are stats calculated using fractions/decimals and then rounded up/down to a whole number for battles?

2. At Lv. 100, are EV stat bonuses calculated for individual EVs or for sets of 4? That is, does the game divide earned EVs by 4, round down, and then increase the stat by the result? Or does it simply increase the stat by 0.25 for each EV earned?

Yes, I know. Very, very complicated.

26th June 2007, 09:26 PM
Well, the stat formulas are these; you've probably seen them before:

Stat = Math.Floor(Math.Floor((2 * B + I + E) * L / 100 + 5) * N)

And the HP one is different, of course:

Stat = Math.Floor((2 * B + I + E) * L / 100 + L + 10)

Where B = base stat, I = individual value, E = effort value, L = level, and N = nature.

So as you can see, 1) the game does use fractions and decimals when calculating stats, but the final result and the one that you see when you look at the status screen is a rounded number, and it always rounds them down, and 2) EV's are worth 0.25 points at lv. 100. However, it doesn't matter, because B and I will always be whole numbers, so by creatively spreading EV's you can't cause the game to round down to a higher whole number; getting seven EV's in a stat will never give you a higher final stat than getting four in that stat. Also, at lv. 100, if there are no EV's present, then the formula will always produce a whole number, which is why if you want to find an exact IV without adding any EV's, you typically need a lv. 100 pokémon.

Also, the game rounds down further if there is some other modifier placed upon a stat; so, for example, if you're using a choice band, there is no advantage to having 301 attack versus 300 attack, because after multiplying by 1.5x the game will then round either value down to 450. So it is possible in some cases to save an EV here or there if you're looking to add further stat multipliers.

26th June 2007, 10:12 PM
That...is not the formula I typically see. The formula I typically see involves the expression EV / 4, and there's a Math.floor that makes it clear that a single EV is worth nothing at all until you get 4 of them together.

/goes digging for standard formula/

Here we go!

Stat = Math.Floor ( ( ( BaseStat * 2 + IV + Math.Floor ( EV/4 ) ) * Level/100 + 5 ) * P )

I've added coloration to help sort out all of the parentheses. ...okay, comparing your formula and mine the only differences are that you've got a Math.floor in the wrong place, and you completely left out the whole dividing-by-four thing.

26th June 2007, 10:56 PM
A math.floor in the wrong place? Where?

But yeah, my bad... the formulas I gave are written generically so that they can be used either for GSC calculations or advance+ calculations; if you're using it for GSC, then E = Math.Floor((sqrt(Stat Experience - 1) + 1) / 4); for all games after that, it's E = Math.Floor(Effort Value / 4 ), as you wrote. Sorry, forgot to mention that.

26th June 2007, 11:14 PM
Okay, that makes sense. I figured everything would use Math.floor, but a lot depended on whether that function would immediately be applied to EV/4 or if other calculations would come first. As Negrek said, there are still a few ways to save a point here and there if you plan absolutely everything in advance, but that cuts down most of the possibilities.

Thanks for the help, both of you! I appreciate you offering your knowledge. ^_^

P.S. I believe Poryhedron is referring to the second instance of Math.floor in your first equation, Negrek. (It comes right after the first "(" listed.)

26th June 2007, 11:24 PM
P.S. I believe Poryhedron is referring to the second instance of Math.floor in your first equation, Negrek. (It comes right after the first "(" listed.)
Ah, I see. Yeah, I'm positive that's supposed to be in there.