Table of Contents [JUMP=#preliminary_information]Preliminary Information[/JUMP] [JUMP=#method_1]Method 1 Pokémon[/JUMP] [JUMP=#method_h]Wild Pokémon: Method H[/JUMP] [JUMP=#practical]Practical Applications[/JUMP] [JUMP=#tid_sid]Trainer ID and Secret ID Generation[/JUMP] [JUMP=#faq]"Frequently Asked" Questions[/JUMP] [JUMP=#research_questions]Research Questions[/JUMP] [JUMP=#helpful_links]Helpful Links[/JUMP] [JUMP=#general_resources]General Resources[/JUMP] [JUMP=#applications]Applications[/JUMP] [JUMP=#credits]Credits[/JUMP] 12/20/11 Update: RNG Reporter now supports Method H, the method of Wild Pokémon generation supported in FireRed and LeafGreen. 09/14/11 Update: The technically inclined may see Bond697's latest posts on Method Determination and GBA Video Functions. [A]#preliminary_information[/A] Preliminary Information Abusing the Random Number Generator of FireRed and LeafGreen is very difficult in comparison to games such as Emerald or Diamond and Pearl. Many users have found success thanks to save states from emulators, though the goal of this topic is to facilitate this process for those using actual game paks. One of the most important pieces of knowledge in the puzzle of RNG abuse is the "seed". A "seed" is a number that is initially plugged into the formula used to generate strings of pseudo-random numbers. If we know the seed, it is possible to determine the sequence of pseudo-random numbers it creates. In Emerald, we always know the seed, as it is 0 each time the game starts up. In Diamond and Pearl, we can manipulate the seed by starting the game at a certain time, and hitting a certain delay. FireRed and LeafGreen operate in a different fashion than the abovementioned games, but they share certain similarities with all of them. They still make use of a seed, which generates a set of frames—simply put, a frame is the spot when the RNG generates a certain PID (a nature and IVs for Pokémon). User flovv has looked into the game's code and discovered the specifics of seeding for FireRed and LeafGreen: Seed Creation (Move your mouse to reveal the content) Seed Creation (open) Seed Creation (close) Researcher Kaphotics has also noted that the current seed information is stored in memory location 0x03005000. Frequent contributor mattj has summarized much information concerning seeding and the advancement of frames as follows: It is important to note that "button mashing" is undesirable due to its effects on seed groupings. It is much better to be deliberate with button presses whenever you are booting up the game. User NeoSyrex also has information concerning the FireRed/LeafGreen RNG, which he famously applied to capture a Zapdos for use in the Video Game Championsips. The information provided by NeoSyrex is as follows: This seed may be found manually by program FR/LG Seed Finder, which is attached to this post. NeoSyrex, the author of this program, says the following: As mentioned earlier, it is possible to generate a list of upcoming spreads using mingot's RNG Reporter program. This is more reactive RNG manipulation than proactive, but this is the best we have at the moment. From here, it is possible to aim for a spread that you want by hitting its frame. Frames advance in realtime in a similar vein to Emerald, albeit with a catch. In a "quiet" area, such as outside Mt. Moon, the RNG advances at approximately 60 frames per second. However, this does not apply to all locations in the game. In certain locations, the RNG advances somewhat differently. The RNG runs in an altered state in certain areas (many of which seem to be interior), cycling through either odd frames, or even frames. For example, if the game chooses odd frames, it will only cycle through frames 1, 3, 7, 9, 11, and so on. This creates the illusion that the RNG is advancing at 120 frames per second, when it is actually skipping over one type of frame. However, you can change whether the RNG will cycle through even or odd frames. This is achieved through opening up the menu, saving your game, and possibly other actions that have yet to be documented. This will cause the frames to switch to the opposite types; if the game was cycling through odd frames, it will now cycle through even frames, and vice versa. The specifics of quiet and noisy frame advancement are not yet known. It would also seem that noisy and quiet areas are not necessarily consistent; noisy areas can be silenced through a technique described by flovv: At the moment, you would look through the list of spreads generated by your recurring seeds until you found one you wanted. [A]#method_1[/A] Method 1 Pokémon Much like Emerald, FireRed and LeafGreen Bulbasaur, Charmander, Squirtle, Clefairy¹, Abra¹, Hypno², Voltorb³, Electrode³, Hitmonlee, Hitmonchan, Scyther¹, Pinsir¹, Magikarp⁴, Lapras, Eevee, Porygon, Omanyte, Kabuto, Aerodactyl, Snorlax, Articuno, Zapdos, Moltres, Dratini¹, Mewtwo, Togepi, Lugia, Ho-Oh, and Deoxys ¹Only Clefairy, Abra, Scyther, Pinsir, and Dratini bought at the Game Corner are consistently generated by method 1. Scyther is exclusive to FireRed, whereas Pinsir can only be found in LeafGreen. ²Only the Hypno encountered by Lostelle in the Berry Forest is consistently generated by method 1. ³Only Voltorb and Electrode disguised as Poké Balls are consistently generated by method 1. ⁴Only Magikarp bought from the salesman in the Pokémon Center on Route 3 are consistently generated by method 1. Note that as in Emerald, a Pokémon's spread is not necessarily selected at the precise moment you press A next to its overworld sprite. Rather, the RNG keeps cycling right up until the battle starts (or in the case of gift Pokémon, it is received), unless "spread selected" is indicated in the place of "last input". A list of where to save and the last inputs for each Pokémon is as follows: Bulbasaur/Charmander/Squirtle: Save in front of the Poké Ball containing the starter of your choice. Spread selected upon pressing the A button after the message "This POKéMON is really quite energetic!" appears. Abra/Clefairy/Dratini/Scyther/Pinsir/Porygon: Save in front of the Game Corner Prize Corner desk. Spread selected after pressing A when the message "So, you want the [ABRA/CLEFAIRY/DRATINI/SCYTHER/PINSIR/PORYGON]?" appears. Hypno: Save in front of Lostelle in the Berry Forest. Last input is a press of the A button after Lostelle wails "Waaaaaaah! I want my daddy!" Hitmonlee/Hitmonchan: Save in front of the Poké Ball which contains the Pokémon of your choice. Spread selected after pressing A when the message "You want the hard-kicking HITMONLEE?" or "You want the piston-punching HITMONCHAN?" appears. Magikarp: Save in front of the salesman in the Route 3 Pokémon Center. Last input is a press of the A button after he asks "So you’ll buy it, am I right?" Lapras: Save in front of the Silph employee nearest to your rival. Spread selected with a press of the A button after he says "I want you to have this POKéMON for saving us." Omanyte/Kabuto/Aerodactyl: Save in front of the important doctor who revives Pokémon fossils. Spread selected after pressing A when he says "Your fossil is back to life! It was [OMANYTE/KABUTO/AERODACTYL] like I think!" Snorlax: Save in front of the sleeping Snorlax. Last input is a press of the A button when the message "It attacked in a grumpy rage!" is displayed. Articuno/Zapdos/Moltres: Save in front of the legendary bird. Last input is a press of the A button after it cries "Gyaoo!" Mewtwo: Save in front of the Genetic Pokémon. Last input is a press of the A button when it says "Mew!" Togepi: Save in front of the man in Five Island's Water Labyrinth. Spread selected upon pressing A when he says "Please, I'd like you to have this." Ho-Oh: Save on the first space of the peak of the cliff. Last input is pressing up on the directional pad to place yourself on the second space of the cliff. Other: Save directly in front of the Pokémon’s overworld sprite. Last input is a press of the A button to "activate" the battle. In the case of Deoxys, the red-hot rock serves as the overworld sprite. In the case of Eevee, the Poké Ball that houses it counts as its overworld sprite, and no battle is required. Note that freezing or changing certain values in an emulator can alter a Pokémon's generation and lead to an illegal result. Due to a phenomenon known as vBlank (detailed in Bond697's posts on GBA Video Functions), "Method 1" Pokémon can also be generated through methods 2 and 4, but this is not the default behaviour; know if you get an abnormal spread for a method 1 Pokémon, this is the factor at work. [A]#method_h[/A] Wild Pokémon: Method H FireRed and LeafGreen use a method known as Method H (which comes before the "Method J" and "Method K" with which you may be familiar if you have done RNG manipulation in the fourth generation) to generate their wild and Pokémon. This is the same method used in Ruby and Sapphire, and is now supported in the latest version of RNG Reporter (9.93). More technical information is available below in HIDE tags. What you need to know is that all wild Pokémon are generated using Method H, but with a bias towards the Method 2 variant. Old Technical Information (Move your mouse to reveal the content) Old Technical Information (open) Old Technical Information (close) As for the encounter slots of FireRed and LeafGreen, Zari states that they appear to (for the most part) conform to the same twelve-slot format as the fourth generation games. In other words, for all areas with twelve Pokémon listed, the slots should correspond to the following: 20% / 20% / 10% / 10% / 10% / 10% / 5% / 5% / 4% / 4% / 1% / 1% This information has been corroborated by a separate study conducted by Kaphotics in the RNG Research thread, as seen below (post edited to remove R/S/E information): The encounter slots seem to differ when using each Fishing Rod, which Kaphotics has also addressed below: Code: Old Rod Slot 0: 0-69 Slot 1: 70-99 Good Rod Slot 0: 0-59 Slot 1: 60-79 Slot 2: 80-99 Super Rod Slot 0: 0-39 Slot 1: 40-79 Slot 2: 80-94 Slot 3: 95-98 Slot 4: 99 For a comprehensive list of encounter slots for each game, please refer to this post. For those interested in the technical side of PID generation, Kaphotics has laid out a simplified version of the process as follows: Setup of everything before PID: Code: 0 - Initial 1 - Battle Decision, pretty long thing = Battle 2 - Encounter Slot Value (0-99), via Upper16 %100 = Slot 3 - Encounter Level (from Slot), via Upper16 %(High-Low+1) + Low = Level 4 - Encounter Nature, via Upper16 %25 = Nature Now to generate a PID. Code: set n = 0 loop until break to get a PID%25 = Nature 5+n - Temp Low16PID 6+n - Temp High16PID if High16PID_Low16PID % 25 = Nature set as the PID, break else n=n+2 repeat loop end end Then comes the IVs, which depend on the Method of Generation. Not sure if this is that calc at frame 1, the rejection of IV bits, or something else. Code: if Method 1 a = 0 b = 0 elseif Method 2 a = 1 b = 0 elseif Method 4 a = 0 b = 1 end 7+n + a - IVSet1 8+n + a+b - IVSet2 [A]#practical[/A] Practical Applications As for the practical side of RNG manipulation, in light of recent (12/20/11) Method H information, OmegaDonut has proposed a method of manipulating gift and wild Pokémon that is simpler than ever. Read his post here for a quick breakdown: In the event that you wish to have the luxury of recalibration, NixHex's original method can be found below: User Zari has taken the information we have right now and created a method of RNG manipulation that makes RNG manipulation in FireRed/LeafGreen more accessible to the average user, even if it is not entirely possible to manipulate the seed at will. As NixHex has put it, try thinking of this method as a variant of Emerald, albeit one with more options from which to choose. Zari's post below describes his method: Note that triggering the advance to the start screen at the right instant will yield better results than mashing buttons either to a beat or as quickly as possible. Zari notes that three button presses are needed to execute the skipping method. Zari has also kindly compiled a list of the different seeds found: Code: By groupings: 9eXX [02 - 2d] 9e02 * 2 9e03 9e0a * 2 9e0b * 4 9e0c * 2 9e0d 9e0f * 4 9e13 * 8 9e14 * 10 9e18 9e1c 9e1d * 2 9e29 * 2 9e2d 54XX [c2 - f3] 54c2 * 2 54c3 54ca * 2 54cb * 6 54cf * 2 54d2 * 2 54d3 * 3 54d4 * 10 54d7 54d8 54db 54de * 2 54e0 54ed * 2 54f3 30XXv1 [82 - a8] 3082 3083 308a 308b * 5 308e 3093 3098 309c 30a0 30a8 30XXv2 [3d - 5a] 303d 3045 * 2 3046 * 2 3047 3048 304b 304c * 5 304d * 2 304f * 2 3050 3056 * 2 305a e7XX [42 - 72] e742 e749 e747 e74b * 9 e74f * 5 e753 e758 * 3 e75c * 2 e75d * 3 e769 e771 e772 * 3 Here is Zari's success story in which he details how he caught his Mewtwo in Kanto: [A]#tid_sid[/A] Trainer ID and Secret ID Generation The RNG is constantly running during Professor Oak's introduction to the player, and the point at which the player's ID, or visible Trainer ID is created has been found, as well as the moment when the invisible Secret ID is generated. Our knowledge of the TID/SID generation process will hopefully allow manipulators to obtain custom ID combinations for use in the capture of shiny Pokémon, or general aesthetic purposes. [A]#faq[/A] "Frequently Asked" Questions As implied by the quotation marks in the header, not all of these questions are frequently asked. However, I do anticipate them coming up, so I'll try to provide some help here: Q: How are Eggs/shiny Eggs generated? A: Information on the generation of Eggs can be found in this post of the RNG Research thread. Similarly, Egg availability and generation is elaborated upon in a subsequent post in the thread. In both cases, the information has been provided by Kaphotics. Q: There were two runs of FireRed/LeafGreen cartridges. Does the RNG work the same on both? A: As far as we are aware, there are no differences between the runs of the games as far as the RNG is concerned. Q: Do these findings apply to other games, such as Ruby/Sapphire, or just FireRed/LeafGreen? A: As mentioned above, all Pokémon handheld games share some similarities as far as RNG mechanics go, but they also have their own nuances. This thread is made specifically dealing with FireRed/LeafGreen mechanics. Ruby and Sapphire share wild Pokémon generation Method H, so that research may be applied there. [A]#research_questions[/A] Research Questions As you have likely gathered, we do not have enough information to create a streamlined RNG manipulation experience in FireRed/LeafGreen at this time. This is why your help is needed. Here is a list of all the things that need researching at the moment (that I can think of): What areas have a "quiet" RNG, and what areas are "noisy"? It is unclear at the moment just where (and when) the RNG goes into the "noisy" pseudo-120 FPS mode. We need users to test in different areas to see where the RNG is "noisy" and where it is not. Bear in mind that the RNG can be silenced, as described by flovv earlier in the post. What actions cause the RNG to switch from even to odd? It is known that opening the menu and saving both cause the RNG to switch to the opposite type of frame. However, the full range of actions which cause this switch are not known as of yet. [A]#helpful_links[/A] Helpful Links [A]#general_resources[/A] General Resources How to turn off unnecessary RNG calls for research, thanks to Bond 697. The Process of PID and IV Creation of Non-Bred Pokémon, thanks to X-Act. RNG Manipulation in Pokémon Emerald Introduction (contains a quick explanation of Emerald's RNG; many concepts carry over to FireRed and LeafGreen). SRing on VBA Part 1 and SRing on VBA Part 2, thanks to Syberia. Emulator LUA Scripts, thanks to Kaphotics. Capturing FR/LG Legendaries (general tips not specific to RNG manipulation). [ポケモン-その他] - アーマーの雑記 (Japanese FireRed and LeafGreen RNG information—exact content is unknown, but it does not appear to cover much ground that this thread does not) [A]#applications[/A] Applications RNG Reporter, thanks to mingot and OmegaDonut. PokéRNG, thanks to Wichu.* IVs to PID Applet, thanks to X-Act. *PokéRNG does not provide accurate seeds for FR/LG at this time. [A]#credits[/A] Credits I would be remiss to not give credit to the various users that have made this information available. Of course, where the RNG is concerned, loadingNOW and X-Act did the pioneering research that has made all RNG manipulation possible. =Jonny=, Syberia, Equinox, and Negator contributed to early tests and research concerning the FireRed/LeafGreen random number generator, and the program used to find FireRed and LeafGreen seeds was crafted by NeoSyrex. Additionally, user NixHex has made several significant contributions, including a series of updates. Similarly, Kaphotics and Bond 697's work in the RNG Research thread has proven useful in illuminating some of the outstanding technical aspects of the RNG, and they have posted many new developments in this thread. Many other users such as chrish, mattj, flovv, andZari made consistent or large contributions. Many other users have contributed to this cause.