Ok, starting a pure research thread for PRNG abuse. As items in the help thread get moved over to the site and articlized technical information will be moved here about other games.
Rules
Only one, and you will be infracted if you break it.
- This is currently a pure research thread, not a help thread. Use the sticky for that. DON'T ask questions here that can be answered by any knowledgeable abuser.
Information
Black & White
Assorted 5th Generation RNG Information
=====
Please refer to the other Breeding resources that are in the list at the top of this post.
HGSS
Seeding
Seeing is either exactly the same or extremely close, with the exception of the delay which can be much lower. Some more samples here would be welcome, but it seems like "normal" is probably somewhere around 490. RNG Reporter 7.01 has been released and has a checkbox to lower the minimum search delay on the seed finder to 400.
RNG Advancing
Walking in areas where there are no wild Pokemon is the same as in DPP. +1 for each Pokemon in the party per 128 steps.
PID Generation for Wild Pokémon
For the most part, PID generation is handled in the same manner described by X-Act in his article, but the process of getting the initial PID has changed in the 4th generation. In the 3rd generation, without a synchronizer present, the next two or three numbers from the RNG were taken and used directly to form a PID. In the 4th generation games this procedure has changed and there is an initial call to the RNG to get the nature and then the RNG is advanced until an appropriate PID (that is, one that has a matching nature) is found.
Starting from s[n], which can be thought as your current seed, when entering a battle with a Pokémon (wild or Synchronizable legend), the first seed used to generate the Pokémon is s[n+1].
This number is used to determine the nature of the Pokémon as follows:
s[n+1] mod 25
This operation will produce a number between 0 and 24, which is the target nature.
Next is the PID generation.
PID is [s[m]][s[m+1]]
where m starts as m = n+2 and is incremented by 2 until a PID is found with the target nature.
In the end the IVs, as usual, are formed with [s[m+2]][s[m+3]]
<insert complete example with pid generation>
Effect of Synchronize:
The low bit of s[n+1] acts as a trigger.
If it's 1, Synchronize has failed. In this case the method above is used, but s[n+1] is NOT recycled to determine nature. Instead another call is made to the RNG and that number is considered to be s[n+1].
If it's 0, the the target nature will be that of the first Pokémon in your party.
Next step is the PID generation.
PID is [s[m]][s[m+1]]
where m starts as m = n+2 and is incremented by 2 until a PID is found with the target nature.
In the end the IVs, as usual, are formed with [s[m+2]][s[m+3]]
<insert complete example with pid generation>
FRLG
Information can be found in this thread.
Rules
Only one, and you will be infracted if you break it.
- This is currently a pure research thread, not a help thread. Use the sticky for that. DON'T ask questions here that can be answered by any knowledgeable abuser.
Information
Black & White
Assorted 5th Generation RNG Information
- 64 Bit Seed Formula and Reverse Formula
- Mersenne Twister Determination of IVs
- MTRNG Table Updating
- Advancing the MTRNG: Walking, Withdrawing, and Battling
- C-Gear Seeds
- Entralink Offsetting
- Turning it on at the continue has an offset that's not constant, we turn it on in game.
- Passive advancement with C-Gear on (We keep it off, or turn it off asap)
- Initial (Non C-Gear)
- Seeding via SHA-1 Encryption
- Time and Date
- Keypress States
- Advancement: Stepping/Turning on Wild Tiles (Not Constant), Chatot, and Saving
- 5th Gen Ability Calculation
- Encounter Slots: Land
- Encounter Slots: Water
- 0x80000000 XOR Decision
- Rain Frame Advancement
- Breeding
- Other Areas of Abuse
Code:
Definitions:
FullSeed = Entire 64 Bit Seed
u32 = Upper 32 bits of the 64 Bit Seed
L32 = Lower 32 bits of the 64 Bit Seed
Lowest Bit = Lowest Bit of the (64 Bit) Seed
FullSeed>>63 == 1 Pass Sync
FullSeed %4 == 0
give Pokemon
else give Item
FullSeed %5 == 0
give 'Not even a nibble...'
else give Pokemon
U32 ^ XOR = PID
U32*6>>32 IV Passed
U32>>31 Parent Passing IV
U32*100>>32 Encounter Slot Value
Translate to Slot for Land/Water
U32*25>>32 Nature Calculation ([URL="http://www.smogon.com/forums/showpost.php?p=3229521&postcount=608"]Use Table[/URL])
Code:
PID[1] = Undecided Generated PID
PID[2] = Decided Generated PID
HB = Highest Bit of PID
LB = Lowest Bit of PID
LTSh = Highest Bits XOR'd: L16(PID), TID, SID
===
Decision for 80000000 XOR
PID[1] = U32^0x10000
if (HB+LB)%2 == (LTSh)%2
PID[2] == PID[1]^0x80000000
else PID[2] == PID[1]
Wild / Surf
Water Spots (Fish / Surf)
Fishing (No Spot)
Fishing (No Spot, Suction Cups in lead)
Shaking Spots (Grass)
Shaking Spots (Cave / Bridge)
Cute Charm
Code:
0 Initial
1 Sync
2 ESV - Land / Surf
3 Held Item
4 PID
5 Nature
Code:
0 Initial
1 Sync
2 ESV - Water
3 Held Item
4 PID
5 Nature
For surfing, you have to surf into it, with frame advancement.
Surfing onto it uses the ESV for surfing spot,
fishing it uses the fishing spot.
Code:
0 Initial
1 Sync
2 (No) Fish
3 ESV - Water
4 Level Calc
5 Held Item
6 PID
7 Nature
Code:
0 Initial
1 (No) Fish - does not matter as Suction Cups guarantees a catch
2 ESV - Water
3 Level Calc
4 Held Item
5 PID
6 Nature
Code:
0 Initial
1 Sync
2 -----
3 ESV - Land
4 Held Item
5 PID
6 Nature
Code:
0 Initial
1 Sync
2 Item or Pokemon Calc
3 ESV - Land
4 PID
5 Nature
Code:
0 Initial
1 Cute Charm
2 ESV - Land / Surf
3 Held Item
4 PID
5 PID modification \ Nature (failed CC)
6 Nature (successful CC)
Zekrom/Reshiram
Gifts / Fossils / Starters
High Link, some of the time. Zoroark has a weird way of PID generation, which we aren't completely certain how it works. It's really unnecessary to completely document, just like Zoroark because these buggers cannot be shiny.
Zoroark / Zorua cannot shine.
Wonder Cards
There is something that can change the PID to make it give the opposite nature. Not sure, but it's noted here. Best bet is in between
Code:
0 Initial
1 Sync
2 PID
3 Nature
Code:
0 Initial
1 PID
2 Nature
Zoroark / Zorua cannot shine.
Wonder Cards
Code:
0 Initial
22 HP IV
23 Atk IV
24 Def IV
25 SpA IV
26 SpD IV
27 Spe IV
30 PID
32 Nature
Code:
Frame 0 n-1 Initial Seed [Start]
Frame 1 n nothing
Frame 2 n+1 nothing
Frame 3 n+2 Nature (r[n+1]*0x19) >>32, nature value
--- if Everstone, becomes Frame 4 [n+3] and all calls are shifted +1
Frame 4 n+3 DW (r[n+2] * 5) >>32 > 1, inherit DW
--- if Ditto parent, becomes Frame 5 [n+4] and all calls are shifted +1. Not sure what is done here.
Frame 5 n+4 m IV1-Place r[m]*6>>64, return 0-5 for what IV (HABCDS)
Frame 6 n+5 m+1 IV1-Parent r[m+1]>>63, return 0/1 for what parent (A=1, B=0)
Frame 7 n+6+2r m+2 IV2-Place r[m+2]*6>>64, return 0-5 for what IV (HABCDS) ...r=rejected frames for 2nd iteration, each rejection is +1 to r value
Frame 8 n+7+2r m+3 IV2-Parent r[m+3]>>64, return 0/1 for what parent (A=1, B=0)
Frame 9 n+8+2r+2s m+4 IV3-Place r[m+4]*6>>63, return 0-5 for what IV (HABCDS) ...s=rejected frames for 3rd iteration, each rejection is +1 to s value
[U]Frame 10 n+9+2r+2s m+5 IV3-Parent[/U] r[m+5]>>64, return 0/1 for what parent (A=1, B=0)
Frame 11 n+10+2r+2s PID Generated r[n+10+2r+2s] - 1 = PID
Frame 12 n+11+2r+2s Pokemon placed in party. [End]
For >>32, assume using upper32
For >>6*, assume using full seed
"Rejected": 0-5 value calculated matches one from a previous iteration.
Discard and repeat calc until it does not match a previous 0-5, thus advancing 2 frames.
Roaming Pokemon
SID / ID
Code:
0 Initial
1 PID
2 Nature
Code:
Seed from Are you ready to enter the world of Pokemon
XXXXYYYY
XXXX = SID
YYYY = ID
HGSS
Seeding
Seeing is either exactly the same or extremely close, with the exception of the delay which can be much lower. Some more samples here would be welcome, but it seems like "normal" is probably somewhere around 490. RNG Reporter 7.01 has been released and has a checkbox to lower the minimum search delay on the seed finder to 400.
RNG Advancing
Walking in areas where there are no wild Pokemon is the same as in DPP. +1 for each Pokemon in the party per 128 steps.
PID Generation for Wild Pokémon
For the most part, PID generation is handled in the same manner described by X-Act in his article, but the process of getting the initial PID has changed in the 4th generation. In the 3rd generation, without a synchronizer present, the next two or three numbers from the RNG were taken and used directly to form a PID. In the 4th generation games this procedure has changed and there is an initial call to the RNG to get the nature and then the RNG is advanced until an appropriate PID (that is, one that has a matching nature) is found.
Starting from s[n], which can be thought as your current seed, when entering a battle with a Pokémon (wild or Synchronizable legend), the first seed used to generate the Pokémon is s[n+1].
This number is used to determine the nature of the Pokémon as follows:
s[n+1] mod 25
This operation will produce a number between 0 and 24, which is the target nature.
Next is the PID generation.
PID is [s[m]][s[m+1]]
where m starts as m = n+2 and is incremented by 2 until a PID is found with the target nature.
In the end the IVs, as usual, are formed with [s[m+2]][s[m+3]]
<insert complete example with pid generation>
Effect of Synchronize:
The low bit of s[n+1] acts as a trigger.
If it's 1, Synchronize has failed. In this case the method above is used, but s[n+1] is NOT recycled to determine nature. Instead another call is made to the RNG and that number is considered to be s[n+1].
If it's 0, the the target nature will be that of the first Pokémon in your party.
Next step is the PID generation.
PID is [s[m]][s[m+1]]
where m starts as m = n+2 and is incremented by 2 until a PID is found with the target nature.
In the end the IVs, as usual, are formed with [s[m+2]][s[m+3]]
<insert complete example with pid generation>
We can use phone calls to Professor Elm to verify or determine our initial seed. When called he will give one of the following responses:
"I expect there are some Pokémon in the Kanto region that I don't know. There are probably methods of evolution that I'm not familiar with yet. I should use that perspective and discover what I can."
"There are so many different ways that Pokémon evolve, aren't there?! Some Pokémon don't even evolve until they meet certain conditions first!"
"It seems that Pokémon that have been infected with Pokérus level up better. We're not quite sure why..."
We will refer to these messages as K, E, and P.
Each time the Elm is called the RNG is advanced by one.
The result is processed as follows:
result = seed % 3
0 = Evolution
1 = Kanto
2 = PKRS
"I expect there are some Pokémon in the Kanto region that I don't know. There are probably methods of evolution that I'm not familiar with yet. I should use that perspective and discover what I can."
"There are so many different ways that Pokémon evolve, aren't there?! Some Pokémon don't even evolve until they meet certain conditions first!"
"It seems that Pokémon that have been infected with Pokérus level up better. We're not quite sure why..."
We will refer to these messages as K, E, and P.
Each time the Elm is called the RNG is advanced by one.
The result is processed as follows:
result = seed % 3
0 = Evolution
1 = Kanto
2 = PKRS
FRLG
Information can be found in this thread.