Damage overflow to negative values is possible in Pokemon Champions via 32-bit signed integer overflow.
The setup for this was possible by assuming 32-bit signed integers were being used when storing numbers relevant to damage calculation. I show overflow setups with Metronome (the item) and a combination of Metronome + Fluffy. Among other things, this is pretty solid confirmation to me that 4096-scaled modifiers are still being used in Pokemon Champions.
In the first setup, I used a Mega Floette with 227 SpA, and full 860 BP Stored Power into -6 101 Sp. Def Sneasler. Without overflow, I expected these possible damage rolls:
[46732, 47280, 47832, 48380, 48932, 49480, 50028, 50580, 51128, 51680, 52228, 52780, 53328, 53880, 54428, 54980]
I did the exact same thing in the second setup, but used Magic Powder on Floette to give Stored Power STAB. Without overflow, I expected these possible damage rolls:
[70096, 70920, 71748, 72568, 73396, 74220, 75040, 75868, 76692, 77520, 78340, 79168, 79992, 80820, 81640, 82468]
It is not obvious to me where these battle log numbers are coming from. They aren't consistent, so I assume it's got to be related to the specific damage roll in some way. I did hit one of the numbers in the Pikachu setup twice. For now, I'll just document them:
The setup for this was possible by assuming 32-bit signed integers were being used when storing numbers relevant to damage calculation. I show overflow setups with Metronome (the item) and a combination of Metronome + Fluffy. Among other things, this is pretty solid confirmation to me that 4096-scaled modifiers are still being used in Pokemon Champions.
Overflowing with Electric-type Stored Power
Average LC Enjoyer messaged me about a setup they tried in Champions to deal maximum damage. I recommend reviewing the raw footage (one) (two) they sent me (in the video they talk about using Power Split but didn't actually pull it off in the 20-minute time limit).Details and math
In this setup:
Final BP: 3354
Final Atk: 1032
Final Def: 17
Base Damage: 89589
After random damage rolls: [76150, 77046, 77942, 78838, 79734, 80630, 81525, 82421, 83317, 84213, 85109, 86005, 86901, 87797, 88693, 89589]
After STAB: [114225, 115569, 116913, 118257, 119601, 120945, 122287, 123631, 124975, 126319, 127663, 129007, 130351, 131695, 133039, 134383]
After type effectiveness: [456900, 462276, 467652, 473028, 478404, 483780, 489148, 494524, 499900, 505276, 510652, 516028, 521404, 526780, 532156, 537532]
After final modifiers: [-134776, -124024, -113272, -102520, -91768, -81016, -70280, -59528, -48776, -38024, -27272, -16520, -5768, 4984, 15736, 26488]
So assuming the math is correct, there was a 13/16 chance to deal negative damage, and a 3/16 chance to deal positive damage. It's very lucky that Average LC Enjoyer did not have an attack-lowering stat alignment on Pelipper, because if they did, it would have looped back around to positive numbers again and it would have never been noticed.
- The attacker, Rotom-Heat:
- Has a starting Special Attack stat of 172
- Is fully boosted in all stats, resulting in a 860 BP Stored Power
- Is affected by Electrify
- Has active Charge
- Is boosted by Helping Hand
- Is boosted by Electric Terrain
- Is boosted by Solar Power
- Has a full-powered Metronome
- The defender, Pelipper:
- Has a starting Attack stat of 70
- Is affected by Power Trick and Wonder Room (which effectively turns its Attack stat into its Sp. Def stat)
- Is at -6 Special Defense
Final BP: 3354
Final Atk: 1032
Final Def: 17
Base Damage: 89589
After random damage rolls: [76150, 77046, 77942, 78838, 79734, 80630, 81525, 82421, 83317, 84213, 85109, 86005, 86901, 87797, 88693, 89589]
After STAB: [114225, 115569, 116913, 118257, 119601, 120945, 122287, 123631, 124975, 126319, 127663, 129007, 130351, 131695, 133039, 134383]
After type effectiveness: [456900, 462276, 467652, 473028, 478404, 483780, 489148, 494524, 499900, 505276, 510652, 516028, 521404, 526780, 532156, 537532]
After final modifiers: [-134776, -124024, -113272, -102520, -91768, -81016, -70280, -59528, -48776, -38024, -27272, -16520, -5768, 4984, 15736, 26488]
So assuming the math is correct, there was a 13/16 chance to deal negative damage, and a 3/16 chance to deal positive damage. It's very lucky that Average LC Enjoyer did not have an attack-lowering stat alignment on Pelipper, because if they did, it would have looped back around to positive numbers again and it would have never been noticed.
Attempting 16-bit signed overflow
Since I wasn't sure initially what was going on, I tried some extremely basic setups to rule out 16-bit signed integer overflow. The first thing I tried was dealing over 32767, but less than 65536 damage. The second thing I tried was dealing over 65535 damage. Neither resulted in negative damage.In the first setup, I used a Mega Floette with 227 SpA, and full 860 BP Stored Power into -6 101 Sp. Def Sneasler. Without overflow, I expected these possible damage rolls:
[46732, 47280, 47832, 48380, 48932, 49480, 50028, 50580, 51128, 51680, 52228, 52780, 53328, 53880, 54428, 54980]
I did the exact same thing in the second setup, but used Magic Powder on Floette to give Stored Power STAB. Without overflow, I expected these possible damage rolls:
[70096, 70920, 71748, 72568, 73396, 74220, 75040, 75868, 76692, 77520, 78340, 79168, 79992, 80820, 81640, 82468]
Attempting 32-bit signed overflow
I figured at this point it was probably 32-bit signed integer overflow. I used two tests to confirm this, both exploiting 4096-scaled modifiers to do so. A full-powered Metronome is 8192/4096; Metronome and Fluffy combined are 16834/4096. So I just needed to hit 2^31 -1 / 8192 and 2^31 -1 / 16834 pre-Metronome, which is not unreasonable to set up.Setup #1 - Power Trip
Raw footage of Power Trip setup
Final BP: 990
Final Atk: 1536
Final Def: 13
Base Damage: 51469
After random damage rolls: [43748, 44263, 44778, 45292, 45807, 46322, 46836, 47351, 47866, 48380, 48895, 49410, 49924, 50439, 50954, 51469]
After STAB: [65622, 66394, 67167, 67938, 68710, 69483, 70254, 71026, 71799, 72570, 73342, 74115, 74886, 75658, 76431, 77203]
After type effectiveness: [262488, 265576, 268668, 271752, 274840, 277932, 281016, 284104, 287196, 290280, 293368, 296460, 299544, 302632, 305724, 308812]
After final modifiers: [-523600, -517424, -511240, -505072, -498896, -492712, -486544, -480368, -474184, -468016, -461840, -455656, -449488, -443312, -437128, -430952]
My setup was designed to just barely reach over the 2^31 -1 boundary, and I consistently got negative values from damage.
Just to make sure, I then modified my setup to change Pangoro's Attack stat to 162. As predicted, there was no damage overflow this time.
Final BP: 990
Final Atk: 1296
Final Def: 13
Base Damage: 43427
After random damage rolls: [36912, 37347, 37781, 38215, 38650, 39084, 39518, 39952, 40387, 40821, 41255, 41689, 42124, 42558, 42992, 43427]
After STAB: [55368, 56020, 56671, 57322, 57975, 58626, 59277, 59928, 60580, 61231, 61882, 62533, 63186, 63837, 64488, 65140]
After type effectiveness: [221472, 224080, 226684, 229288, 231900, 234504, 237108, 239712, 242320, 244924, 247528, 250132, 252744, 255348, 257952, 260560]
After final modifiers: [442944, 448160, 453368, 458576, 463800, 469008, 474216, 479424, 484640, 489848, 495056, 500264, 505488, 510696, 515904, 521120]
- The attacker, Pangoro:
- Has a starting Attack stat of 192
- Has 32 accumulated boosts, resulting in a 660 BP Power Trip
- Is at +6 Attack
- Is boosted by Huge Power
- Is boosted by Helping Hand
- Has a full-powered Metronome
- The defender, Pikachu:
- Has a starting Defense stat of 54
- Is at -6 Defense
- Has been turned into a Psychic-type from Magic Powder, then given an additional Ghost-type from Trick-or-Treat
Final BP: 990
Final Atk: 1536
Final Def: 13
Base Damage: 51469
After random damage rolls: [43748, 44263, 44778, 45292, 45807, 46322, 46836, 47351, 47866, 48380, 48895, 49410, 49924, 50439, 50954, 51469]
After STAB: [65622, 66394, 67167, 67938, 68710, 69483, 70254, 71026, 71799, 72570, 73342, 74115, 74886, 75658, 76431, 77203]
After type effectiveness: [262488, 265576, 268668, 271752, 274840, 277932, 281016, 284104, 287196, 290280, 293368, 296460, 299544, 302632, 305724, 308812]
After final modifiers: [-523600, -517424, -511240, -505072, -498896, -492712, -486544, -480368, -474184, -468016, -461840, -455656, -449488, -443312, -437128, -430952]
My setup was designed to just barely reach over the 2^31 -1 boundary, and I consistently got negative values from damage.
Just to make sure, I then modified my setup to change Pangoro's Attack stat to 162. As predicted, there was no damage overflow this time.
Final BP: 990
Final Atk: 1296
Final Def: 13
Base Damage: 43427
After random damage rolls: [36912, 37347, 37781, 38215, 38650, 39084, 39518, 39952, 40387, 40821, 41255, 41689, 42124, 42558, 42992, 43427]
After STAB: [55368, 56020, 56671, 57322, 57975, 58626, 59277, 59928, 60580, 61231, 61882, 62533, 63186, 63837, 64488, 65140]
After type effectiveness: [221472, 224080, 226684, 229288, 231900, 234504, 237108, 239712, 242320, 244924, 247528, 250132, 252744, 255348, 257952, 260560]
After final modifiers: [442944, 448160, 453368, 458576, 463800, 469008, 474216, 479424, 484640, 489848, 495056, 500264, 505488, 510696, 515904, 521120]
Setup #2 - Pyro Ball + Fluffy
Raw footage of Pyro Ball setup (Gengar side) (Cinderace side)
In this setup:
Final BP: 270
Final Atk: 1304
Final Def: 18
Base Damage: 8608
Sun Damage: 12912
After random damage rolls: [10975, 11104, 11233, 11362, 11491, 11620, 11749, 11879, 12008, 12137, 12266, 12395, 12524, 12653, 12782, 12912]
After STAB: [16462, 16656, 16849, 17043, 17236, 17430, 17623, 17818, 18012, 18205, 18399, 18592, 18786, 18979, 19173, 19368]
After type effectiveness: [131696, 133248, 134792, 136344, 137888, 139440, 140984, 142544, 144096, 145640, 147192, 148736, 150288, 151832, 153384, 154944]
After final modifiers: [-521792, -515584, -509408, -503200, -497024, -490816, -484640, -478400, -472192, -466016, -459808, -453632, -447424, -441248, -435040, -428800]
In this setup:
- The attacker, Cinderace
- Has a starting Attack stat of 163
- Is at +6 Attack
- Is boosted by Huge Power
- Is boosted by two Helping Hand boosts
- Has a full-powered Metronome
- The defender, Gengar
- Has a starting Defense stat of 72
- Is at -6 Defense
- Has copied Bug/Steel type vs Reflect Type, and also been affected by Forest's Curse
- Has Fluffy
- Sun is active
Final BP: 270
Final Atk: 1304
Final Def: 18
Base Damage: 8608
Sun Damage: 12912
After random damage rolls: [10975, 11104, 11233, 11362, 11491, 11620, 11749, 11879, 12008, 12137, 12266, 12395, 12524, 12653, 12782, 12912]
After STAB: [16462, 16656, 16849, 17043, 17236, 17430, 17623, 17818, 18012, 18205, 18399, 18592, 18786, 18979, 19173, 19368]
After type effectiveness: [131696, 133248, 134792, 136344, 137888, 139440, 140984, 142544, 144096, 145640, 147192, 148736, 150288, 151832, 153384, 154944]
After final modifiers: [-521792, -515584, -509408, -503200, -497024, -490816, -484640, -478400, -472192, -466016, -459808, -453632, -447424, -441248, -435040, -428800]
The battle log's interpretation of damage overflow
The battle log in Champions logs the actual damage you took from the perspective of the player that lost HP, and also logs the percentage of HP lost from the opponent's perspective. Here's examples of what that looks like:
It is not obvious to me where these battle log numbers are coming from. They aren't consistent, so I assume it's got to be related to the specific damage roll in some way. I did hit one of the numbers in the Pikachu setup twice. For now, I'll just document them:
- In the Pyro Ball Fluffy setup:
- From Gengar's perspective: 64647 -> 167, 21255 -> 167, 30119 -> 167
- From Cinderace's perspective: 299% -> 100%, 530% -> 100%, 755% -> 100%
- In the Power Trip setup:
- From Pikachu's perspective: 50246 -> 142, 62590 -> 142, 47494 -> 142 (NOTE: this was was a crit), 62590 -> 142, 15582 -> 142, 37886 -> 142










