Talk:Damage: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
Line 110: Line 110:
:::''During the calculation, any operations are carried out on integers internally, such that effectively each division is a [[wp:Rounding#Rounding_to_integer|truncated integer division]] (rounding towards zero, cutting off any decimals), and any decimals are also cut off after each multiplication operation.''
:::''During the calculation, any operations are carried out on integers internally, such that effectively each division is a [[wp:Rounding#Rounding_to_integer|truncated integer division]] (rounding towards zero, cutting off any decimals), and any decimals are also cut off after each multiplication operation.''
:::The order on the user page should be accurate. But again, Choice items are already used to create the Attack ("A") value, and terrains for "Power", those are not incorporated outside anything. I don't think <whatever>-independent minimum damage is really worth calculating, because the rest is just as much part of calculation. But you're of course right, order matters, and that's one of the benefits of the aforementioned userpage. (It's not exactly paper, so if you insist on that, feel free to write it down yourself. :P) [[User:Nescientist|Nescientist]] ([[User talk:Nescientist|talk]]) 22:25, 12 December 2016 (UTC)
:::The order on the user page should be accurate. But again, Choice items are already used to create the Attack ("A") value, and terrains for "Power", those are not incorporated outside anything. I don't think <whatever>-independent minimum damage is really worth calculating, because the rest is just as much part of calculation. But you're of course right, order matters, and that's one of the benefits of the aforementioned userpage. (It's not exactly paper, so if you insist on that, feel free to write it down yourself. :P) [[User:Nescientist|Nescientist]] ([[User talk:Nescientist|talk]]) 22:25, 12 December 2016 (UTC)
::::Ok, so, to clarify, the order is: Weather -> Critical -> random -> STAB -> Type -> Burn -> other ? This would explain getting only 1 damage off a STAB attack from a level 1 (with there being a 1/16 chance of 2 damage). But are you also now saying that Choice items and Terrain boosts affect the attack stat and BP directly? On Showdown it says that a 4x SE STAB attack from a level 1 on a level 100 (min atk, max def) with Choice and Terrain would still hit a minimum damage over 10, but if you take Choice/Terrain out of the multipliers, and factor in the STAB going away (because of the aforementioned random value being multiplied first), the minimum damage should really only be 4, from the 4x SE ((low vals + 2) x 85/100 x 3/2 x 4 minimizes to 4 with int division). Is Showdown's order off, then? To be incredibly specific, I did: Pichu, level 1, attack-reducing nature with 0 IVs/EVs (Atk = 4), Choice Band, Electric Terrain, using Nuzzle (20BP) on a level 100 Gyarados with a defense-increasing nature and max IVs/EVs (Def = 282), and the damage range was 12-16. If the Choice and Terrain are calculated as you say, then the calculation would be (using the Bulbapedia formula, since I don't really understand the bits like "\right" on the user page): ((2x1+10)/250 x (4x1.5)/282 x (20x1.5) + 2) x .85 x 1.5 x 4  =  (12/250 x 6/282 x 30 + 2) x .85 x 1.5 x 4  =  2 x .85 x 1.5 x 4  =  1 x 1.5 x 4  =  1 x 4  =  4. Sooo... Something is off here. Either the Choice/Terrain multipliers DO need to be in the multipliers, or the order of the multipliers is off, or Showdown is wrong. One of the three. --[[User:MASLEGOMAN|MASLEGOMAN]] ([[User talk:MASLEGOMAN|talk]]) 15:46, 14 December 2016 (UTC)

Revision as of 15:46, 14 December 2016

Does the Damage formula below account for critical hits? I don't see any area in it which does, would it be worth noting it?

Nothinhappened 22:03, 13 November 2009 (UTC)

It's noted in the damage modification section. A CH does 2x damage, after the formula has been applied. —darklordtrom 01:40, 15 November 2009 (UTC)

held Item?

It isn't that clear the part that says that some held Items and Berries increase the damage inflicted in other Pokémon! I did understand the formula at the bottom of the page, but there isn't any clear explanation about it. Would someone, please? Exactly where/when would the "extra 20%" bonus of NeverMeltIce apply? YukitoOoO 22:09, 22 November 2009 (UTC)

Move the formula to Modification?

It seems like a good thing to do, because a lot of the stuff here is repeated anyway, and most of what affects the formulas is in the Modification section anyway. Ztobor 03:55, 29 July 2010 (UTC)

Mild contridiction in a very specific criteria

--Noltron200 17:28, 6 August 2010 (UTC)Noltron200

In this page, it says this "Critical is 2 for a critical hit, 1 otherwise. For Pokémon with Sniper, it is 3 for a critical hit. " in the series of bullet notes.

In the description of Sniper, in the Sniper(ability) page, it says this "Sniper multiplies the base power of an attack 1.5× during a critical hit. "

Becuase the damage equation goes " ...×base + 2)×Modifier ", the first source would multiply the +2 by two, meanwhile the second source would not, becuase it multiplies the move's base attack, and than is added by two.

Merely 2 points difference, but its something to consider.

Double/Triple Battle?

In the other section of the formula, it states "other counts for things like held items, Abilities, field advantages, and whether the battle is a Double Battle or Triple Battle or not." What effect does being a double or triple battle have on damage? I understand targeting differences, but not damage. Can someone help me with this? (Arcalargo (talk) 15:30, 7 December 2014 (UTC))

Some moves, such as Flame Burst, which affect non-targeted Pokémon with indirect damage. There are also abilities such as Friend Guard that affect damage taken by allies. While it's not the double or triple battle itself that has any effect on damage, there are factors that only apply outside of single battles. --GuyPerfect (talk) 15:39, 7 December 2014 (UTC)
So to confirm, there isn't really anything about the double or triple battle itself. Its just abilities(which are already listed) that effect damage, correct? - unsigned comment from Arcalargo (talkcontribs)
I would imagine the damage part refers to the damage penalty that moves like Surf incur. Tiddlywinks (talk) 18:32, 7 December 2014 (UTC)
Derp, I missed that when I was reviewing damage, thank you(Arcalargo (talk) 18:34, 7 December 2014 (UTC))

Zero damage?

Umm, well I was reading a bit about the damage formula and at some point the zero damage got my curiosity, since it was done in a Black/White version I wanted to try it on a X/Y version.

I tried this with a Lv 100 Steelix with 469 Defense, aditionally it has Reflect and x6 boost on Defense, againts a Zigzagoon Lv 2.

I didn't made the formula, knowing the advantage of type (Which make 0,50), Reflect and the Defense boost it SHOULD hit zero.

In the video I've seen a Lv 100 Celebi which can have a max of 328 plus a reflect and nothing more, so the max Defense it can have is of 492 (Adding the 50% of the Reflect), got hitted by Tackle from a Lv 4 Lillipup, I expect the Lillipup Attack would be around 5~9

Knowing that the set I used was obviously better I made the formula for this one, I don't know if I've done the formula correctly (If someone can help me, I'd be pleased), so here it go:

( 2 * 4 + 10 ) / 250 = 0,072, that's the first value.

5~9 / 492 = 0,010162602~0,018292683, that's the second value (Note it's 492 and not 328 because I'm adding the effect of Reflect, which is a 50% plus to 328).

All together it should be something like:

0,072 * 0,010162602~0,018292683 * 50 + 2 = 2,036585367~2,065853659

Then adding the multiplier of Modifier:

1,5 * 1 * 1 * 1 * 0,85~1 = 1,275~1,5

With the first result:

2,036585367~2,065853659 * 1,275~1,5 = 2,596646343~3,098780488

Celebi should receive at least 2 or 3 of damage if it rounded down.

So here's my questions:

1. Did I do something wrong in the formula?

2. Maybe it is only possible on Gen V and prior to it?

3. If the last Question is no, why my Steelix keep getting 1 damage?

4. It's some kind of joke or something? >____>

Yeah, I was really bored to do all this instead of my math HW >.>

MilesPikachu (talk) 18:47, 6 January 2015 (UTC)

Is 'Base damage' just Power?

The Damage formula section keeps referring to the 'Base damage' of the attack, but it doesn't explain what this is. Based on this site, it seems like 'Base damage' is actually Power. If so, obviously it should be changed to say Power, but if not, there should be an explanation of what 'Base damage' is.

RolandRock (talk) 00:35, 21 January 2015 (UTC)

Some people use the phrase "base damage" to mean the damage before the modifier is applied. Stats1989 (talk) 01:39, 12 August 2016 (UTC)

Attacks that hit multiple times?

How would attacks like Triple Kick or Bullet Seed that hit more than once effect the damage formula? --Rwars (talk) 15:58, 15 April 2015 (UTC)

They do not change the formula, each hit has its own critical hit chance/damage. There is a separate check before the critical check to see how many hits occur, but no modification to the damage formula itself. The odd one out in this case though is Triple Kick as its power increases with each hit, so the move's power part of the formula changes with each hit. (Arcalargo (talk) 16:05, 31 March 2016 (UTC))

Damage Rounding

According to dragonflycave's page on battle mechanics, not counting machine rounding to the nearest 4096th, there are three times when damage is rounded down to the nearest integer before the final result is rounded down a fourth time. [This is based on the formula: damage = ((2*L/5 + 2)*A*P/D)/50 + 2) * multiplier, which is equivalent to the one we have now except for rounding.] One is after calculating (2*level/5 + 2), one is after multiplying this result by the attacker's offensive stat and the base power and dividing by defender's defensive stat, and one is after dividing this result by 50. Three things stand out about this process: First, that rounding down after multiplying level by 2/5 and adding a constant has the same effect as rounding level down to the nearest number that is either a multiple of 5 or two less than a multiple of 5. That is, the thresholds for when this will be rounded to a higher integer are at levels 3, 5, 8, 10, 13, 15, 18, 20, 23, 25, 28, 30, 33, 35, 38, 40 etc. Second, that the second rounding doesn't matter. If you round down to the nearest integer, then divide by 50 and round down to the nearest integer again, the result should be the same as if you just divided by 50 and rounded down after dividing by 50. And third, that the third rounding would have the same effect if it was performed at any time after dividing by 50 and before applying the modifier, since the rest is just adding constants. Thus, these three roundings appear to be able to be summarized as follows: level is rounded down to the nearest integer that ends in a 0, 3, 5, or 8, and base damage is rounded down before the modifier is applied. I am not taking into account the exact form in which the machine stores numbers, which is much more accurate in most cases than rounding to the nearest integer. Stats1989 (talk) 01:39, 12 August 2016 (UTC)

Well, yes, somehow. "Rounding down" after each division is just a way how Dragonflycave tries to express/explain that any division is actually a truncated integer division (rounding towards zero, cutting off any decimals) by the machine. (The statement about the level threshold is true.) The second "rounding" does matter, though, and you basically said it: ...as if you just divided by 50 and rounded down (...) (notice how you still need to actually "round down"). If I understand your third statement correctly, it is also not true: Suppose you have a value of 3.61 and want to multiply it by 2. It you first round down, then multiply, you will get 6, whereas if you first multiply, then round down, you will get 7.
(Also, if you haven't, please take a look at what I wrote at your talk page.) Nescientist (talk) 09:18, 12 August 2016 (UTC)

1. The second rounding is after multiplying the level multiplier by the stat effects and the base power of the move. The third rounding is after taking the result of the second rounding and dividing by 50. The second rounding would appear to not matter because if you take any number, round down, then divide by 50 and round down again, the result is the same as if you just divided by 50 and then rounded down. Rounding down twice in between calculating the level multiplier and applying the modifier (which is what happens with the second and third roundings) appears to be equivalent to rounding down once during this time. 2. If you re-read what I said, I said that applying the third rounding at any time after dividing by 50 but before applying the modifier is equivalent. In other words, rounding down before adding the +2 damage that is independent of stats is equivalent to rounding down after adding the +2 but before multiplying by type effectiveness etc. Obviously, you are correct that rounding after you multiply is different from rounding beforehand, but what I said is that it doesn't matter whether you round before or after adding the +2.

In summary, saying "round down once after calculating L*(2/5)+2, a second time after multiplying this result by A*P/D, and a third time after dividing this result by 50, then add 2 to the result, then multiply that result by multiplier" is equivalent to saying "round down once after calculating L*(2/5), then add 2 to the result, then multiply that result by A/D*P and add 2 to the result, then round down, then multiply by the multiplier." This is, in turn, equivalent to saying "Take floor of (L+5)*2/5, times (A/D)*P/50, round down, then add 2, then multiply the result by the multiplier." There are many ways to describe the formula and rounding (or at least the integer floor rounding, which is more important than the rounding to the nearest 4096th) accurately, so whichever is clearest and easiest to express visually is fine. I just think that we should either write the formula in a way that shows the integer flooring (or is consistent with the integer flooring), or mention it in the text. Unfortunately, at the moment we have a visual formula that doesn't show the rounding OR write it in a way that is consistent with how the rounding occurs, and the text doesn't mention the rounding either. If you look at how it is currently done in the Statistic page when discussing how a stat value is calculated in Gen I-II, the formula is written in a way that is inconsistent with the rounding (but consistent with how the formula for Gen III+ is written), but the value that is rounded by the game is still mentioned in the text. Stats1989 (talk) 13:43, 12 August 2016 (UTC)

I guess some of your statements are still imprecise (or rather badly worded), but let's just say we apparently all agree (and are dissatisfied) that the current state of the article is missing all rounding issues. That's why we (and I in particular) invested quite a lot of time trying to improve it (as can be seen from your talk page). So please be a little patient. (And from what I can tell by looking at it rather briefly, the stats page seems to be consistent with having integer division visualized/rewritten as division+flooring.) Nescientist (talk) 17:07, 12 August 2016 (UTC)

Minimum 2 damage?

In the above discussions many people talked about rounding, but looking over the formula, I can see some very simple cases in which, no matter how I round, I always get minimum damage values greater than 1. For example, any STAB attack that hits with neutral effectiveness should should always hit with at least 2 damage, even if it was a level 1 Rattata using Tackle on a level 100 Avalugg. No amount of rounding can reduce the first half of the equation (factoring in level, stats, and base power) below 2, thanks to the +2 at the end, so if remaining modifiers increase the random value above 1, the damage shouldn't be able to go below 2 (which should be guaranteed with the 1.5x STAB multiplier). And yet, testing this theory in-game, I have easily found low-level Pokemon that can't do more than 1 damage with neutrally-effective STAB moves. The only explanation I can think of is if they apply the random value and floor before any other multipliers, but even then it should be very possible to get guaranteed 2+ damage from other multipliers, such as hitting with a 2x SE attack. Extrapolating from this, enough multipliers (let's say STAB, Choice Band/Specs boost, Terrain boost, and 4x effectiveness) should be able to raise the minimum damage well over 10, regardless of the actual attack power, stats, or level difference. Is there some explanation for my initial STAB question, and/or confirmation of such high minimum damages? --MASLEGOMAN (talk) 16:09, 12 December 2016 (UTC)

That's because this page doesn't use the actual formula with all the right placed to round. That's one of the reasons I made User:Nescientist/Damage, where everything should be in correct order (at least after Gen III, I think) and rounding issues are mentioned (at least) in prose. The random multiplier seems to precede STAB (explains your problem); Choice items' boosts boost "Attack" or "Special Attack", and Terrains boost "Power" (that's all inside the +2 thing). In both official and Bulbapedia wording (hopefully), if something is said to boost a stat, then those really boost the stat within the formula; only if it says it boosts damage, there's something within the formula. Hope that helps! Nescientist (talk) 17:35, 12 December 2016 (UTC)
Confirming that the random multiplier happens first does help, yes. I just wish the exact order was laid out on paper somewhere. Does this mean that each multiplier gets multiplied in and truncated individually? If so, then that would mean that, if the damage is reduced to 1, a series of 1.5 multipliers would effectively be ignored, depending on if they came before bigger multipliers or not. For example, if damage hits 1 and then STAB, Terrain, and Choice Band/Specs are applied, it would be floor(floor(floor(1 x 1.5) x 1.5) x 1.5) = 1. But if damage hit 1 and a super-effective multiplier of 2 (or 4) was applied FIRST, each of the other multipliers would increase the value: floor(floor(floor(floor(1 x 4) x 1.5) x 1.5) x 1.5) = 13. It would be even higher if the random value got applied later or last, and the initial damage started at 2. Thus we can get a guaranteed, level/stat/BP-irrelevant final damage of anything from 1 to 13+ depending entirely on the order in which the game factors in multipliers, so it seems a little important to clarify said order. --MASLEGOMAN (talk) 20:49, 12 December 2016 (UTC)
During the calculation, any operations are carried out on integers internally, such that effectively each division is a truncated integer division (rounding towards zero, cutting off any decimals), and any decimals are also cut off after each multiplication operation.
The order on the user page should be accurate. But again, Choice items are already used to create the Attack ("A") value, and terrains for "Power", those are not incorporated outside anything. I don't think <whatever>-independent minimum damage is really worth calculating, because the rest is just as much part of calculation. But you're of course right, order matters, and that's one of the benefits of the aforementioned userpage. (It's not exactly paper, so if you insist on that, feel free to write it down yourself. :P) Nescientist (talk) 22:25, 12 December 2016 (UTC)
Ok, so, to clarify, the order is: Weather -> Critical -> random -> STAB -> Type -> Burn -> other ? This would explain getting only 1 damage off a STAB attack from a level 1 (with there being a 1/16 chance of 2 damage). But are you also now saying that Choice items and Terrain boosts affect the attack stat and BP directly? On Showdown it says that a 4x SE STAB attack from a level 1 on a level 100 (min atk, max def) with Choice and Terrain would still hit a minimum damage over 10, but if you take Choice/Terrain out of the multipliers, and factor in the STAB going away (because of the aforementioned random value being multiplied first), the minimum damage should really only be 4, from the 4x SE ((low vals + 2) x 85/100 x 3/2 x 4 minimizes to 4 with int division). Is Showdown's order off, then? To be incredibly specific, I did: Pichu, level 1, attack-reducing nature with 0 IVs/EVs (Atk = 4), Choice Band, Electric Terrain, using Nuzzle (20BP) on a level 100 Gyarados with a defense-increasing nature and max IVs/EVs (Def = 282), and the damage range was 12-16. If the Choice and Terrain are calculated as you say, then the calculation would be (using the Bulbapedia formula, since I don't really understand the bits like "\right" on the user page): ((2x1+10)/250 x (4x1.5)/282 x (20x1.5) + 2) x .85 x 1.5 x 4 = (12/250 x 6/282 x 30 + 2) x .85 x 1.5 x 4 = 2 x .85 x 1.5 x 4 = 1 x 1.5 x 4 = 1 x 4 = 4. Sooo... Something is off here. Either the Choice/Terrain multipliers DO need to be in the multipliers, or the order of the multipliers is off, or Showdown is wrong. One of the three. --MASLEGOMAN (talk) 15:46, 14 December 2016 (UTC)