Size and weight variation: Difference between revisions

Add BDSP info
m (Text replacement - "Pseudorandom number generation in Pokémon" to "Pseudorandom number generation")
(Add BDSP info)
Line 1: Line 1:
'''Size and weight variation''' is a game mechanic where multiple {{OBP|Pokémon|species}} of the same species can vary in size or weight.
'''Size and weight variation''' is a game mechanic where different {{OBP|Pokémon|species}} of the same species can vary in size or weight.


==In the core series games==
==In the core series games==
Line 113: Line 113:
<math display="block">y = (256 \cdot \operatorname{rrc}(IV_1) + \operatorname{rrc}(IV_2)) \oplus \operatorname{rrc}(ID)</math>
<math display="block">y = (256 \cdot \operatorname{rrc}(IV_1) + \operatorname{rrc}(IV_2)) \oplus \operatorname{rrc}(ID)</math>


As a special case, if ''y'' < 10, then the Magikarp's length is equal to <math display="inline">190 + y</math>. Otherwise, the value ''y'' is used to find the corresponding values of ''x<sub>0</sub>'', ''y<sub>0</sub>'', and ''m'' in the following table, which defines a piecewise linear approximation of the inverse of a {{wp|normal cumulative distribution function}} with mean 800 and standard deviation 179. Due to an off-by-one error, the values of ''x<sub>0</sub>'' are calculated as 2 plus the zero-based index of the column (giving a mean of 800), rather than 3 plus the zero-based index of the column (giving a mean of 900). The column selected was intended to be the first column where ''y'' is less than the ''y<sub>0</sub>'' value of that same column. Due to a programming error, only the high bytes of ''y'' and ''y<sub>0</sub>'' are compared; this causes values to be looked up incorrectly from the table (including rendering the first and last columns inaccessible).
As a special case, if ''y'' < 10, then the Magikarp's length is equal to <math display="inline">190 + y</math>. Otherwise, the value ''y'' is used to find the corresponding values of ''x<sub>0</sub>'', ''y<sub>0</sub>'', and ''m'' in the following table, which defines a {{wp|Piecewise linear function|piecewise linear}} approximation of the {{wp|Quantile function|inverse}} of a {{wp|Normal distribution|normal}} {{wp|cumulative distribution function}} with mean 800 and standard deviation 179. Due to an off-by-one error, the values of ''x<sub>0</sub>'' are calculated as 2 plus the zero-based index of the column (giving a mean of 800), rather than 3 plus the zero-based index of the column (giving a mean of 900). The column selected was intended to be the first column where ''y'' is less than the ''y<sub>0</sub>'' value of that same column. Due to a programming error, only the high bytes of ''y'' and ''y<sub>0</sub>'' are compared; this causes values to be looked up incorrectly from the table (including rendering the first and last columns inaccessible).


