All Gens Obscure Damage Formula Questions

Honko

he of many honks
is a Site Content Manager Alumnusis a Programmer Alumnusis a Top Contributor Alumnus
I recently added gens 1-4 to the PS damage calculator. This included implementing each gen's specific damage formula, with all of their quirks. I used upokecenter for gens 1-3 and the Smogon damage formula article for gen 4 for my reference. As far as I know, the calculator should be 100% accurate to the mechanics of each gen, with the exception of a few small points that I was not able to find a conclusive answer on. I'm hoping someone here can help me answer some or all of these questions.

To be clear, I am not interested in how these things work in PS or PO or NetBattle, or what's written in Bulbapedia or Smogon's database. Those are all unreliable sources that tend to mix up mechanics between gens. I am looking for someone to either test these things on the cartridges or point me to a reliable source that conclusively answers my questions.

1) In ADV, how much is damage reduced by for spread moves like Rock Slide in 2v2 battles? I've seen many different sources each claiming spread moves do 1/2, 2/3, and 3/4 of normal damage in ADV, and I'm not sure which to trust. This one should be pretty easy for someone to clear up by testing (or already know the answer to, but make sure you aren't thinking of a later gen).

2) In GSC, is SolarBeam's damage halved during Sandstorm, or only during Rain?

3) In GSC, ADV, and DPP, how much does Metal Powder boost Ditto's defense by? 1.5x or 2x?
(1.5x in GSC, tested by Bedschibaer)

4) In RBY, upokecenter claims that damage variance (the part where the base damage is multiplied by a random number from 217-255 and then divided by 255) is skipped if the base damage is >= 768. This would very rarely have an impact on actual battles, only mattering on very powerful attacks vs. Chansey so that they would KO every time instead of most of the time. (For example, the base damage for Exeggutor's Explosion vs. Chansey is 792. If damage variance is applied, it would OHKO 75% of the time. If damage variance is skipped, it would always OHKO.) I'm inclined to believe this is true, because it seems like the kind of shortcut GameFreak would take in the early gens. (768 looks random at first, but it's actually a nice even number in hexadecimal.) Unfortunately I can't find that source again, and this isn't mentioned on upokecenter or anywhere else I've looked, so I've left it out for now. Can anyone confirm or refute this, or point me to a source that mentions it? Upokecenter mentions this, but it would be good to get confirmation.

Thanks for anyone who can help!
 
Last edited:

Bedschibaer

NAME = FUCK
is a Social Media Contributor Alumnusis a Forum Moderator Alumnus
I have tested out number 3 on my gold cartridge and it's 1.5 defense boost. I have calcs written down and can scan them in with literal screenshots if necessary. I looked up the item description and it doesn't change over the gens and i have found nothing that indicates it would, so i guess it's safe to assume it doesn't change. I don't have any rse or dpp cartridges by hand so i can't check myself. Serebii for example has the same description for all gens, i don't know how reliable that is though.
I can test out number 2 too, i would have to borrow another cartridge though, because it seems i wasted the sandstorm tm on something i can't find anymore on mine.
 

Mr.E

unban me from Discord
is a Two-Time Past SPL Champion
Can't test these things myself, so I won't be too much help but... Actually, I see no reason a ROM/emulator wouldn't work just fine if you get hold of one.

4) In RBY, at one point I found a reliable-looking source that claimed damage variance is skipped if the base damage is >= 768. ... Unfortunately I can't find that source again, and this isn't mentioned on upokecenter or anywhere else I've looked, so I've left it out for now. Can anyone confirm or refute this, or point me to a source that mentions it?
This took about 30 seconds of Googling to find right off upokecenter. Bottom of the page:

"Finally, in a process called 'damage variance,' unless the damage is 768 or more, a random integer from 217 through 255 is multiplied in the currently calculated damage, and divided by 255."

I can't confirm it but I have to imagine that is probably the original source you found it, I've never heard of this before and don't see it mentioned anywhere else. What is a reliable source anyway? ;[
 

Isa

I've never felt better in my life
is a Tournament Director Alumnusis a Social Media Contributor Alumnusis a Community Leader Alumnusis a Community Contributor Alumnus
If 4) is true, that is a big find. I am confident no battle simulator uses that damage check as of now.

Does Critical Hits have any impact on 4)?
 
When I have time later today I could go poke around a bit with a debugger and see if I can figure out if #4 is true. I don't have that much experience with GB debugging so I can't guarantee I will be able to find a conclusive answer though.
 
Last edited:

Honko

