Getting Started with Automated RNG Manipulation¶
This is a brief introduction to the Pokémon Automation programs for automated RNG manipulation in FireRed and LeafGreen (FRLG). While the programs do most of the work for you, it's necessary to understand a little bit about how RNG manipulation works in order to set them up.
If you haven't used Pokémon Automation before, see the Getting Started Guide.
Table of Contents¶
- Programs and Other Resource
- Background and Terminology
- Finding your Secret ID
- Starter RNG Manipulation
Programs and Other Resources¶
Some of these will be referenced throughout this guide:
Pokémon Automation Programs¶
| Name | Description |
|---|---|
| SID Helper | A short program that helps with consistently setting your Secret ID (SID) when starting a new game. It only takes a few seconds to run. |
| Starter RNG | Automatic RNG manipulation of starter Pokémon. This program doubles as a tool for confirming your SID. |
| Gift RNG | Automatic RNG manipulation of gifts and other Pokémon that do not require being caught. |
| Starter RNG | Automatic RNG manipulation of stationary encounters, such as Snorlax or Mewtwo. |
| Wild RNG | Automatic RNG manipulation of random wild Pokémon. |
| Roaming Legendary RNG | Automatic RNG manipulation of Entei, Raikou, or Suicune. |
| Egg RNG | Automatic RNG manipulation of eggs at the Four Island day care. |
| RNG Helper | Semi-automated RNG manipulation of all types. Requires manual calibration. |
Other Resources¶
| Name | Description |
|---|---|
| Ten Lines | An incredibly useful web tool geared toward performing manual RNG manipulation. We recommended it for picking out your RNG targets. |
| PokéFinder | A fantastic downloadable RNG manipulation search program. Its PokeFinderCore powers Ten Lines web tool. |
| RNG Manip Guide for Starters | A video guide by im a blisy that covers the basics of RNG manipulation in FRLG. |
| Retail Pokémon RNG | A website with guides geared toward performing RNG manipulation on retail game cartridges. While most of the guides were written for Game Boy Advance rather than Switch, the general approach and most of the details remain the same. |
| Smogon RNG Mechanics Guide | A detailed explanation of how values from the RNG are used to generate Pokémon |
| PID Reroll Calculator | A web tool for calculating the number of rerolls that occur when a random wild encounter is generated. Useful for determining the most like "method" for generating IVs. |
| Generation 3 Wild RNG Research | Useful information for determining a likely IV generation method when used with the PID Reroll Calculator. |
Background and Terminology¶
To start with, let's define some terms and give enough context for them to make sense.
The FRLG Random Number Generator¶
FireRed and LeafGreen use a Linear Congruential Generator (LCG) for generating psuedo-random numbers, which are then used to determine all random values—including a Pokémon's gender, nature, ability, and IVs—that occur in the game. In particular, it uses the following formula for advancing its internal RNG:
Next Number = ( 0x41C64E6D * Previous Number + 0x6073 ) % 0x100000000
What this means is that if we know how the RNG is initialized as well as how many RNG advances have passed before a Pokémon is generated, we can determine what its gender, nature, ability, and IVs will be. If you're interested in details about how values from the random number generator are used when a Pokémon is spawned, check out the Smogon RNG Mechanics Guide.
Common Terms¶
Seed: the initialization of the RNG. The seed is set when a button is pressed on the title screen to progress the game to the continue screen. The value of the seed depends on the game version, the time passed since launching the game, the sound setting (Mono vs. Stereo), which button was pressed (A or Start), and whether any extra button presses occurred after launching the game.
Seed Delay: the amount of time between launching the game and pressing a button on the title screen. Since the entire intro animation needs to play, the Seed Delay is always greater than 30 seconds.
RNG Advances: the number of times the RNG generates a new pseudo-random number after being initialized. These are often just referred to as "advances", and they occur at different rates in a few different situations:
- On the continue screen, they pass at rate of 1 RNG advance every frame (60 fps = 60 advances/s)
- These are often called Continue Screen Advances
- After continuing the game, they pass at a rate of 2 RNG advances every frame (60 fps = 120 advances/s)
- These are often called In-Game Advances
- If using the Teachy TV, they pass at a rate of 313 RNG advances every frame (60 fps = 18,780 advances/s)
- Movable boulders, breakable rocks, and NPCs can also cause extra RNG advances while not in a game menu.
Trainer ID: the ID number on a player's trainer card, as well as the OT ID number for their Pokémon. Often abbreviated as "TID".
Secret ID: a hidden value set when you start a new game. Together with the Trainer ID, it determines which Pokémon generated by the game are shiny. Often abbreviated as "SID".
Finding your Secret ID¶
A player's Secret ID is not normally visible without using Arbitrary Code Execution, but knowing it is necessary for finding shinies via RNG manipulation. However, if precise button presses are used when starting a new game, an SID can be deduced from a TID.
In this guide, we'll use a new game, the SID Helper program, and the Starter RNG program to determine the Secret ID of the new save file.
If you'd rather not start a new game, SIDs can be deduced from the stats of any shiny Pokémon that hasn't yet earned any EVs by using the "IVs to PID" tool in PokeFinder. Use one of the FRLG Shiny Hunting programs if you don't yet have a shiny.
Using the SID Helper program¶
Follow the instructions on the SID Helper wiki page. There is usually no reason to change the default value for the Target Advances, and 5 candidate SIDs is generally a good amount.

Once the program finishes, copy the results and save them somewhere (in a text file, on a piece of paper, etc.). While your SID is most likely the one associated with your target advances, it is possible that an adjacent SID was hit instead.
In this example, after running the SID Helper, the Trainer ID was set to 35951, and the most-likely SID (at 3001 advances) was calculated to be 24593.


