Sapphire Damage Calc
Sapphire Damage Calc
in all the time i've spent running i've tried using several different online damage calculators, the best of which i found to be the one at pokemon showdown, but it presented its own issues as well.
naive as i was to the topic of damage calculation i didn't realize (but found out after reading this nifty article) that a lot more goes into the damage output than just offensive stats, defensive stats, base power, and type matchups. for example, i found out that the attacking pokemon's level is directly factored into the calculation, meaning that, say, a lv. 26 marshtomp with 61 atk figures into the calculations differently from a lv. 28 marshtomp with the same atk stat (due to a lower IV, say). this has been a problem for me since, without any way to directly indicate badge boost in a lot of these calculations, i've had to manipulate things like the pokemon's level to artificially raise their stats to indirectly factor in the 10% badge boost, which skews things in the wrong way.
another thing that wasn't clear to me was how things like mystic water and soft sand are factored into these calcs. the wording in the games is ambiguous at best ("a hold item that raises the power of watertype moves"), and regardless, the numbers that i was getting weren't matching my experience in runs.
anyway, in short, i've written a very short, simple, inelegant python script to do gen 3 (specifically r/s/e, not sure about fr/lg) damage calculations. it doesn't cover everything, and is strictly only useful from a speedrunning perspective (if you read that article, it has a list of like 40 steps in damage calculation, most of which obviously don't apply to our two pokemon of choice, kip and ogre), but at the very least it appropriates mystic water/soft sand boosts, badge boosts, pokemon level, etc. correctly, and has spit out the right numbers for me so far.
i'm just posting here in case anyone is interestedi know vincento made a thread a while back but it never went anywhere. it's written in python 2.7 which is really easy to download and run. i can put it on dropbox if people want.
EDIT: crucially, it doesn't include things like torrent, mostly bc i set out to write it initially for calcs in the lategame, where torrent is of little (intentional) use and bc torrent strats are extremely straightforward in the early game regardless of anything you know about your stats. it's something i could easily add, however.
naive as i was to the topic of damage calculation i didn't realize (but found out after reading this nifty article) that a lot more goes into the damage output than just offensive stats, defensive stats, base power, and type matchups. for example, i found out that the attacking pokemon's level is directly factored into the calculation, meaning that, say, a lv. 26 marshtomp with 61 atk figures into the calculations differently from a lv. 28 marshtomp with the same atk stat (due to a lower IV, say). this has been a problem for me since, without any way to directly indicate badge boost in a lot of these calculations, i've had to manipulate things like the pokemon's level to artificially raise their stats to indirectly factor in the 10% badge boost, which skews things in the wrong way.
another thing that wasn't clear to me was how things like mystic water and soft sand are factored into these calcs. the wording in the games is ambiguous at best ("a hold item that raises the power of watertype moves"), and regardless, the numbers that i was getting weren't matching my experience in runs.
anyway, in short, i've written a very short, simple, inelegant python script to do gen 3 (specifically r/s/e, not sure about fr/lg) damage calculations. it doesn't cover everything, and is strictly only useful from a speedrunning perspective (if you read that article, it has a list of like 40 steps in damage calculation, most of which obviously don't apply to our two pokemon of choice, kip and ogre), but at the very least it appropriates mystic water/soft sand boosts, badge boosts, pokemon level, etc. correctly, and has spit out the right numbers for me so far.
i'm just posting here in case anyone is interestedi know vincento made a thread a while back but it never went anywhere. it's written in python 2.7 which is really easy to download and run. i can put it on dropbox if people want.
EDIT: crucially, it doesn't include things like torrent, mostly bc i set out to write it initially for calcs in the lategame, where torrent is of little (intentional) use and bc torrent strats are extremely straightforward in the early game regardless of anything you know about your stats. it's something i could easily add, however.

 Schoolkid
 Posts: 25
 Joined: Fri May 09, 2014 10:59 pm
Re: Sapphire Damage Calc
Where's the link?
 roushmore917
 Schoolkid
 Posts: 40
 Joined: Thu Jul 31, 2014 8:14 am
Re: Sapphire Damage Calc
I've never trusted any of the damage calculators for generation three for one reason: they all conflict with each other.
For example: smogon's double battle multiplier uses either 75 or 66% (forgot which, but regardless)... and most of the other ones have issues with these hold items.
How I do my calculations (which I tested with BafflingAmoeba and RXFadez for about 4 hours straight) is i simply take the damage formula (you can find on bulbapedia), and simply take all of my own modifiers (10% for soft sand/mystic water, 50% for double battles [TESTED], and 10% for badge boosts as needed). I'm not sure if anyone POSTED their own calculator, but I just got bored one day and programmed it into a graphing calculator... but if you need help taking calcs, I'd be willing and able to help.
For example: smogon's double battle multiplier uses either 75 or 66% (forgot which, but regardless)... and most of the other ones have issues with these hold items.
How I do my calculations (which I tested with BafflingAmoeba and RXFadez for about 4 hours straight) is i simply take the damage formula (you can find on bulbapedia), and simply take all of my own modifiers (10% for soft sand/mystic water, 50% for double battles [TESTED], and 10% for badge boosts as needed). I'm not sure if anyone POSTED their own calculator, but I just got bored one day and programmed it into a graphing calculator... but if you need help taking calcs, I'd be willing and able to help.
Re: Sapphire Damage Calc
Did we ever figure out this? I remember us getting the tnl strat finalized but I though we still didn't have a doubles damage modifier value that worked with all our values from testing?roushmore917 wrote:50% for double battles [TESTED].
~
Re: Sapphire Damage Calc
I believe moves that hit opponents (i.e. Surf) do 50% in gen 3, whereas moves that hit the entire floor (i.e. EQ) do 100% in doubles
Re: Sapphire Damage Calc
0.5 is currently the multiplier we've been using. We never confirmed this and I believe it is slightly more. The point is that Bulbapedia and everyone else has the wrong multiplier (at least for Gen3)
Re: Sapphire Damage Calc
Exactly 50% is consistent with my testing/runs in Sapphire and Emerald. I haven't done enough testing to definitively prove this, however.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ
Re: Sapphire Damage Calc
bulbapedia damage calc is inaccurate. can tell by the fact that i believe they only list one formula, and obviously damage calculations aren't the same across generations. my calculator is written following the exact steps of gen 3 damage calculation in order as listed in this article: Pokémon Ruby Version, Sapphire Version, and Emerald Version – Damage Calculation
as for moves that hit multiple opponents, from the article above:
link to the calc is here: Sapphire Damage Calculator v2.py
take note that it is not expertly programmed lol and imo is sort of cumbersome to use. exarion mentioned to me that he uses an excel script to do damage calculations, which is much faster than this, bc depending on the specific calc you're doing, this program will ask you a number of questions that don't apply, just slowing down the process (esp if you want to test damage output at a number of different stat values/levelsyou'll have to restart the calc multiple times to do so). additionally, the calc was initially written with offensive calcs in mind, so while it does ask "does badge boost apply?", this is asking whether an OFFENSIVE badge boost applies (i.e. stone badge for physical damage, mind badge for special damage). therefore, if you would like to calc how much a move does to swampert, you'll have to account for the DEFENSIVE badge boost yourself (again, stone badge for physical defense, mind badge for special defense). the rest should work the same, such as accounting for the foe's stab, typeeffectiveness, etc.
if any more codesavvy individual would like to improve upon this, please be my guest. at the very least i hope it's sort of lifted the cloud over gen 3 damage calcs, bc for a long time i was having similar confusions to what roush said.
EDIT: to make light of why step 29 in the upokecenter article is a little different from what people have said, it's bc of WHEN in the calculation it's accounted for. the "base damage" formula, so to speak, as listed in the article and used in my calc is int(int(int(2*L/5+2)*A*P/D)/50). it is only after this is calculated that a number of modifiers are applied, but in a very specific order. in this case, double battle damage modifier is applied before several other steps, including weather modifiers, stab, and the damage variance itself (85100%).
as for moves that hit multiple opponents, from the article above:
not sure how this is affected in the kind of situation werster pointed out (gen 3 surf hits just the two opposing pokes, whereas EQ hits the ally as well), but the best i can say is for our purposes it hasn't been necessary (esp in saf where there's only a single forced double battle).29. If the attack targets “all opposing Pokémon” and there were two Pokémon on the opposing Pokémon’s side as the attacker began to use the move, divide the calculated damage by 2.
link to the calc is here: Sapphire Damage Calculator v2.py
take note that it is not expertly programmed lol and imo is sort of cumbersome to use. exarion mentioned to me that he uses an excel script to do damage calculations, which is much faster than this, bc depending on the specific calc you're doing, this program will ask you a number of questions that don't apply, just slowing down the process (esp if you want to test damage output at a number of different stat values/levelsyou'll have to restart the calc multiple times to do so). additionally, the calc was initially written with offensive calcs in mind, so while it does ask "does badge boost apply?", this is asking whether an OFFENSIVE badge boost applies (i.e. stone badge for physical damage, mind badge for special damage). therefore, if you would like to calc how much a move does to swampert, you'll have to account for the DEFENSIVE badge boost yourself (again, stone badge for physical defense, mind badge for special defense). the rest should work the same, such as accounting for the foe's stab, typeeffectiveness, etc.
if any more codesavvy individual would like to improve upon this, please be my guest. at the very least i hope it's sort of lifted the cloud over gen 3 damage calcs, bc for a long time i was having similar confusions to what roush said.
EDIT: to make light of why step 29 in the upokecenter article is a little different from what people have said, it's bc of WHEN in the calculation it's accounted for. the "base damage" formula, so to speak, as listed in the article and used in my calc is int(int(int(2*L/5+2)*A*P/D)/50). it is only after this is calculated that a number of modifiers are applied, but in a very specific order. in this case, double battle damage modifier is applied before several other steps, including weather modifiers, stab, and the damage variance itself (85100%).

 Schoolkid
 Posts: 25
 Joined: Fri May 09, 2014 10:59 pm
Re: Sapphire Damage Calc
Great, thanks.
Python is way better than Excel to do mass damage calculations (especially if you only vary 1 parameter at the time). I have a script for gen4 and one for gen5 that does mass calculation. I'll see if I can write a script for gen 3 too.
Python is way better than Excel to do mass damage calculations (especially if you only vary 1 parameter at the time). I have a script for gen4 and one for gen5 that does mass calculation. I'll see if I can write a script for gen 3 too.
Re: Sapphire Damage Calc
no problem. and yeah, i guess what i meant was that the way mine is written, it seems slow and hard to use. if you could write it to do mass calculations across a few values for one specific parameter (atk, lv., etc.) then it would be considerably more useful. i just haven't coded in a long time (and was shit to begin with ).
interested to see what you come up with.
interested to see what you come up with.
Who is online
Users browsing this forum: No registered users and 3 guests