he of many honks
is a Site Content Manager Alumnusis a Programmer Alumnusis a Top Contributor Alumnus
I have tested out number 3 on my gold cartridge and it's 1.5 defense boost. I have calcs written down and can scan them in with literal screenshots if necessary. I looked up the item description and it doesn't change over the gens and i have found nothing that indicates it would, so i guess it's safe to assume it doesn't change. I don't have any rse or dpp cartridges by hand so i can't check myself. Serebii for example has the same description for all gens, i don't know how reliable that is though.
I can test out number 2 too, i would have to borrow another cartridge though, because it seems i wasted the sandstorm tm on something i can't find anymore on mine.
Great, thanks!

This took about 30 seconds of Googling to find right off upokecenter. Bottom of the page:

"Finally, in a process called 'damage variance,' unless the damage is 768 or more, a random integer from 217 through 255 is multiplied in the currently calculated damage, and divided by 255."

I can't confirm it but I have to imagine that is probably the original source you found it, I've never heard of this before and don't see it mentioned anywhere else. What is a reliable source anyway? ;[
Hah, I seriously don't know how I missed that.......I was looking all over for my mysterious source and it was right in front of me. Thanks!

For a reliable source, I'm thinking upokecenter, or a guide that gets virtually everything else right (I've seen a couple of good ones on GameFAQs, though not many, and the ones I saw didn't address these specific questions), or an old post from someone who is trusted here and tested it themselves. The only times I don't trust upokecenter are when everyone else disagrees with it. For example, upokecenter says Metal Powder's boost is 1.5x in GSC and 2x in ADV/DPP, but the consensus everywhere else seems to be 1.5x in all gens, which is why I'd ideally like to see it tested. Same kind of situation for the spread moves reduction in ADV.

Does Critical Hits have any impact on 4)?
Nope, it wouldn't matter if it was a critical hit. So a critical hit Rhydon EQ vs. Chansey would be another example of when it could make a difference. If #4 is true, it should always KO, if not it would only KO 90% of the time.
 

Isa

I've never felt better in my life
is a Tournament Director Alumnusis a Social Media Contributor Alumnusis a Community Leader Alumnusis a Community Contributor Alumnus
Good - and on a similar note, it doesn't matter if there's any stat modifiers (Swords Dance, Screech etc.) in play in order to reach the 768 threshold?
 

Honko

he of many honks
is a Site Content Manager Alumnusis a Programmer Alumnusis a Top Contributor Alumnus
Then the only question that remains in my mind is how you get Eggy's Explosion to have a base damage of over 768. For me, it has a maximum of 763, making it not trigger.
https://docs.google.com/spreadsheet/pub?key=0Ar74gDh6yTPPdGZ1SlRrOFRlc09NSjNVT3JMVE9ZaXc&gid=1
Basically, it'd be relevant for only a select choice of Critical Hit moves (Rhydon's EQ most notably), unless I am wrong.
The discrepancy is in the step where attack and defense are divided by 4 if either one is above 255. I'm assuming that the remainders are dropped, which would make Chansey's defense be 13 in the calculation and gives you a max damage of 792. If the remainder is not dropped (or if you completely skip the step where the stats are divided by 4), then Chansey's defense would be 13.5, and the max damage would be 763. What's the source of the calcs in that google doc? I want to make sure I get this right.
 
  • Like
Reactions: Isa

Isa

I've never felt better in my life
is a Tournament Director Alumnusis a Social Media Contributor Alumnusis a Community Leader Alumnusis a Community Contributor Alumnus
I made those calculations myself. Your formula is probably correct, since you have more complex scenarios. I just apply the same formula across the board, and didn't know about the division by 4 that occurs - very interesting.

Judging by past experiences with the RBY damage calculation, the remainders should indeed be dropped from 13.5 to 13.

Thanks a lot for the clarification, I've learned something very useful today!
 
Interesting that you point out the divide by 4 thing, I was going to point it myself too (I just knew it happened in GSC, but I would have assumed it was the same for rby). Anyway, yeah, the result just gets rounded down (you can also see it by the fact that the thick club marowak glitch happens from 1024 attack on, instead of from 1021).

As for the random number not happening for damage above 768 I really had no clue about that. It looks weird to me though, and I couldn't find anything related to that in the code and it looked like the random number is just always applied, but I'll try to find some time to test it in an emulator.

As for SolarBeam it only seems to be affected by rain, but I will try to test it too just to be sure

.WeatherTypeModifiers
db WEATHER_RAIN, WATER, 15
db WEATHER_RAIN, FIRE, 05
db WEATHER_SUN, FIRE, 15
db WEATHER_SUN, WATER, 05
db $ff

.WeatherMoveModifiers
db WEATHER_RAIN, EFFECT_SOLARBEAM, 05
db $ff
 
I don't know what you'll think of this but in generation one there is a 1/256 chance any move misses, so would it make sense to factor that in. (excluding aerial ace or something)
 

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

Top