Finding a target in Ten Lines¶
Now that we have a guess for the SID, we can try to use RNG manipulation to obtain a shiny starter. If we hit an RNG target that is expected to be shiny but isn't, we can rule out the SID we've tried and move onto one of the adjacent ones.
Before we begin the Starter RNG program, we need to pick out a shiny target with Ten Lines. Navigate to the Calibration tab and enter the following information about your game:
- Game: either Switch FireRed or Switch LeafGreen. Each game will have different seeds
- Sound: either Mono or Stereo, whichever matches your in-game settings (Mono by default)
- Button Mode: Help. Make sure this is your in-game setting as well.
The following options can affect your Ten Lines search and have multiple valid values. They will be automatically detected by the RNG programs.
- Seed Button: A or Start. Each option provides different possible RNG seeds.
- Extra Button: None, Blackout L, or Blackout R. Blackout L/R modifies all seeds by a constant offset.
- Console: This setting can be ignored, since it only affects seed delays (NS2 is 750ms faster than NS1).

For checking the SID, we can prioritize a target with a low number of advances so that resets take less time. The following search settings are recommended for SID checking:
- Target Seed: whatever value is the default in Ten Lines (around 31300ms)
- Seed +/-: arbitrary. Make this larger if your search does not return any matching targets
- Minimum Advances: 1000
- Maximum Advances: 5000
- Offset: 0 (this can always be ignored)
- Required Overworld Frames: 600 (this can always be ignored)
- Trainer ID: your Trainer ID
- Secret ID: the candidate SID from the SID Helper

Finally, you can provide details about the Pokémon you'd like to find. For this step, we're not planning on keeping the starter we use to confirm our SID, so we won't specify any specific Nature, IVs, or gender:
- Method: Static 1 (all Gift and Stationary Pokémon always use the Static 1 method)
- Category: Starters
- Pokémon: whichever starter you'd like to obtain
- Shininess: Star/Square
- Nature: Any
- Gender: Any

Once all of these inputs have been set, press the SUBMIT button near the bottom of the page to view the results of the search. We only need information from the first two columns, and any of the search results will work for testing an SID.
Here is the target chosen for confirming the SID for our example:

Avoid targets with low seed delays when possible Depending on your hardware, the FRLG RNG programs have a chance to fail when using seed delays close to 30,500ms on NS1 or 27,750ms on NS2. This happens when the button press on the title screen comes too early, throwing off all subsequent parts of the button press sequence.
If using a short seed delay, pay attention as the program opens the game and advances through the title screen. If you notice a problem or the program is unable to navigate to the encounter, either choose a new target with a higher seed delay or manually increase your seed calibration.
Checking your SID with the Starter RNG program¶
Now that we have our target, we can enter its information into the Starter RNG, which will automatically perform calibrations to hit the specific seed/advance needed to generate the target Pokémon. Before moving on, follow the setup instructions for the program on its wiki page.
Ignore the Observed Stats and RNG Calibration sections for now and enter the information obtained from Ten Lines. Here are the settings for our example:

Once these have been entered, start the program. You can monitor its progress via the Observed Stats and RNG Calibration displays if you'd like. These update based on the Pokémon observed by the program on each reset. Here is what it looked like for our example after a few resets:

Note that the program hit 489B/1205 on its first reset, which is 8 advances too late and 1 seed away from the target.
On the next reset, the program adjusted its calibration based on the previous attempt and hit the target—a shiny—confirming that the SID for this save file is 24593. Record your confirmed SID somewhere safe, since you'll need it for any future RNG manipulation attempts with this save file.

If the program instead ended on a non-shiny hit, another SID candidate from the list should be chosen (in our example, the SID from 2999 advances, 5699, would be the best choice). Then, enter this new SID into Ten Lines, repeat the search, choose a new target, and restart the Starter RNG program with the new target.
If the program has not finished after a large number of resets (30), check to make sure that it is making progress in its calibrations. If it frequently displays "No matches found" or fails to get closer to the target, double check the both your in-game settings and the settings you've entered for the program.
Starter RNG Manipulation¶
Now that we know our SID for certain, we can safely dedicate time to hitting the shiny starter we'd like to keep. In the Ten Lines Calibration tab, add filters to specify what IVs, nature, and gender you'd like:
Note: The Searcher Tab on Ten Lines can also be used to search for a target with particular characteristics

Since the more specific your filters are, the fewer hits the search will return, it may be helpful to expand the search range in Ten Lines by quite a bit. Note that each RNG advance takes roughly 8.33 milliseconds, so 50,000 advances corresponds to roughly 7 minutes of in-game time spent waiting.
Note: for any Pokémon other than the starters, the Teachy TV can be used to reach very large numbers of RNG advances quickly.

Once you've made these changes, resubmit the search and choose a target from the results. If you don't get any good results, you can change some of the options that affect possible seeds (Sound, Seed Button, and Extra Button) and try again. With the above filters, only three results are available for this particular TID/SID combination:

For this example, we'll go with the 2C5A | 49209 target, which has really nice IVs. Enter the settings from your new target into the Starter RNG program...

... and start it. The program will reuse the calibration information from the previous run, so it will likely be very close to the target on its first attempt. Within a few resets, you should have your shiny starter.

In this case, the program hit the shiny on its first attempt!
If you've followed along and obtained your shiny starter, congratulations! By this point, the hard part is over, and you should be familiar enough with Ten Lines and the RNG programs to use them to obtain nearly any Pokémon in FireRed or LeafGreen. Happy hunting!
Credits¶
- Documentation: Astro (Tom), Butters
- RNG Programs: Astro (Tom)