Size and weight variation: Difference between revisions

→‎In the core series games: Add details about the normal distributions
m (→‎Rates: I assume this table was intended to be sorted by size (since it's clearly not attempting to be sorted by rate))
(→‎In the core series games: Add details about the normal distributions)
Line 4: Line 4:
===Generation II===
===Generation II===
[[File:Size variation II.png|thumb|250px|Histogram of size variation in Generation II]]
[[File:Size variation II.png|thumb|250px|Histogram of size variation in Generation II]]
At the [[Lake of Rage]], there is a [[Fishing Brothers#Lake of Rage Fishing Guru|Fishing Guru]] who requests to see large Magikarp after the player defeats [[Team Rocket]] at [[Team Rocket HQ|their hideout]] in [[Mahogany Town]]. The size of these Magikarp roughly follows a {{wp|normal distribution}}, and depends on its [[individual values]] and its [[Original Trainer]]'s [[Trainer ID number]]. If he is shown a Magikarp bigger than the previous record, he gives the player a prize; the initial record is 3'6" (105.3 cm). A Pokémon is considered to have beat the previous record if its calculated size in feet and inches (in millimeters in non-English games) is greater than the previous record.
At the [[Lake of Rage]], there is a [[Fishing Brothers#Lake of Rage Fishing Guru|Fishing Guru]] who requests to see large Magikarp after the player defeats [[Team Rocket]] at [[Team Rocket HQ|their hideout]] in [[Mahogany Town]]. If the Fishing Guru is shown a Magikarp bigger than the previous record, he gives the player a prize; the initial record is 3'6" (105.3 cm). A Pokémon is considered to have beaten the previous record if its calculated size in feet and inches (in millimeters in non-English games) is greater than the previous record.
 
The size of Magikarp is calculated from its [[individual values]] (IVs) and its [[Original Trainer]]'s [[Trainer ID number]]. Sizes were intended to follow a {{wp|normal distribution}}, with a {{wp|mean}} of 80 cm and {{wp|standard deviation}} of 17.85 cm (approximately); however, due to various bugs and oversights in the code, the sizes of Magikarp only roughly follow this distribution.


====Rates====
====Rates====
In non-English games, large Magikarp are made rarer by regenerating the IVs of Magikarp that are 161.6 cm (5'3") or larger 95% of the time and Magikarp that are between 160.0 cm (5'2") and 161.5 cm (5'3") 76% of the time. Due to an oversight, these values were not properly converted to feet and inches in English-language games, meaning that they only attempt to regenerate the IVs of Magikarp that are 6'0" (182.9 cm) or larger; this has no effect, as no Magikarp can be that large.
In non-English games, large Magikarp are made rarer by regenerating the IVs of wild Magikarp that are 161.6 cm (5'3") or larger 95% of the time, and Magikarp that are between 160.0 cm (5'2") and 161.5 cm (5'3") 76% of the time. In the English-language games, due to an oversight, these values were not properly converted to feet and inches, meaning that the game only attempts to regenerate the IVs of Magikarp that are 6'0" (182.9 cm) or larger; this has no effect, as no Magikarp can be that large.


Magikarp caught in the Lake of Rage were intended to be larger on average than Magikarp caught elsewhere, by regenerating the IVs of Magikarp that are 4'0" (122.0 cm) or smaller in English games or 102.4 cm (3'4") or smaller in non-English games or smaller 60% of the time. Due to a programming error, all Magikarp ''except'' for those in the Lake of Rage and [[Route]]s {{rtn|20|Kanto}}, {{rtn|43|Johto}}, and {{rtn|44|Johto}} are larger on average, due to those maps having either the same map group (9) or map identifier (6) as the Lake of Rage.
Magikarp caught in the Lake of Rage were intended to be larger on average than Magikarp caught elsewhere, by regenerating the IVs of wild Magikarp that are 4'0" (122.0 cm) or smaller in English games, or 102.4 cm (3'4") or smaller in non-English games, 60% of the time. Due to a programming error, all wild Magikarp except for those in the Lake of Rage and [[Route]]s {{rtn|20|Kanto}}, {{rtn|43|Johto}}, and {{rtn|44|Johto}} are larger on average. The other maps are grouped with the Lake of Rage due to those maps having either the same map group (9) or map identifier (6) as the Lake of Rage.


The following table indicates the base probability of each size of Magikarp, ignoring rerolls and correlations between [[Pseudorandom number generation in Pokémon|pseudorandom numbers]].
The following table indicates the base probability of each size of Magikarp, ignoring rerolls and correlations between [[Pseudorandom number generation in Pokémon|pseudorandom numbers]].
Line 111: 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 the {{wp|normal cumulative distribution function}}. Due to a programming error, only the high bytes of ''y'' and ''y<sub>0</sub>'' are compared; this results in the first and last columns being 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 piecewise linear approximation of the inverse of a {{wp|normal cumulative distribution function}} with mean 800 and standard deviation 178.5. 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), so the sizes do not correctly follow a normal distribution as intended.


{| 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 127: Line 129:
|}
|}


If one of the entries in the table matches, the final length of the Magikarp in millimeters is then calculated as follows. Due to a programming error, the function does not output <math display="inline">100 \cdot x_0 + \left\lfloor \frac{y - y_0}{m} \right\rfloor</math> as intended. Because ''y'' is always less than ''y<sub>0</sub>'', the subtraction always results in a negative value; however, the division routine expects the dividend to be an unsigned 16-bit value. Additionally, only the low byte of the quotient is read, as the difference between ''y'' and ''y<sub>0</sub>'' was intended to only range from 1 to 100.
If one of the entries in the table matches, the final length of the Magikarp in millimeters is then calculated as follows. Due to a programming error, the function does not output <math display="inline">100 \cdot x_0 + \left\lfloor \frac{y - y_0}{m} \right\rfloor</math> as intended. Because ''y'' is always less than ''y<sub>0</sub>'' due to the lookup not working as intended, the subtraction always results in a negative value, but the division routine expects the dividend to be an unsigned 16-bit value. Additionally, only the low byte of the quotient is read, as the difference between ''y'' and ''y<sub>0</sub>'' was intended to only range from 1 to 100.


<math display="block">\textit{Size} = 100 \cdot x_0 + \left( \left\lfloor \frac{65536 + y - y_0}{m} \right\rfloor \mathrm{mod}\ 256 \right)</math>
<math display="block">\textit{Size} = 100 \cdot x_0 + \left( \left\lfloor \frac{65536 + y - y_0}{m} \right\rfloor \mathrm{mod}\ 256 \right)</math>
Line 137: 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. The size of these Pokémon follows a {{wp|normal distribution}}, and is calculated from its [[individual values]] and its [[personality value]]. 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}}, 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.
 
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).


====Locations====
====Locations====
Line 151: Line 155:
| {{p|Barboach}} and {{p|Shroomish}}
| {{p|Barboach}} and {{p|Shroomish}}
| 15.7 in
| 15.7 in
| 40.0 cm <!-- s = 0x8100 -->
| 40.0 cm <!-- y = 0x8100 -->
|-
|-
| {{gameabbrev3|E}}
| {{gameabbrev3|E}}
Line 157: Line 161:
| {{p|Seedot}} and {{p|Lotad}}
| {{p|Seedot}} and {{p|Lotad}}
| 19.6 in
| 19.6 in
| 50.0 cm <!-- s = 0x8000 -->
| 50.0 cm <!-- y = 0x8000 -->
|-
|-
| {{gameabbrev3|FRLG}}
| {{gameabbrev3|FRLG}}
Line 178: Line 182:
| {{p|Magikarp}}
| {{p|Magikarp}}
| 41.9 in
| 41.9 in
| 106.5 cm <!-- s = 56150 -->
| 106.5 cm <!-- y = 56150 -->
|}
|}


