1. The moderator of this forum is Jellicent.
  2. Welcome to Smogon Forums! Please take a minute to read the rules.
  3. Click here to ensure that you never miss a new SmogonU video upload!

[on site] The Complete Damage Formula for Diamond & Pearl

Discussion in 'Archives' started by X-Act, Jul 18, 2007.

  1. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    A million thanks! I'm looking at those numbers right now.

    Hmm. Peterko, this means that this uses the same x0.75 as for Surf, right? So that means that test is a success. :)

    EDIT: Added Stomp information as a move with varying BP. Also, moves that hit both foes use the same x0.75 modifier as that used for moves that hit all Pokemon in 2vs2.

    EDIT 2: Added freshly-researched information about Trump Card and Spit Up.
  2. Peterko

    Peterko Never give up!
    is a Researcher Alumnusis a Contributor Alumnus

    Joined:
    Sep 20, 2005
    Messages:
    1,070
    this will be added the next time X-Act is on

    Stockpiled 1 Spit Up = 100 BP
    Stockpiled 2 Spit Up = 200 BP
    Stockpiled 3 Spit Up = 300 BP

    spit up ignores the random number between 85 and 100 in the damage formula, you will only do max damage

    Trump Card:
    5 PP : 40 BP
    4 PP : 50 BP
    3 PP : 60 BP
    2 PP : 80 BP
    1 PP : 200 BP

    info about spit up and trump card posted in the research topic

    http://www.smogon.com/forums/showthread.php?p=529704#post529704
  3. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    Okay. We're at the point where if the Pokemon in question doesn't change its type (via Color Change, Camouflage, etc.) and/or ability (via Skill Swap, etc.), the damage formula is complete, to the best of our knowledge.

    Thanks to everyone who has made this possible... although Peterko gets at least 95% of the thanks.
  4. Arseus

    Arseus
    refuses to accept Contributor

    Joined:
    Oct 13, 2006
    Messages:
    869
    That's awesome guys! Though knowing GameFreak, there's bound to be something down the road that will be found and need fixing :P

    One question, with the stat modifiers, how is the rounding done? Like, if a Pokémon with 123 Attack got a +1 modifier, the stat would be 184.5 Obviously, we can't have a .5 stat, so the game would have to round it. I would assume the rounding would be done traditionally (ie. up if it's 5 or above, down for the rest), but with GameFreak you never know. I mean, it could be something obscure for all I know, like "always round down if a stat is being raised" and vise versa or something like that. It probably doesn't make much difference in the long run, but I'd just like to know.
  5. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    First of all, 123 attack gets to 184 with a +1 modifier, not +2.

    Secondly, note: the stat would become 184. Pokemon uses what is called integer division in mathematics. You can read more about integer division here. It uses integer division for every calculation, basically.

    In reality, Pokemon does not multiply by decimals, either. For example, in the example for the +1 stat modifier above, the game doesn't really multiply by 1.5. What it really does is multiply by 3, and then "integer divide" by 2. (That's why I wrote 3/2 next to the modifier). We prefer to multiply by 1.5 and then "round down" (technically, use the floor function) the answer because it's easier that way, for us humans.

    Also, it does make a lot of difference. Just ask those people who would love to outspeed certain things. A difference of 1 in speed can make a hell of a lot of difference. That's why Speed IVs are arguably the most important ones to get 31 in.
  6. Arseus

    Arseus
    refuses to accept Contributor

    Joined:
    Oct 13, 2006
    Messages:
    869
    Woops, sorry, by bad. I did mean +1, I'm not a total idiot, for some reason I put +2. Also, yeah, I guess it would make a difference in Speed, but for the actual damage formula, 1 point in Attack won't do a lot of harm. Good to know about the rounding thing.
  7. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    It's okay, I did not intend to belittle you. I was just pointing out your slight mistake.
  8. MetalKid

    MetalKid

    Joined:
    Aug 5, 2005
    Messages:
    247
    Alright, I'll get started on updating my D/P Damage Calculator to use the information you've found. I'll have to give credit to you guys for putting such a big thing together. I wonder if I can figure out how to work with Ajax so that the group boxes can auto fill with stuff specific to the Pokemon you select without having to postback the entire damn page...


    Edit:
    Oh man, this is going to take forever... lol...
  9. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,152
    Does Guts + Burn truly bypass the Attack drop, or does it like still divide for the drop, then multiply to remove it, or does it do some other strange method?
  10. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    A Guts Pokemon is not negatively affected by Burn... it is actually affected positively (it just gets the Guts boost and not the Burn drop).
  11. Blizzard1

    Blizzard1

    Joined:
    Feb 7, 2007
    Messages:
    380
    You might put Facade in here as a variable-base-power move just for completeness.
  12. Peterko

    Peterko Never give up!
    is a Researcher Alumnusis a Contributor Alumnus

    Joined:
    Sep 20, 2005
    Messages:
    1,070
    ehm...it is there and was there from the beginning
  13. Mekkah

    Mekkah
    is a Super Moderatoris a Tutor Alumnusis a Site Staff Alumnusis a Live Chat Contributor Alumnusis a CAP Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
    Super Moderator

    Joined:
    Feb 8, 2005
    Messages:
    14,254
    It seems my Ctrl-F just doesn't see it then.
  14. Peterko

    Peterko Never give up!
    is a Researcher Alumnusis a Contributor Alumnus

    Joined:
    Sep 20, 2005
    Messages:
    1,070
    LOOL I told X-Act he shouldn´t write it that way :D :D :D

    Façade - BP = 140 if the user is Paralyzed, Poisoned, or Burned, BP = 70 otherwise.
  15. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,152
    If you have two Pokemon with Flower Gift, is it 1.5, 2, 2.25, or 1.5 x 1.5 (rounded down at each step)?
  16. Fiyaaaah!

    Fiyaaaah!

    Joined:
    Aug 11, 2007
    Messages:
    61
    Isn't it possible to increase the PP of Trump Card to 8? I don't know why anyone would do that, but how would that affect its power?
  17. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,152
    It still has 40 power.
  18. .River

    .River

    Joined:
    Jun 24, 2007
    Messages:
    1,274
    You might want to add a calculation for Fury Cutter, Ice Ball and Rollout:

    Fury Cutter:

    Base Power = 10*(2^(n-1))
    Where 'n' equals Fury Cutter number.

    Ice Ball and Rollout (If Defense Curl has been used):

    Base Power = 60*(2^(n-1))
    Where 'n' equals Ice Ball/ Rollout number.

    Ice Ball and Rollout (If Defense Curl has not been used):

    Base Power = 30*(2^(n-1))
    Where 'n' equals Ice Ball/ Rollout number.


    Hope I helped :D.

    EDIT:

    Also, concerning the calculations of Punishment..

    60+(20*Number of opponent's positive Stat modifiers)

    By Stat Modifier you mean the -6 to +6 (in this case, 1 to 6)

    Let's look at it from 6 positive Stat Mods:

    60+(20*6)
    60+120
    180

    You also say that it is capped at 200. This I don't see as the max number is actually 200, so it wouldn't go any higher anyway.

    For those of you who don't know why it is 200 and not 180, it's because the number 6 (positive stat mods) actually includes the number 1 which would not change a value when multiplying any amount of numbers.

    In plain English:

    Lets say that we were using Punishment to the extent of 1 Positive Stat Mod. You would straight away think of the following formula:

    60+(20*1)
    60+20
    80

    As you can see there was no change to the BP.

    Which means if you did have 6 Stat Mods it would actually use the following formula:

    60+(20*7)
    60+140
    200

    That is it's full potential.

    Before I finish, I also need to state what happens if there are no positive Stat Mods. Normally you would`yse the following formula:

    60+(20*0)
    60+0
    60

    So, for 0 Stat Ups, is the power 0, and for 6 Stat Ups, is the Power 200?

    EDIT:

    Just realised, if what I have said about Punishment can be confirmed then you can use the following formula, and instead of adding 1 to the Stat Mod number, leave it as it is.

    What I mean is, above I said that if you were to check the BP for Punishment with 6 Stat Mods, you would have to use the number 7, instead of 6.

    Now, you can use 6 for 6 Stat Mods so there is no confusion:

    60+(29*(n+1))
    Where 'n' equals the number of positive Stat Mods.

    it's not much of a difference, but it helps.
  19. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    That is fine, but I think it's easier explained the way it's written in the guide.

    Umm, Punishment takes care of all the positive stat changes of the foe, not just one of them. That's why its power could exceed 200 if it is not programmed such that 200 is the highest damage allowed.
  20. .River

    .River

    Joined:
    Jun 24, 2007
    Messages:
    1,274
    So then what are the positive Stat Changes that the opponent can have?

    It can have a max of 6 level increments but thats all I can think of, which gives it a total of 200 power.


    Also, I found an error in your formula when inputting it in Excel:

    You say that after each operation you need to round the number down to a significance of 0 (0dp).

    Following the BODMAS rule you calculate what's embedded in brackets and then use the operating signs.

    So:

    Damage Formula = ((((((Level × 2 ÷ 5) + 2) × BasePower × [Sp]Atk ÷ 50) ÷ [Sp]Def) × Mod1) + 2) × CH × Mod2 × (R ÷ 100) × STAB × Type1 × Type2 × Mod3

    Look at what's in bold. Let's say the Random Number was between 85 and 99. you do the division and you get any number between .85 and .99 . You round that number down to 0, and I guess you see the problem there.. Then you do 'x CH x Mod2 x 0, and your final answer will be.. 0.

    I know there is something I am missing because after a bit of tweaking in Excel, I got past this so it is probably a Mathmatical error on my side, you can't blame me, I'm only 14...

    Anyway, hope you can tell me what I did wrong from there..
  21. strager

    strager

    Joined:
    Jun 1, 2005
    Messages:
    37
    I'm pretty sure he meant the formula to be:
    Damage Formula = ((((((Level × 2 ÷ 5) + 2) × BasePower × [Sp]Atk ÷ 50) ÷ [Sp]Def) × Mod1) + 2) × CH × Mod2 × R ÷ 100 × STAB × Type1 × Type2 × Mod3

    That is, the division removes the last two digits from the previous result. Perhaps a more clear way of writing it would be:
    ((((((((Level × 2 ÷ 5) + 2) × BasePower × [Sp]Atk ÷ 50) ÷ [Sp]Def) × Mod1) + 2) × CH × Mod2 × R ÷ 100) × STAB × Type1 × Type2 × Mod3)

    In such case, you round down after every sub-expression.
  22. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,152
    .River, if my Salamence uses Dragon Dance 6 times, it has +6 Attack and +6 Speed. This is a total of 12 stat increases (6 + 6).
  23. .River

    .River

    Joined:
    Jun 24, 2007
    Messages:
    1,274
    Oh man, I thought it meant only for the attacking stat (my bad..)

    Oh yeah, using that, in one of the modifiers it multiplies Life Orb with TVT.

    In most cases TVT will be left as 1 so it will be 1.3 x 1 = 1.3 . Round that down to 1, so does that mean that Life Orb doesn't actually do anything?

    EDIT:

    Same with the Modifier where Expert Belt resides.
  24. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Live Chat Contributor Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    I fixed the damage formula slightly.

    However, it must be said that the damage formula as listed here is always 'wrong', in the sense that it never uses decimals. So it never really multiplies by 0.5, or by 0.75, or by 1.5 or whatever.

    I also fixed the variable moves list a bit with confirmed information.
  25. .River

    .River

    Joined:
    Jun 24, 2007
    Messages:
    1,274
    So does this mean when putting Life Orb and such into account, it will never work?

Users Viewing Thread (Users: 0, Guests: 0)