{| class="roundtable" style="text-align:center; background:#{{johto color}}; border:3px solid #{{johto color dark}}; margin:auto"
{| class="roundtable" style="text-align:center; background:#{{johto color}}; border:3px solid #{{johto color dark}}; margin:auto"
Line 139: Line 139:
===Generations III and IV===
===Generations III and IV===
[[File:Size variation III IV.png|thumb|250px|Histogram of size variation in Generations III and IV]]
[[File:Size variation III IV.png|thumb|250px|Histogram of size variation in Generations III and IV]]
In [[Generation III|Generations III]] and {{gen|IV}}, there are occasionally [[Non-player character|NPCs]] who want to see large Pokémon. If shown a Pokémon that exceeds the previous record, the NPC will give the player a prize if it exceeds the previous record. A Pokémon is considered to have beat the previous record if its calculated size in millimeters (in all Generation III games and non-English Generation IV games) or its calculated size in tenths of an inch (in English-language Generation IV games) is greater than the previous record.
In [[Generation III|Generations III]] and {{gen|IV}} and {{g|Brilliant Diamond and Shining Pearl}}, there are occasionally [[Non-player character|NPCs]] who want to see large Pokémon. If shown a Pokémon that exceeds the previous record, the NPC will give the player a prize if it exceeds the previous record. Whether a Pokémon is considered to have beat the previous record differs slightly between games:
* In all Generation III games and non-English Generation IV games, this occurs if its calculated '''size in millimeters''' is greater than the previous record.
* In English-language Generation IV games, this occurs if its calculated '''size in tenths of an inch''' is greater than the previous record.
* In Pokémon Brilliant Diamond and Shining Pearl, this occurs if its calculated '''scale factor''' is greater than the previous record.


The size of these Pokémon is calculated from its [[individual values]] (IVs) and its [[personality value]]. Sizes follow a {{wp|normal distribution}}, with a {{wp|mean}} of the species' [[Pokédex]] height and {{wp|standard deviation}} of 0.179 times the species Pokédex height (approximately).
The size of these Pokémon is calculated from its [[individual values]] (IVs) and its [[personality value]] (its [[encryption constant]] in Pokémon Brilliant Diamond and Shining Pearl). Sizes follow a {{wp|normal distribution}}, with a {{wp|mean}} of the species' [[Pokédex]] height and {{wp|standard deviation}} of 0.179 times the species Pokédex height (approximately).


====Locations====
====Locations====
The characters searching for large Pokémon can be found at the following locations:
The characters searching for large Pokémon can be found at the following locations:
{| class="roundtable" style="background:#C0C0FF; border:3px solid blue; margin:auto"
{| class="roundtable" style="background:#C0C0FF; border:3px solid blue; margin:auto"
! Games
! rowspan="2" | Games
! Location
! rowspan="2" | Location
! Pokémon
! rowspan="2" | Pokémon
! colspan="2" | Initial record
! colspan="3" | Initial record
! Prize
! rowspan="2" | Prize
|-
! US customary
! Metric
! Scale factor
|-
|-
| {{gameabbrev3|RS}}
| {{gameabbrev3|RS}}
| [[Sootopolis City]]
| [[Sootopolis City]]
| {{p|Barboach}} and {{p|Shroomish}}
| {{p|Barboach}} and {{p|Shroomish}}
| 15.7 in
| class="c" | 15.7 in
| 40.0 cm <!-- y = 0x8100 -->
| class="c" | 40.0 cm
| class="c" | 1002 <!-- y = 0x8100 -->
| [[Elixir]]
| [[Elixir]]
|-
|-
Line 162: Line 170:
| [[Sootopolis City]]
| [[Sootopolis City]]
| {{p|Seedot}} and {{p|Lotad}}
| {{p|Seedot}} and {{p|Lotad}}
| 19.6 in
| class="c" | 19.6 in
| 50.0 cm <!-- y = 0x8000 -->
| class="c" | 50.0 cm
| class="c" | 1000 <!-- y = 0x8000 -->
| [[Elixir]]
| [[Elixir]]
|-
|-
Line 169: Line 178:
| {{rt|12|Kanto}}
| {{rt|12|Kanto}}
| {{p|Magikarp}}
| {{p|Magikarp}}
| colspan="2" | None
| class="c" colspan="3" | None
| [[Net Ball]]
| [[Net Ball]]
|-
|-
Line 175: Line 184:
| [[Water Path]]  
| [[Water Path]]  
| {{p|Heracross}}
| {{p|Heracross}}
| colspan="2" | None
| class="c" colspan="3" | None
| [[Nest Ball]]
| [[Nest Ball]]
|-
|-
Line 181: Line 190:
| {{rt|222|Sinnoh}}
| {{rt|222|Sinnoh}}
| {{p|Remoraid}}
| {{p|Remoraid}}
| colspan="2" | None
| class="c" | 23.7 in
| class="c" | 60.1 cm
| class="c" | 1003 <!-- y = 0x8200 -->
| [[Net Ball]]
| [[Net Ball]]
|-
|-
Line 188: Line 199:
| {{p|Magikarp}}
| {{p|Magikarp}}
| 41.9 in
| 41.9 in
| 106.5 cm <!-- y = 56150 -->
| 106.5 cm
| 1184 <!-- y = 56150 -->
| [[Ether]]
| [[Ether]]
|-
| {{gameabbrev8|BDSP}}
| {{rt|222|Sinnoh}}
| {{p|Remoraid}}
| 23.7 in
| 60.2 cm
| 1003 <!-- y = 0x8200 -->
| [[Net Ball]]
|}
|}


====Calculation====
====Calculation====
Only the lowest two bytes of the personality value are used in the calculation: ''p''<sub>1</sub> (highlighted in <span style="background:#9999FF">blue</span> below) is the least significant byte, while ''p''<sub>2</sub> (highlighted in <span style="background:#FF9999">red</span>) is the second least significant byte.
Only the lowest two bytes of the personality value or encryption constant are used in the calculation: ''p''<sub>1</sub> (highlighted in <span style="background:#9999FF">blue</span> below) is the least significant byte, while ''p''<sub>2</sub> (highlighted in <span style="background:#FF9999">red</span>) is the second least significant byte.


<code>00000000 00000000 <span style="background:#FF9999">00000000</span> <span style="background:#9999FF">00000000</span></code>
<code>00000000 00000000 <span style="background:#FF9999">00000000</span> <span style="background:#9999FF">00000000</span></code>
Line 203: Line 223:
<math display="block">y = 256 \cdot (p_1 \oplus (\text{HP}' \cdot (\text{Atk}' \oplus \text{Def}'))) + (p_2 \oplus (\text{Spd}' \cdot (\text{SpAtk}' \oplus \text{SpDef}')))</math>
<math display="block">y = 256 \cdot (p_1 \oplus (\text{HP}' \cdot (\text{Atk}' \oplus \text{Def}'))) + (p_2 \oplus (\text{Spd}' \cdot (\text{SpAtk}' \oplus \text{SpDef}')))</math>


For the next step, the value ''y'' is used to find the corresponding values of ''x<sub>0</sub>'', ''m'', and ''y<sub>0</sub>'' in the following table, which defines a piecewise linear approximation of the inverse of a {{wp|normal cumulative distribution function}} with mean 1000 and standard deviation 179. The column selected is the first column where ''y'' is less than the ''y<sub>0</sub>'' value of the next column.
For the next step, the value ''y'' is used to find the corresponding values of ''x<sub>0</sub>'', ''m'', and ''y<sub>0</sub>'' in the following table, which defines a {{wp|Piecewise linear function|piecewise linear}} approximation of the {{wp|Quantile function|inverse}} of a {{wp|Normal distribution|normal}} {{wp|cumulative distribution function}} with mean 1000 and standard deviation 179. The column selected is the first column where ''y'' is less than the ''y<sub>0</sub>'' value of the next column.


{| class="roundtable" style="text-align:center; background:#C0C0FF; border:3px solid blue; margin:auto"
{| class="roundtable" style="text-align:center; background:#C0C0FF; border:3px solid blue; margin:auto"
Line 219: Line 239:
|}
|}


The values of ''x<sub>0</sub>'', ''m'', and ''y<sub>0</sub>'' are then used to convert the uniformly distributed value ''y'' to the normally distributed value ''x''.
The values of ''x<sub>0</sub>'', ''m'', and ''y<sub>0</sub>'' are then used to convert the uniformly distributed value ''y'' to the normally distributed value ''x'' (the scale factor).


<math display="block">x = x_0 + \left\lfloor \frac{y - y_0}{m} \right\rfloor</math>
<math display="block">x = x_0 + \left\lfloor \frac{y - y_0}{m} \right\rfloor</math>


The final part of the calculation scales ''h'' (the species' [[List of Pokémon by height|height]] in tenths of a meter) by the ''x'' value to produce the Pokémon's size in millimeters. The size is bounded between 0.29 and 1.725 times the standard metric height for the species (as listed in the Pokédex), rounded down.
The final part of the calculation scales ''h'' (the species' [[List of Pokémon by height|height]] in tenths of a meter) by ''x'' (the scale factor) to produce the Pokémon's size in millimeters. The size is bounded between 0.29 and 1.725 times the standard metric height for the species (as listed in the Pokédex).


<math display="block">\textit{Size} = \left\lfloor\frac{h \cdot x}{10}\right\rfloor</math>
<math display="block">\textit{Size} = \frac{h \cdot x}{10}</math>


If the game converts this number to inches, the final result will be rounded down to the nearest tenth of an inch.
How the final result is rounded differs slightly between games:
* In the Generation III games, the size is '''rounded down''' to the nearest millimeter. If the game converts sizes to inches, this rounded size is converted and '''rounded down''' to the nearest tenth of an inch.
* In the Generation IV games, the size is '''rounded down''' to the nearest millimeter. If the game converts sizes to inches, this rounded size is converted and '''rounded''' to the nearest tenth of an inch (rounding half down).
* In Pokémon Brilliant Diamond and Shining Pearl, the size is '''rounded''' to the nearest millimeter. If the game converts sizes to inches, the size '''prior to rounding''' is converted and '''rounded''' to the nearest tenth of an inch.


===Generation VII===
===Generation VII===
Line 425: Line 448:
While {{g|Brilliant Diamond and Shining Pearl}} generate individual height and weight scalar values the same way as before, these values go unused unless transferred to a game that supports them.
While {{g|Brilliant Diamond and Shining Pearl}} generate individual height and weight scalar values the same way as before, these values go unused unless transferred to a game that supports them.


Once again, a Fisherman on [[Route 222]] can be shown {{p|Remoraid}}, and will judge their height. The game uses the same calculation from Generation III and IV, only substituting the Pokémon's [[Personality value]] for its [[Encryption constant]].
Once again, a Fisherman on {{rt|222|Sinnoh}} can be shown {{p|Remoraid}}, and will judge their height. The game uses the [[#Generations III and IV|same calculation from Generation III and IV]], only substituting the Pokémon's [[encryption constant]] for its [[personality value]].


====Pokémon Legends: Arceus====
====Pokémon Legends: Arceus====
Line 736: Line 759:


Due to an oversight, {{p|Phione}}'s scalar values are not locked when spawned in-game.
Due to an oversight, {{p|Phione}}'s scalar values are not locked when spawned in-game.


===Generation IX ===
===Generation IX ===