Line 192: Line 196:
<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 the {{wp|normal cumulative distribution function}}.
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.


{| 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 200: Line 204:
! x<sub>0</sub>
! x<sub>0</sub>
| 290 || 300 || 400 || 500 || 600 || 700 || 800 || 900 || 1000 || 1100 || 1200 || 1300 || 1400 || 1500 || 1600 || 1700
| 290 || 300 || 400 || 500 || 600 || 700 || 800 || 900 || 1000 || 1100 || 1200 || 1300 || 1400 || 1500 || 1600 || 1700
|-
! y<sub>0</sub>
| 0 || 10 || 110 || 310 || 710 || 2710 || 7710 || 17710 || 32710 || 47710 || 57710 || 62710 || 64710 || 65210 || 65410 || 65510
|-
|-
! m
! m
| 1 || 1 || 2 || 4 || 20 || 50 || 100 || 150 || 150 || 100 || 50 || 20 || 5 || 2 || 1 || 1
| 1 || 1 || 2 || 4 || 20 || 50 || 100 || 150 || 150 || 100 || 50 || 20 || 5 || 2 || 1 || 1
|-
! y<sub>0</sub>
| 0 || 10 || 110 || 310 || 710 || 2710 || 7710 || 17710 || 32710 || 47710 || 57710 || 62710 || 64710 || 65210 || 65410 || 65510
|}
|}