Hidden Power (move)/Calculation: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
reverting to old formulae pending confirmation of formula
(→‎Type: you mean this?)
(reverting to old formulae pending confirmation of formula)
Line 103: Line 103:


==Generation III and on==
==Generation III and on==
{{incomplete|needs=Confirmation for Generation V games}}
===Type===
===Type===
{{incomplete|section}}
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 111:


Hidden Power's type of a Pokémon with given IVs is represented by a number, calculated with this formula:
Hidden Power's type of a Pokémon with given IVs is represented by a number, calculated with this formula:
:[[File:HPcalc1.png]]
<!--'''HP<sub>type</sub>'''=<font color="#CC0000">'''Floor'''<big><big>[</big></big></font><font color="#0000FF"><big>'''('''</big></font>a+2*b+4*c+8*d+16*e+32*f<font color="#0000FF"><big>''')'''</big></font>*15/63<font color="#CC0000"><big><big>]</big></big></font> -->
where ''a,b,c,d,e,f'' (the "type bits") are the {{wp|least significant bit}} of their respective IV's. If a number is odd, its least significant bit is 1, and it is 0 otherwise.


:type = (def % 2) + ((spd % 2) * 2) + ((spatk % 2) * 4) + ((spdef % 2) * 8)
* a depends on the HP IV.
* b and c depend on the Attack and Defense IV's respectively.
* d depends on the Speed IV.
* e and f depend on the Special Attack and Special Defense IV's respectively.


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.:
This simply means that every element of the sum in the brace is the {{wp|remainder}} of division of corresponding IV and 2, multiplied by appropriate power of 2 (2<sup>0</sup> in case of ''a'' and 2<sup>5</sup> in case of ''f''). The sum may range from 0 (when all IVs are even) to 63 (when all IVs are odd), inclusive. It is worth mentioning that the computed sum may be easily calculated by putting its variables ''a,b,c,d,e,f'' together in reverse order and interpreting this as a number in the [[wp:Binary numeral system|binary system]], which then needs to be reverted to [[wp:Decimal|decimal system]]:
:type = (def & 1) + ((spd & 1) << 1) + ((spatk & 1) << 2) + ((spdef & 1) << 3)
 
''fedcba<sub>(2)</sub>'' = 32''f''+16''e''+8''d''+4''c''+2''b''+''a'' <sub>(10)</sub>
 
The summed value is then multiplied by 15 and divided by 63, to be sure that the number representing Hidden Power Type will range from 0 to 15, inclusively (16 values in total). The calculated number is then [[wp:Floor_function|rounded down (''floor[]'')]], which simply means that only integral part of the calculated number is considered.


The resulting number will correspond to a type as marked below.
The resulting number will correspond to a type as marked below.
{| class="roundy" style="background: #{{platinum color}}; border: 3px solid #{{platinum color light}}; {{roundy|10px}}"
{| class="roundy" style="background: #{{platinum color}}; border: 3px solid #{{platinum color light}}; {{roundy|10px}}"
! style="background: #{{platinum color light}}; {{roundytl|10px}}" | Number
! style="background: #{{platinum color light}}; {{roundytl|10px}}" | Number
Line 174: Line 186:


{{Hidden Power calculation/IV|30<br>''0''|31<br>''1''|31<br>''1''|31<br>''1''|30<br>''0''|31<br>''1''}}
{{Hidden Power calculation/IV|30<br>''0''|31<br>''1''|31<br>''1''|31<br>''1''|30<br>''0''|31<br>''1''}}
:type = 1 + (1 * 2) + (0 * 4) + (1 * 8) = 11, which means that our Pikachu has an {{type|Electric}} {{m|Hidden Power}}.


===Base Power===
HP Type = Floor[('''0 + 2 + 4 + 8 + 0 + 32''')*15/63] = Floor['''46*15/63'''] = '''Floor[10.952]''' = '''10''', which means that our Pikachu has a {{type|Grass}} {{m|Hidden 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)
===Damage===
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).
Damage of the Hidden Power is calculated in a manner very similar to that of its type, using the following formula:
:[[File:HPcalc2.png]]
 
<!-- '''HP<sub>Power</sub>''' = <font color="#CC0000">'''Floor'''<big><big>[</big></big></font><font color="#0000FF"><big>'''('''</big></font><font color="#009900">'''('''</font>u+2*v+4*w+8*x+16*y+32*z<font color="#009900">''')'''</font>*40/63<font color="#0000FF"><big>''')'''</big></font>+30<font color="#CC0000"><big><big>]</big></big></font> -->
<!-- If we have the picture, why do we need the text? -->
 
* The variables u through z (the "damage bits") represent the second to last bit of each IV. If a variable has a remainder of 2 or 3 when divided by 4, this bit is 1. Otherwise, the bit is zero.
:* u depends on the HP stat.
:* v and w depend on the Attack and Defense stats respectively.
:* x depends on the Speed stat.
:* y and z depend on the Special Attack and Special Defense stats respectively.
 
Like before, the sum may range from 0 to 63, inclusively. The calculated number is then multiplied by 40 and divided by 63 to make sure that the fraction will not exceed 40. Then, the number is increased by 30 and rounded down, making Hidden Power's power a number ranging from 30 to 70, inclusively.  


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 + 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'''
 
HP Power = Floor[((1 + 2 + 4 + 8 + 16 + 32)*40/63)+30] = Floor [(63*40/63)+30] = Floor[70] = '''70''', which means that our Pikachu's Hidden Power's power is '''70'''
 
{{Hidden Power calculation/IV|30|31|31|31|30|31}}{{-}}
{| class="roundy" width="650px" style="border: 2px solid #{{Grass color light}};"
|- style="text-align:center;"
| bgcolor="#{{Grass color}}" style="width: 33%; {{roundyleft|10px}}" |[[Hidden Power (move)|<span style=color:#000>Hidden Power:</span>]]
| bgcolor="#{{Grass color}}" style="width: 33%" | <span style=color:#000>Type:</span><br>'''[[Grass_(type)|<span style=color:#000>Grass</span>]]'''
| bgcolor="#{{Grass color}}" style="width: 33%; {{roundyright|10px}}" | <span style=color:#000>Power:</span><br>'''<span style=color:#000>70</span>'''
|}


===Number of possible Hidden Powers===
===Number of possible Hidden Powers===
Line 195: Line 227:
{{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 223: Line 255:


===Percentage distribution of different variations of Hidden Power===
===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.  
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.  


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.
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.


{| 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 233: Line 361:
! 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, 32, 34, 37, 39, 42, 44, 47, 49,<br />52, 54, 57, 59, 62, 64, 67, 69, 70
| 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
| 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% each
| 1.5625%
|- 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%
|}
|}
|}


72

edits

Navigation menu