Emerald shiny egg RNG abuse guide
Pokémon that have been RNG abused in Ruby/Sapphire/Emerald are not nearly as common as those RNG abused in 4th and 5th gen due to the difficulty. Shiny RNG abused pokémon from Ruby/Sapphire/Emerald have historically been the product of emulators or the trading of eggs, which would require the use of external devices. The aim of my guide is to bring shiny egg RNG abuse to the retail cart players of Emerald. I am assuming that you know how to do egg IV RNG abuse. If not take a look
here. As of right now using an Everstone is not supported. Do not use one at any point in the process.
What you will need:
eepid.exe - A tool for figuring out how the PID halves are put together on your game. Requires
MS Visual C++ 2010 Redistributable Package to be installed on your computer.
Spinda Painter - For being able to figure out the PID of your pokémon without any external assistance.
This spreadsheet - The tool that will be able to search for a shiny PID of the desired characteristics (meant for Excel 2007 or later, macros required). Until I figure out how to generate PIDs after a timer value of 65535 I've limited the PIDs to that frame. It should be enough anyways...
Some information that will be useful before beginning the RNG process:
An oddity with the Emerald PRNG - Sometimes for reasons unknown the game calls an extra function known as a vblank. Part of this function involves it advancing the PRNG by one value (frame). This is the reason behind split spreads and alternate inheritance. It would also increase the total calibration value by 1 when it kicks in. It isn't always called but be aware of it.
Egg generation chances - There are two separate things that affect the egg generation chance. They are matching
Pokédex number and non-matching Trainer ID numbers. If both are true the egg has a 70% chance to generate. If one of the two are true the egg has a 50% chance to generate. If neither are true there is only a 20% chance for it to generate. This means that your Gengar and Gastly of the same Trainer ID have a 20% chance to generate an egg, but two Gengar of the same Trainer ID have a 50% chance. These percentages are reflected in the spreadsheet.
How often the game checks to generate an egg - When the player character takes the 255th step after depositing both parents in the daycare, and every 255 steps thereafter. For the purposes of this guide it is not important to know how the egg is generated after one takes a different egg from the old man. The game takes 16 frames after you press the D-Pad to move in the direction the player character is facing to generate an egg on the 255th step.
How the egg PID is generated (non-Everstone) - This one is a little more technical so you can skip the next 5 sentences. Upon the 255th step the PID is generated in two separate but closely related parts. For the purpose of this explanation let us assume a PID of XXXXYYYY. XXXX is the upper half, while YYYY is the lower half. The lower half is very simple, it takes the upper half of the current PRNG value and adds 1 to it. The upper half takes the current value in the timer, uses that as the seed for the same RNG formula used for other stuff, and advances 1 frame. What is important here is that the timer and the PRNG frame aren't completely related. The timer advancement is always constant at just under 60 times per second. The PRNG advances by 1 for every timer advancement plus all other advancements (NPCs, encounters, battle, drawing the environment, etc). The drawing the environment will become useful as you'll see later on.
Using the spreadsheet:
Most of the columns are self-explanatory but some are not.
Column E - Make sure to put an X to the left of the gender ratio of the egg for this column to work.
Column F - The characteristic of the pokémon. While the characteristic isn't used in 3rd gen if one has to Pal Park a pokémon to help determine the PID here is the characteristic value. (hidden in this picture as I do not find it too useful myself)
Columns G, H, and I - The egg generation chances. This tells you what you need your parents to have for the egg to generate for the specific PID. If only the 70% column says Yes you need both of the requirements listed above.
Base Calibration and Redraws - explained later
Note that the drop-down arrows on the first line allow for filtering. This is particularly important for finding the shiny PIDs.
Calibration:
Anecdotal evidence suggests that the base calibration value is 19, or 20 with a released roamer. However it would still be a good idea to test it for yourself.
As noted earlier the PRNG and the timer are not totally synchronized. One must find out how far apart they are by generating an egg in an area that does not advance the PRNG, and figure out the PID of that egg. Here is what you must do to figure out your calibration:
1) Catch a Spinda. Preferably two of different genders for the 50% egg generation chance. If you can get them with different Trainer IDs that's even better.
2) Get in front of the Daycare lady, use a Max Repel, and deposit both Spinda. Make sure neither pokémon is holding an Everstone.
3) Walk 254 steps. The Max Repel wears off after 250 steps. It does not matter where you do the steps as long as the Max Repel wears off in the daycare building. Once it wears off do 4 more steps. Changing direction without taking a step does not count as a step.
4) Save and reset the game. This will give the lowest possible calibration value.
5) Load the save and walk 1 step. Then go check if the old man has an egg. If he does go hatch it. If not repeat until he has an egg.
6) Once the egg is hatched use the
Spinda Painter to deduce the PID. It might be tough by looking at a small sprite unfortunately. Each spot can be within a 16x16 grid. You should check the PID given by the Spinda Painter to see if it makes sense. Take the decimal PID mod 25 to get the nature value and look in
this table to see if the nature that the PID would yield matches the hatched Spinda. Also, take the decimal PID mod 256 to get the raw gender value. Since Spinda's gender ratio is 50M/50F a result of 0-126 would be femate while 127-255 would be male. Use windows calculator for the mod function (for me it must be in Programmer mode to work with hexadecimal and the mod function, Scientific mode lets me use the mod function but older versions have hexadecimal in Scientific mode).
7) Take the decimal PID and enter it into eepid.exe. For the delay range unless you waited a long time since the reset you should search between 0 and 4000. Once it finds the PID you entered it will give you your calibration value. Enter that into the spreadsheet in the spot for the Base Calibration.
The calibration value can be affected by what's going on in the game. One thing that may affect it is the presence of a roamer. This will be your base calibration value.
Finding a shiny PID:
Now that you have your base calibration value I'm sure you've attempted to search for shiny PIDs and found the ones available to be... lacking. Do not despair as there is a way to consistently change the calibration value. Whenever the environment is redrawn the PRNG value advances by 3 values ahead of the timer. This increases the calibration number by 3. How does one do this? Simple. Open your party menu or trainer card, then exit it. Now you can search using calibration values by adding 1 to the redraws value for each time you open/exit the party menu. To search for more spreads add 1 to the Redraw number and let it recalculate, and keep going until you find a desired PID. Once you do the number in the Redraw box is how many times you need to enter and exit the party menu.
Setting up your timer:
Using only in-game means this will be quite time-consuming. You will have to test the ability to hit your shiny PID using Spinda breeds, with at least the minimum breeding percentage of the breed you will be doing. Setup your timer using the frame that has your shiny egg PID and take the 255th step when the timer runs out. If the old man has an egg go hatch it and determine the PID. If the Spinda comes out shiny then congratulations, you hit your shiny spread. Go start your actual project. If not then adjust your timer according to the frame you actually hit. If the old man did not have an egg try again. If he consistently does not have an egg adjust the timer slightly and repeat.
When it comes to your actual project you will have to save before picking up the egg if you intend to abuse the egg IVs as well. This means for each failure you will have to take the parents out of the daycare, redeposit them, walk 254 steps, save, and repeat. Once you have your shiny egg you may proceed to do RNG abuse for your egg IVs.
Misc tips:
Sometimes when doing egg IV abuse you will hit split frames or alternate inheritance when you don't want to. Usually waiting around and making another save can fix this, especially for split spreads. However it might not so you may have to generate another shiny egg unfortunately.
Looking into the future:
As of the writing of this guide the current public version of RNG reporter is 9.95. The current alpha 9.96 supports this, including Everstone PIDs. Sort of. There are some inaccuracies still so I recommend you do not use an everstone. These changes mean I will have to change the guide accordingly.
Credits:
Kaphotics - for the spreadsheet and the
basis of the calibration guide.
Bond697 - for translating and fixing eepid.exe
Various people including the above - the rest of the RNG research