Hidden Power (move)/Calculation: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
m (→‎Base Power: remove old template)
(→‎Generation III and on: fixing second formula, simplifying fraction, fixing probabilities. More research needed, but I can't find the template)
Line 104: Line 104:
==Generation III and on==
==Generation III and on==
===Type===
===Type===
{{
Consider an example Pokémon, like Pikachu with this set of IVs:
Consider an example Pokémon, like Pikachu with this set of IVs:


Line 111: Line 113:


:type = (def % 2) + ((spd % 2) * 2) + ((spatk % 2) * 4) + ((spdef % 2) * 8)
:type = (def % 2) + ((spd % 2) * 2) + ((spatk % 2) * 4) + ((spdef % 2) * 8)
Where ''def'' is the Defense IV, ''spd'' is the Speed IV, ''spatk'' is the Special Attack IV, ''spdef'' is the Special Defense IV, and ''%'' is the [[wp:Modulo_operation|modulo operator]] (i.e. x % y = the remainder of x / y).


Another way of expressing this is that the type is derived from the least significant bits of the Special Defense, Special Attack, Speed and Defense IVs, in order from most to least significant bit of the result; i.e.:
Another way of expressing this is that the type is derived from the least significant bits of the Special Defense, Special Attack, Speed and Defense IVs, in order from most to least significant bit of the result; i.e.:
Line 177: Line 178:
===Base Power===
===Base Power===
Base power of the Hidden Power is calculated in a manner very similar to that of its type, using the following formula:
Base power of the Hidden Power is calculated in a manner very similar to that of its type, using the following formula:
:power = floor(((1 + ((hp / 2) % 2) + ((atk / 2) % 2) + ((def / 2) % 2) + ((spd / 2) % 2) + ((spatk / 2) % 2) + ((spdef / 2) % 2)) * 6250) / 10000 + 30)
:power = floor(((1 + ((hp / 2) % 2) + 2*((atk / 2) % 2) + 4*((def / 2) % 2) + 8*((spd / 2) % 2) + 16*((spatk / 2) % 2) + 32*((spdef / 2) % 2)) * 5) / 8 + 30)
Where ''def'' is the Defense IV, ''spd'' is the Speed IV, ''spatk'' is the Special Attack IV, ''spdef'' is the Special Defense IV, and ''%'' is the [[wp:Modulo_operation|modulo operator]] (i.e. x % y = the remainder of x / y).
where ''hp'' is the HP IV, ''atk'' is the Attack IV, ''def'' is the Defense IV, ''spd'' is the Speed IV, ''spatk'' is the Special Attack IV, ''spdef'' is the Special Defense IV, and ''%'' is the [[wp:Modulo_operation|modulo operator]] (i.e. x % y = the remainder of x / y).


In our example, we get:
In our example, we get:


{{Hidden Power calculation/IV|30<br>''1''|31<br>''1''|31<br>''1''|31<br>''1''|30<br>''1''|31<br>''1''}}
{{Hidden Power calculation/IV|30<br>''1''|31<br>''1''|31<br>''1''|31<br>''1''|30<br>''1''|31<br>''1''}}
:power = floor(((1 + 1 + 1 + 1 + 1 + 1 + 1) * 6250) / 10000 + 30), which means that our Pikachu's Hidden Power's power is '''34'''
:power = floor(((1 + 1*1 + 2*1 + 4*1 + 8*1 + 16*1 + 32*1) * 5) / 8 + 30), which means that our Pikachu's Hidden Power's power is '''70'''


===Number of possible Hidden Powers===
===Number of possible Hidden Powers===
Line 194: Line 195:
{{Hidden Power calculation/IV|'''26'''|31|31|31|30|31|Ani025MS.png}}
{{Hidden Power calculation/IV|'''26'''|31|31|31|30|31|Ani025MS.png}}


As we see, both 26 and 30 are divisible by 2 and give the remainder of 2 when divided by 4. So, in both cases the algorithms will interpret the IVs of those Pokémon in the same way, returning Grass-type Hidden Power with 70 power. It means that for the mentioned algorithms an IV of 30 is treated in the same way like IVs of 2,6,10,14,18,22 and 26 (8 in total).  
As we see, both 26 and 30 are divisible by 2 and give the remainder of 2 when divided by 4. So, in both cases the algorithms will interpret the IVs of those Pokémon in the same way, returning Grass-type Hidden Power with 70 power. It means that for the mentioned algorithms an IV of 30 is treated in the same way like IVs of 2, 6, 10, 14, 18, 22 and 26 (8 in total).


In fact, there are only four essentially different types of IV when calculating Hidden Power:
In fact, there are only four essentially different types of IV when calculating Hidden Power:
Line 222: Line 223:


===Percentage distribution of different variations of Hidden Power===
===Percentage distribution of different variations of Hidden Power===
Due to the fact that both Hidden Power's type and its power are the products of rounding down, chances of getting a Pokémon with certain Hidden Power are not equal, as one might have thought, and are different for every Hidden Power's type and damage value.  
Due to the fact that Hidden Power's power is the product of rounding down, the chances of getting a Pokémon with a certain Hidden Power base power are not equal, as one might have thought, and are different for every Hidden Power's damage value.  


As it was stated before, the number of theoretically different Hidden Powers is 4096, which is the result of multiplying theoretical values of possible types (64) and powers (also 64). It means that every of 64 "types" comes into 64 "powers". After rounding down, however, the number of 64 "types" is reduced to 16 and the number of 64 "powers" to 41.
As stated before, the number of theoretically different values for base damage is 2<sup>6</sup> = 64, since there are two possibilities for each bit. After rounding down, however, the number of 64 "powers" is reduced to 41.


{| style="margin:auto;" cellspacing="40"
|- valign="top"
|
{| style="background: #{{normal color}}; border: 3px solid #{{normal color dark}}; {{roundy|10px}}"
|+ '''Percentage distribution of Hidden Power's type'''
! style="text-align: center;" style="background:#{{normal color light}}; {{roundytl}}" | Number
! style="text-align: center;" style="background:#{{normal color light}};" | Type
! style="text-align: center;" style="background:#{{normal color light}};" | Qty
! style="text-align: center;" style="background:#{{normal color light}}; {{roundytr}}" | %
|-style="background-color: #{{fighting color}}"
| '''<span style=color:#fff>0</span>'''
| '''[[Fighting (type)|<span style=color:#fff>Fighting</span>]]'''
| '''<span style=color:#fff>320</span>'''
| '''<span style=color:#fff>7.8125%</span>'''
|-style="background-color: #{{Flying color}}"
| 1
| Flying
| 256
| 6.25%
|-style="background-color: #{{poison color}}"
| 2
| Poison
| 256
| 6.25%
|-style="background-color: #{{Ground color}}"
| 3
| Ground
| 256
| 6.25%
|-style="background-color: #{{Rock color}}"
| 4
| Rock
| 256
| 6.25%
|-style="background-color: #{{Bug color}}"
| '''5'''
| '''Bug'''
| '''320'''
| '''7.8125%'''
|-style="background-color: #{{Ghost color}}"
| 6
| Ghost
| 256
| 6.25%
|-style="background-color: #{{Steel color}}"
| 7
| Steel
| 256
| 6.25%
|-style="background-color: #{{Fire color}}"
| 8
| Fire
| 256
| 6.25%
|-style="background-color: #{{Water color}}"
| 9
| Water
| 256
| 6.25%
|-style="background-color: #{{Grass color}}"
| '''10'''
| '''Grass'''
| '''320'''
| '''7.8125%'''
|-style="background-color: #{{Electric color}}"
| 11
| Electric
| 256
| 6.25%
|-style="background-color: #{{Psychic color}}"
| 12
| Psychic
| 256
| 6.25%
|-style="background-color: #{{Ice color}}"
| 13
| Ice
| 256
| 6.25%
|-style="background-color: #{{Dragon color}}"
| 14
| Dragon
| 256
| 6.25%
|-style="background-color: #{{Dark color}}"
| 15
| Dark
| 64
| 1.5625%
|-
|
|
| 4096
| 100%
|}
|
{| style="background: #{{normal color}}; border: 3px solid #{{normal color dark}}; {{roundy|10px}}"
{| style="background: #{{normal color}}; border: 3px solid #{{normal color dark}}; {{roundy|10px}}"
|+ '''Percentage distribution of Hidden Power's powers'''
|+ '''Percentage distribution of Hidden Power's powers'''
Line 328: Line 233:
! style="text-align: center;" style="background:#{{normal color light}}; {{roundytr|5px}}" | %
! style="text-align: center;" style="background:#{{normal color light}}; {{roundytr|5px}}" | %
|- style="background: #fff;"
|- style="background: #fff;"
| 30, 31, 33, 35, 36, 38,<br>40, 42, 43, 45, 47, 49,<br>50, 52, 54, 56, 57, 59,<br>61, 63, 64, 66, 68
| 30, 32, 34, 37, 39, 42, 44, 47, 49,<br />52, 54, 57, 59, 62, 64, 67, 69, 70
| 23 × 128
| 3.125%
|- style="background: #fff;"
| 32, 34, 37, 39, 41, 44,<br>46, 48, 51, 53, 55, 58,<br>60, 62, 65, 67, 69, 70  
| 18 × 64
| 18 × 64
| 1.5625%
| 1.5625% each
|- style="background: #fff;"
|- style="background: #fff;"
| 31, 33, 35, 36, 38, 40, 41, 43, 45, 46, 48, 50,<br />51, 53, 55, 56, 58, 60, 61, 63, 65, 66, 68
| 23 × 128
| 3.125% each
|-
|
|
| 4096
| 4096
| 100%
| 100%
|}
|}
|}



Revision as of 07:07, 26 April 2013

In the Pokémon games, Hidden Power is a Normal-type move when the type is displayed, such as in battle and on status screens. However, the actual type of Hidden Power is determined by the Pokémon's individual values, and through calculation, can be set as one of the sixteen other natural types and with a power between 30 and 70.

The type of Hidden Power can be checked in Veilstone Game Corner's prize house in Pokémon Platinum, the Celadon Game Corner in Pokémon HeartGold and SoulSilver, in Mistralton City's Pokémon Center in Pokémon Black and White, and at the PWT in Pokémon Black 2 and White 2. There remains no in-game way to determine the power level directly, however.

Generation II

Type

Consider an example Pokémon, like Pikachu with this set of IVs:

Spr 2c 001.png Hit Points Attack Defense Speed Special
14 15 15 15 14

The type is determined by taking the two least significant bits of the Attack and Defense IVs, then concatenating these two values in that order.

Mathematically, this is the equivalent of:

File:HPtypeII.png

Where a represents the Attack IV and b represents the Defense IV.

The resulting number will correspond to a type as marked below.

Number Type
0  Fighting 
1  Flying 
2  Poison 
3  Ground 
4  Rock 
5  Bug 
6  Ghost 
7  Steel 
8  Fire 
9  Water 
10  Grass 
11  Electric 
12  Psychic 
13  Ice 
14  Dragon 
15  Dark 

In our example, we get:

HPtype=4*(15 mod 4)+(15 mod 4)=4*3+3=12+3=15, which means that our Pikachu has a Dark-type Hidden Power.

Damage

The damage of the Hidden Power is calculated using the following formula:

File:HPPowerII.png
  • The variables v through y (the "damage bits") represent the most significant bit of each IV. If a variable is less than eight, this bit is 0; otherwise, it is 1.
  • v and w depend on the Attack and Defense stats respectively.
  • x depends on the Speed stat.
  • y depends on the Special stat.
  • Z is equal to the Special stat when the Special stat is less than or equal to 3; when the Special stat is greater than 3, Z is equal to 3.

Hidden Power's power is therefore a number ranging from 31 to 70, inclusively.

In our example, we get:

Spr 2c 001.png Hit Points Attack Defense Speed Special
14
N/A
15
1
15
1
15
1
14
1

HP Power = Floor[(5*(1 + 2*1 + 4*1 + 8*1) + 3)/2+31] = Floor[(5*(1 + 2 + 4 + 8) + 3)/2+31] = Floor[(5*15 + 3)/2+31] = Floor[(75 + 3)/2+31] = Floor[78/2+31] = Floor[39+31] = Floor[70] = 70, which means that our Pikachu's Hidden Power's power is 70

Spr 2c 001.png Hit Points Attack Defense Speed Special
14 15 15 15 14
Hidden Power: Type:
Dark
Power:
70

Generation III and on

Type

{{

Consider an example Pokémon, like Pikachu with this set of IVs:

025.png Hit Points Attack Defense Speed Sp. Attack Sp. Defense
30 31 31 31 30 31

Hidden Power's type of a Pokémon with given IVs is represented by a number, calculated with this formula:

type = (def % 2) + ((spd % 2) * 2) + ((spatk % 2) * 4) + ((spdef % 2) * 8)

Another way of expressing this is that the type is derived from the least significant bits of the Special Defense, Special Attack, Speed and Defense IVs, in order from most to least significant bit of the result; i.e.:

type = (def & 1) + ((spd & 1) << 1) + ((spatk & 1) << 2) + ((spdef & 1) << 3)

The resulting number will correspond to a type as marked below.

Number Type
0  Fighting 
1  Flying 
2  Poison 
3  Ground 
4  Rock 
5  Bug 
6  Ghost 
7  Steel 
8  Fire 
9  Water 
10  Grass 
11  Electric 
12  Psychic 
13  Ice 
14  Dragon 
15  Dark 

In our example, we get:

025.png Hit Points Attack Defense Speed Sp. Attack Sp. Defense
30
0
31
1
31
1
31
1
30
0
31
1
type = 1 + (1 * 2) + (0 * 4) + (1 * 8) = 11, which means that our Pikachu has an Electric-type Hidden Power.

Base Power

Base power of the Hidden Power is calculated in a manner very similar to that of its type, using the following formula:

power = floor(((1 + ((hp / 2) % 2) + 2*((atk / 2) % 2) + 4*((def / 2) % 2) + 8*((spd / 2) % 2) + 16*((spatk / 2) % 2) + 32*((spdef / 2) % 2)) * 5) / 8 + 30)

where hp is the HP IV, atk is the Attack IV, def is the Defense IV, spd is the Speed IV, spatk is the Special Attack IV, spdef is the Special Defense IV, and % is the modulo operator (i.e. x % y = the remainder of x / y).

In our example, we get:

025.png Hit Points Attack Defense Speed Sp. Attack Sp. Defense
30
1
31
1
31
1
31
1
30
1
31
1
power = floor(((1 + 1*1 + 2*1 + 4*1 + 8*1 + 16*1 + 32*1) * 5) / 8 + 30), which means that our Pikachu's Hidden Power's power is 70

Number of possible Hidden Powers

As there are 6 IVs, ranging from 0 to 31 (32 in total), the number of different possible Hidden Powers should be 326=230, which is more than one billion possibilities. But let us consider two Pokémon with one different IV:

Ani025MS.png Hit Points Attack Defense Speed Sp. Attack Sp. Defense
30 31 31 31 30 31

and

Ani025MS.png Hit Points Attack Defense Speed Sp. Attack Sp. Defense
26 31 31 31 30 31

As we see, both 26 and 30 are divisible by 2 and give the remainder of 2 when divided by 4. So, in both cases the algorithms will interpret the IVs of those Pokémon in the same way, returning Grass-type Hidden Power with 70 power. It means that for the mentioned algorithms an IV of 30 is treated in the same way like IVs of 2, 6, 10, 14, 18, 22 and 26 (8 in total).

In fact, there are only four essentially different types of IV when calculating Hidden Power:

1. IV that gives a remainder of 0 when divided by 4 - has damage bit 0 and type bit 0: 0, 4, 8, 12, 16, 20, 24, 28
2. IV that gives a remainder of 1 when divided by 4 - has damage bit 0 and type bit 1: 1, 5, 9, 13, 17, 21, 25, 29
3. IV that gives a remainder of 2 when divided by 4 - has damage bit 1 and type bit 0: 2, 6, 10, 14, 18, 22, 26, 30
4. IV that gives a remainder of 3 when divided by 4 - has damage bit 1 and type bit 1: 3, 7, 11, 15, 19, 23, 27, 31

In other words: only four IVs that give different remainders when divided by four would cover all possible Hidden Power types and powers.

If so, the number of possible Hidden Powers should be 46=212=64*64=4096. This number, however is again far too large, as the real number of possible variations of Hidden power is simply 16*41=656, as Hidden Power exists in 16 types and has 41 different powers. The significant difference between 656 and 4096 is explained by the function floor[], which reduces theoretically different numbers (for example 10.952 and 10.476) to the same integer, or whole number (in this case 10).

Percentage distribution of different variations of Hidden Power

Due to the fact that Hidden Power's power is the product of rounding down, the chances of getting a Pokémon with a certain Hidden Power base power are not equal, as one might have thought, and are different for every Hidden Power's damage value.

As stated before, the number of theoretically different values for base damage is 26 = 64, since there are two possibilities for each bit. After rounding down, however, the number of 64 "powers" is reduced to 41.

Percentage distribution of Hidden Power's powers
Powers Qty %
30, 32, 34, 37, 39, 42, 44, 47, 49,
52, 54, 57, 59, 62, 64, 67, 69, 70
18 × 64 1.5625% each
31, 33, 35, 36, 38, 40, 41, 43, 45, 46, 48, 50,
51, 53, 55, 56, 58, 60, 61, 63, 65, 66, 68
23 × 128 3.125% each
4096 100%

Trivia

  • Although Hidden Power is listed as a Normal-type move, it cannot damage as a Normal-type attack.
  • In Generation II, the calculation of the type and power of Hidden Power is completely independent of the HP IV.

External links

Many Pokémon related sites prepared web-based calculators, which allows to compute Hidden Power of a Pokémon with given IVs:

Project Games logo.png This game mechanic article is part of Project Games, a Bulbapedia project that aims to write comprehensive articles on the Pokémon games.