Mystery Gift: Difference between revisions

m
relinking
m (updated links)
m (relinking)
Line 257: Line 257:


=====Pseudorandom number generator limitations=====
=====Pseudorandom number generator limitations=====
Due to the way the [[Pseudorandom number generation in Pokémon|pseudorandom number generator]] in Pokémon Stadium 2 works, the random numbers used for Mystery Gift selection fall into a cycle of 256 values (none repeating).<ref>[https://projectpokemon.org/home/forums/topic/63867-pokemon-stadium-2-mystery-gift-mechanisms/ projectpokemon - Why Tentacool Doll and Pikachu Bed are unobtainable]</ref> This essentially means that numbers after the first are not random: they cannot have their full range of possible values. Since decorations are checked immediately after items, decorations are also dependent on the value that was used when starting the item check. As a consequence, some items or decorations above may have rates slightly higher than their ideal rates (if all numbers were truly random); this most strongly affects uncommon items and decorations. It also affects two decorations that should be obtainable but are not.
Due to the way the [[Pseudorandom number generation|pseudorandom number generator]] in Pokémon Stadium 2 works, the random numbers used for Mystery Gift selection fall into a cycle of 256 values (none repeating).<ref>[https://projectpokemon.org/home/forums/topic/63867-pokemon-stadium-2-mystery-gift-mechanisms/ projectpokemon - Why Tentacool Doll and Pikachu Bed are unobtainable]</ref> This essentially means that numbers after the first are not random: they cannot have their full range of possible values. Since decorations are checked immediately after items, decorations are also dependent on the value that was used when starting the item check. As a consequence, some items or decorations above may have rates slightly higher than their ideal rates (if all numbers were truly random); this most strongly affects uncommon items and decorations. It also affects two decorations that should be obtainable but are not.


The very rare gift set for decorations actually contains Big Lapras Doll, Surf Pikachu Doll, Tentacool Doll, and Pikachu Bed, but the last two are unobtainable. Upon reaching the very rare gift set for decorations, the game actually picks a fourth random number between 0 and 255 and performs the following logic. <ref>[https://github.com/Lincoln-LM/stad2/blob/main/src/mystery_gift.c stad2/blob/main/src/mystery_gift.c at master · Lincoln-LM/stad2]</ref>
The very rare gift set for decorations actually contains Big Lapras Doll, Surf Pikachu Doll, Tentacool Doll, and Pikachu Bed, but the last two are unobtainable. Upon reaching the very rare gift set for decorations, the game actually picks a fourth random number between 0 and 255 and performs the following logic. <ref>[https://github.com/Lincoln-LM/stad2/blob/main/src/mystery_gift.c stad2/blob/main/src/mystery_gift.c at master · Lincoln-LM/stad2]</ref>