Jump to content

Luck manipulation: Difference between revisions

m
→‎Principle: Clarified a little in response to a comment.
>Torchickens
No edit summary
m (→‎Principle: Clarified a little in response to a comment.)
 
(19 intermediate revisions by 3 users not shown)
Line 1:
{{Collective Page}}
{{Bulbapedia2|Pseudorandom number generation in Pokémon}}
'''Luck manipulation''' or '''RNG abuse''' ('''pseudorandom number generator abuse''' in full), or '''RNG manipulation''' refers to making a future event that is supposed to be random predictable, such as whether a wild Pokémon is [[bp:Shiny Pokémon|shiny]] or has good [[bp:Individual values|IVs]], whether a thrown ball successfully catches the Pokémon, misses and critical hits in battle, etc. Sometimes a desired "random" outcome could be achieved through trial and error simply by frame-by-frame advance and save states, but advanced manipulation techniques can save time in getting otherwise unlikely outcomes.
 
== Principle ==
In software and most computer games, a '''pseudorandom number generator''' is used to handle events which rely on some form of luck. This applies to (as of now) all of the Pokémon games and is used to generate a value which can determine whether for example if the player encounters a shiny Pokémon at an approximated chance of 1 in 8192.
The word "random" is essentially synonymous with "unpredictable". It is believed that [https://en.wikipedia.org/wiki/Hardware_random_number_generator some physical processes] are "truly random", i.e. absolutely unpredictable ahead of time, due to underlying quantum effects. However, specially designed hardware is usually needed to utilize those truly random physical processes. Other "random" processes, like rolling a dice or tossing a coin, have their results almost completely determined by the initial conditions, like the height, velocity, and spinning speed of the throw. However, since it is almost impossible for a normal human to control or otherwise determine those parameters to the precision needed to predict the results, those processes can also be considered random.
 
The "randomness" in computers and video games is usually of the latter kind — deterministic given initial conditions, but difficult to predict nonetheless. In this case, the "initial conditions" mostly come from user inputs, including their precise timings. It is theoretically possible for cycle-level (on the order of 10<sup>-6</sup> second) timings to affect the state of the hardware (possibly in subtle ways, like forcing the V-Blank interrupt to wait for an instruction to complete). Frame-level (~1/60 s) timings tend to affect it in more significant ways, although depending on the specific implementation of the RNG and the game in general, inputs at some frames may not be factored into the RNG.
As its name suggests, the pseudorandom number generator is not truly random in the sense that the game or software will depend on a set of constant, initial values known as the 'state' and the 'random seed'. For this reason, several players have manipulated the pseudorandom number generator to generate a random seed which would give him or her a shiny Pokémon.
 
The internal state of an RNG is sometimes known as the "seed". Since many random numbers might be needed at a time when there are few or no external inputs, the unpredictability of random numbers depend on the unpredictability of the seed. Even if unpredictable at the beginning, a seed of finite length cannot generate an infinite sequence of truly random numbers, as each random number carries a certain amount of information about the seed, eventually making the seed, and thus further random numbers, predictable. The best RNG designers could do is to make the outputs "pseudorandom", i.e. making it a difficult computational task to predict later outputs from previous ones. However, real world RNGs, especially ones from old console games, are often not very carefully designed, making it feasible to analyze the outputs and retrieve the seed.
==How pseudorandom number generators are used in the Pokémon games==
 
By controlling the timings of the input, the player can to some extent control the seed. By observing random outcomes, the player can to some extent deduce the seed. Either or both of those techniques may allow for luck manipulation in video games.
Two pseudorandom number generators exist in Pokémon Diamond and Pearl.
 
== In speedruns ==
The first pseudorandom number generator manages the encryption of Pokémon data in the save file (also known as the hidden ID number), the generation of the Personality Value, the Individual Values of a wild Pokémon, the species of wild Pokémon when encountered in a particular area and for determining the lottery number.
 
=== TAS ===
The second pseudorandom number generator creates a value, determining the species of a Pokémon swarm, the species of Pokémon found in the telescopes within the Great Marsh and the Pokémon found in the Trophy Garden. The algorithm specifically ensures that Mystery Gift Pokémon and a Manaphy hatched from an Egg from Pokémon Ranger is not shiny. This pseudorandom number generator instead uses the algorithm (0x6C078965 * Seed) + 0x1, where 0x6C078965 is the integer 1822919013 and 0x1 is the integer 1.<br /><br />Before the pseudorandom number generator is used the game will use generate a 'random' number based on the value of a [[dword]] (known as the random seed or 'seed state'). The seed can range from any value between 1 and 4294967295 and is usually generated after the player chooses 'Continue' on the title screen, except in Pokémon Emerald. The random seed changes depending on variables which are 'almost random', such as the game clock time or the amount of recent coin tosses. To determine a 'random' number the game will then use the algorithm (0x41C64E6D * Seed) + 0x6073, where 0x41C64E6D is the integer 1103515245 and where 0x6073 is the integer 24691. <br />
In tool assisted speedruns (TASes), human precision is not an issue, so the player can get the desired outcomes for all the random events, as long as they are possible at all (although sometimes frames might need to be sacrificed). Therefore from the watcher's perspective, the player would seem to be absurdly lucky. In Pokémon TASes, this might mean getting all the critical hits that would save a turn while the opponent repeatedly misses moves, or walking through caves with no Repels and no encounters, etc. <!-- maybe mention button input delay? -->
 
The fact that all "randomness" becomes controlled is also why TASes can be encoded as input files ("movie files") instead of videos, and played back on an emulator/console (through the use of a machine). However, as mentioned above, the RNG is affected by some very subtle factors, including hardware timing details. Therefore de-synchronization may occur if the movie file is played on a different emulator/console than the one used to make it, simply because one (or both) of the emulators/consoles didn't mimic the original hardware down to the finest detail.
===Random seed oversight in Pokémon Emerald and Pokémon Platinum===
 
=== RTA ===
Presumably an oversight by the game developers in Pokémon Emerald and Pokémon Platinum has meant that a random seed will no longer change after the player selects Continue, therefore this has made catching shiny in-game event Pokémon more predictable. If a player does not encounter a shiny Pokémon the first time he or she can soft-reset and it will be presumable that the random seed would have remained the same after exiting the title screen, hence it is easier to track changes to the random seed.
In contrast to the case for TAS, the main focus of RTA manipulations is human precision. A common technique used in many RTA manipulations is to first save and reset. Since many games do not save any RNG-related information into the save file, after a hard reset, the state of the RNG is fully predictable. This relieves the player of the need to do every RNG-affecting input frame perfectly from the very beginning of the game.
 
Other techniques help the player reliably do a few frame-perfect inputs after the reset. A common one is "buffering" an input, which means pressing a button before the game is ready to accept it, essentially extending the frame window in which the input can be done. Another is the use of timers which provide audio or video cues, making it easier to hit even single-frame windows. Some manipulations are specifically designed so that multiple adjacent frames give the same desirable outcome. Others let the player look for cues like overworld NPC movements, and then do different manipulations to "recover" from an input that was a little early or a little late.
==Abuse of the generated characteristics of a hatched Pokémon in Pokémon Platinum==
 
Since RTA manipulations are both time-consuming (mainly due to the hard reset) and potentially difficult, they are only used for rare random outcomes that can save a lot of time over the course of the run, or that the route is based on in the first place. In glitchless runs, commonly manipulated events include:
Several players have taken advantage of the fact that a different random-seed will not be generated in Pokémon Platinum when the player selects 'Continue' on the title screen and will only depend on other main game variables such as game time. In this way, the random seed is more predictable and can be tracked via a [[game-altering device]] or knowledge of the relevant pseudo-random number generation algorithm and an additional algorithm determining how the random seed changes after performing simple actions like tossing a coin on the Coin Toss Pokétch application.
 
* Getting a main Pokémon with good IVs (might be either the starter or a wild encounter).
Requirements:
* Encountering the correct species of wild Pokémon (either main or HM users), and catching it with the first ball.
* Not getting unwanted encounters before Repels can be bought.
 
For glitched runs, RNG manipulations are used more intensively. In addition to the above purposes, they are used to manipulate exact byte values that are needed for specific exploits that reference values not relavant in glitchless runs (like the player's Trainer ID and Lucky ID).
#The player will need the Happiness Application for his or her Pokétch (the sixth application).
#The player will need the Coin Toss Application for his or her Poketch (the fifteenth application).
#Parents to produce the Pokémon Egg should either be ready in party or in the box.
#Five Pokémon should be in the party.
#A clock to be synchronized with the DS clock.
#The player needs to be on a patch of grass and should save the game.
#A Pokémon with Sweet Scent.
#Any type of Pokéball, preferably the player should have a few of them incase he or her fails to catch the Pokémon.
#Knowledge of a SID (Shiny Identification) which will allow the player to obtain a Shiny Pokémon (through calculation the player can use the SID of a shiny Pokémon which he or she already knows.
 
== Outside of speedruns ==
Method:
 
Luck manipulation techniques can be used to get shiny Pokémon and Pokémon with perfect IVs, a necessity for competitive players both in casual Wi-Fi battles and in sanctioned tournaments. The techniques for that will be detailed in the sub-pages.
#Select the fifth Pokétch application (a summary of the player's party and their current hitpoints) and reset the game.
#Note the time in hours and minutes after selecting Continue.
#Use Sweet Scent and catch the Pokémon that appears.
#Through the use of an equation, estimate the Individual Values of that Pokémon by taking into account its stats, its nature and its Effort Values (those should all be zero if first captured)
#Perform a relevant amount of coin flips based on information about the date, the time in hours and minutes, the Pokémon's nature, the Pokémon's ID and the Pokémon's SID.
#Deposit the parents into the Day-Care center.
#The Egg which hatches should be shiny.
 
== In each generation ==
 
With each new generation of Pokémon (excluding the first two), the mechanics and means of application of the RNG have changed drastically. With the exception of the four entries in Generation VI, the RNG can be predicted and controlled without external tools or modifications.
==Rumors of increasing the initial catch rate of Pokéballs==
 
*[[Luck manipulation (Generation I)]]
''Main article: [[Glitch Myths]]''
*[[Luck manipulation (Generation II)]]
*[[Luck manipulation (Generation III)]]
*[[Luck manipulation (Generation IV)]]
*[[Luck manipulation (Generation V)]]
*[[Luck manipulation (Generation VI)]]
*[[Luck manipulation (Generation VII)]]
*[[Luck manipulation (Colosseum/XD)]]
 
=== Individual points of interest ===
There have been rumors that if the player holds the B button before throwing a Pokéball it will apparently increase the chances of catching that Pokémon; however those rumors have been proven to be false.
 
*[[Battle Video exploit‎]]
*[[Cute Charm exploit]]
*[[RNG correlation (Generation I)]]
*[[RNG oddities (Generation III)]]
 
==External Links==
 
*[http://wiki.pokemonspeedruns.com/index.php/Pok%C3%A9mon_Red/Blue/Yellow_DSum_Manipulation Pokémon Red/Blue/Yellow DSum manipulation], an older generation I technique to manipulate encounter slots based on deducing the RNG state instead of controlling it
[http://www.youtube.com/watch?v=T40oaiVrR5g] - A player manipulates the pseudorandom number generator so that he or she can hatch a shiny Cyndaquil.
*[http://www.smogon.com/ingame/rng/emerald_rng_intro Smogon's guide to Pokémon Emerald RNG abuse]. <!-- Most of this is fine, albeit uninformative, but the Method 1 and wild encounter subpages are outdated and shouldn't be referenced. The other two are very good all around. -->
*[http://www.smogon.com/ingame/rng/dpphgss_rng_intro Smogon's guide to Generation IV RNG abuse].
*[http://www.smogon.com/ingame/rng/bw_rng_intro Smogon's guide to Pokémon Black and White RNG abuse].
 
[[Category:ExploitsNon-glitch exploits]]
[http://users.smogon.com/mingot/rngreporter.htm] - A calculator to help players find the SID of a Pokémon, and the relevant amount of coin tosses required for the next Pokémon egg to be shiny.
[[Category:Terminology]]
 
[[Category:Reference documents]]
[http://en.wikipedia.org/wiki/Pseudorandom_number_generator] - An article on Wikipedia about pseudorandom number generators in general.
[[Category:Exploits]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.