Damage Formula for RS... and DP

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
I don't know if this is the right place to post this thing. If it isn't, I apologise.

As some of you know, the damage formula for Pokemon contains a random number between 217 and 255, which is multiplied to the damage done, and then divided by 255.

According to upc.pkmn.co.uk, this was actually changed in RS:

upc.pkmn.co.uk said:
The basic damage formula remains unchanged from previous Pokemon versions. The difference (a small one) is that the random number is from 85 to 100 and is divided by 100.

The difference is indeed almost infinitesimal. Instead of multiplying by a number between 217/255 and 1, you multiply by a number between 85/100 and 1. To give you an idea, 217/255 = 0.85098, while 85/100 is, of course, 0.85.

Two questions:

1) Can anyone confirm (preferably using ROM methods) that this is true for RS?
2) I have played a bit of DP, and I'm 99.5% sure that the damage formula for DP is essentially the same. However, can anyone check what the damage formula is for DP, especially about the random number generated?
 
Keep in mind Pokemon rounds down to the nearest integer after every step anyway, making this matter even less.
 
I have a stat calculator if you'd like it, I mad it in Microsoft Excel. Don't have a damage calc, yet, but if you want, I can upload the Excel file, and then upload the updated file with the Stat calc.

[edit]Yeah, pretty much all formulas in Pokemon round down in every step of the hiearchy of mathematical sequential order (ie 1 - parenthesis, 2 - exponent, etc). So pretty much, after the formula is done processing an output in one parenthsis, it rounds down to a whole number before moving on to the next parenthesis, or the end of the equation. This would be why you need 4 EVs before you get a stat point.
 
I'm pretty sure in D/P the damages round down, as a Mukkuru using Tackle on my Hikozaru did 1 damage whereas it would have done 2 in R/S/E and 3 in FR/LG.
 
There is an unclear change in the battle formula, a little bit, as otherwise in all 3rd/4th Gen games, the damage dealt by a weakling would have been equal. I just suppose that there's a rounding down somewhere, or a slight change in numbers.
 
I don't even see why the 'rounding down' fact matters in this discussion - I've known that for ages.

There is a crucial difference, especially when the amount of damage done is large. Choosing a number between 0 and 38 gives you 39 different damage amounts that can be done. Choosing a number between 0 and 15 gives you only 16 different damage amounts.

For instance, suppose the damage done before the random number generated, rounded down is 400.

If the formula is of the 217-255 variety, the damage done could be:

340, 341, 343, 345, 346, 348, 349, 351, 352, 354, 356, 357, 359, 360, 362, ... up to 400.

If the formula is of the 85-100 variety, the damage done could be:

340, 344, 348, 352, 356, 360, 364, 368, 372, ... up to 400.

Most of the numbers in the first formula wouldn't be even possible... that's my point.

By the way, the Netbattle damage calculator is not correct... it never rounds down anything until at the very last moment in the calculation. This results in doing 1, sometimes even 2, more damage than it's supposed to deal.
 
I don't know. It would be extremely hard to test. Anyone who has access to the Netbattle source code should be able to know, though.
 
In the Item Research Thread, the testing of Expert Belt brought up an interesting point. It appears that it Diamond and Pearl, the type-effectivity multipliers go after the random number has been implicated, meaning that instead of calculating damage like this:
((((2L/5+2)AP/D)/50)+2)STAB*E*N/100 [rounding down after each step],
it calculates damage like this:
((((2L/5+2)AP/D)/50)+2)STAB*(N/100)*E
Not that it matters much, as it still deals the same amount of damage practically all of the time.
 
Not only that.

In DP, if you hit a Pokemon whose type combination both resists and is weak to the move, then damage will be first divided by two, then rounded down, then multiplied by 2 again.

Say, for instance, a Level 100 Lapras is hit with a Metagross Meteor Mash (non-CBed). Lapras' Water type is resistant to Steel, while its Ice type is weak to Steel.

Assuming Metagross has 405 attack, Lapras has 196 Defense and the random number is 88, the damage would be:

floor(floor(floor((floor(floor(42 * 405 * 100 / 50) / 196) + 2) * 1.5) * 88 / 100) / 2) * 2

= floor(floor(floor((floor(34020 / 196) + 2) * 1.5) * 88 / 100) / 2) * 2
= floor(floor(floor(173 * 1.5) * 88 / 100) / 2) * 2
= floor(floor(259 * 88 / 100) / 2) * 2
= floor(227 / 2) * 2
= 113 * 2
= 226

Note that, in RS, the damage would have been 227. Now the damage is 226, and would actually always make the damage even.

Team Rocket Elite is pondering whether this will also hold for Walrein's Ice/Water type (instead of Water/Ice). He's basically conjecturing if, when the type is Ice/Water, it will first multiply the damage by 2 and then divide it by 2, rounding it down. This will produce damage values that are not necessarily even.
 
Okay. Then this theory needs to be tested for Walrein to see if it's true. It's just a conjecture, for now.

Dootakun's Gyro Ball versus Lapras always produced even valued damage numbers, but Lapras is Water/Ice. That is confirmed for sure.

Supereffective damage is always even in DP, too. This has been confirmed as well.

In the meantime, I'll change Walrein for Lapras in my post.
 
Tested Reminiscent Headbutt against Medicham, which is of type Fighting/Psychic. It did 35 damage, which is not even. Hence, the damage was first multiplied by 2 and then divided by 2, and not vice-versa for Medicham.
 
Back
Top