Most Generation PRNG Help / Information

Skymin_Flower

It's Seed Flare time.
I'm not sure I understand, doesn't battery-dry merald always start from frame 1?
It always starts at frame 1 with seed 0, yes. However, when you start your game again, the game determines your TID, and then sets that as the new seed (4 digit hexadecimal value). So basically, as long as you start your game again (and do NOT save and turn it off at any point), then you can hit very high frames in a short amount of time. So when you start a game, convert your TID into hexadecimal, put that seed into RNG Reporter and then see if there are any good spreads nearby.

EDIT : Also dry battery / live battery makes no difference for FR/LG/E. It only matters for Ruby and Sapphire.
 
It always starts at frame 1 with seed 0, yes. However, when you start your game again, the game determines your TID, and then sets that as the new seed (4 digit hexadecimal value). So basically, as long as you start your game again (and do NOT save and turn it off at any point), then you can hit very high frames in a short amount of time. So when you start a game, convert your TID into hexadecimal, put that seed into RNG Reporter and then see if there are any good spreads nearby.

EDIT : Also dry battery / live battery makes no difference for FR/LG/E. It only matters for Ruby and Sapphire.
So if I get this straight: this only works immediately after starting a game, soft-reset and you're back to frame 1?
 
You got it! But because of save states it usually isn't a big issue.
That's extremely interesting. I never bothered with Gen III a few years back since I could only do live cartridge at the time. This is quite fascinating.
How did .com generate that .csv file? I'm aiming for that Naive 30/31/31/31/31/31/31 frame up in the 2.8B area, so I'd like to know what useful TIDs there are.
 
I am completely lost on this one. I RNG'd for my TID/SID combo on my Pokémon Emerald. I had it run for about two weeks to hit my frame. I hit my frame and caught my Mew. I want to use that frame again for Deoxys, BUT the frame is way up there and if I use save states then my save won't have my Mew. So, help me understand?
 

Skymin_Flower

It's Seed Flare time.
That's extremely interesting. I never bothered with Gen III a few years back since I could only do live cartridge at the time. This is quite fascinating.
How did .com generate that .csv file? I'm aiming for that Naive 30/31/31/31/31/31/31 frame up in the 2.8B area, so I'd like to know what useful TIDs there are.
You would have to ask .com. I could do it manually myself (and I do) but it would take forever.

I am completely lost on this one. I RNG'd for my TID/SID combo on my Pokémon Emerald. I had it run for about two weeks to hit my frame. I hit my frame and caught my Mew. I want to use that frame again for Deoxys, BUT the frame is way up there and if I use save states then my save won't have my Mew. So, help me understand?
You would need to create a new save file entirely. I think in your case it is much better just to warp to Deoxys.
 

.com

Grumpy old man
is a Forum Moderator Alumnusis a Community Contributor Alumnus
I am completely lost on this one. I RNG'd for my TID/SID combo on my Pokémon Emerald. I had it run for about two weeks to hit my frame. I hit my frame and caught my Mew. I want to use that frame again for Deoxys, BUT the frame is way up there and if I use save states then my save won't have my Mew. So, help me understand?
• Make a save state with your Mew (or trade it to another game, or extract the pkm file of it, or make a backup of the .sav file with it on, etc.)
• Revert to the one before and capture your Deoxys.

You now have 2 saves, one with Deoxys and one with Mew. You can either trade one to another game, load up the other one, and then trade them both to the same one. Or one by one transfer them to later generations however you were planning to originally.
That's extremely interesting. I never bothered with Gen III a few years back since I could only do live cartridge at the time. This is quite fascinating.
How did .com generate that .csv file? I'm aiming for that Naive 30/31/31/31/31/31/31 frame up in the 2.8B area, so I'd like to know what useful TIDs there are.
Quick script calculating the next seed up to the frame specified, and if it's of the form 0x**** (2 bytes), write it to a file (with frame and TID listed as well).
 
Quick script calculating the next seed up to the frame specified, and if it's of the form 0x**** (2 bytes), write it to a file (with frame and TID listed as well).
My knowledge on scripting is limited as it is, can you explain how the seeds correspond to what frame? I know the seed is the ID in hexadecimal form, but how that correlates to frame is beyond me.
 
It always starts at frame 1 with seed 0, yes. However, when you start your game again, the game determines your TID, and then sets that as the new seed (4 digit hexadecimal value). So basically, as long as you start your game again (and do NOT save and turn it off at any point), then you can hit very high frames in a short amount of time. So when you start a game, convert your TID into hexadecimal, put that seed into RNG Reporter and then see if there are any good spreads nearby.

EDIT : Also dry battery / live battery makes no difference for FR/LG/E. It only matters for Ruby and Sapphire.
So, if I get this straight, the SID won't matter because the seed is already generated and you have to get to that frame?
 

Skymin_Flower

It's Seed Flare time.
My knowledge on scripting is limited as it is, can you explain how the seeds correspond to what frame? I know the seed is the ID in hexadecimal form, but how that correlates to frame is beyond me.
http://www.smogon.com/ingame/rng/pid_iv_creation

I assume you have read this. If you haven't, it would be good to read it before you read my post xD

The important part is this :
  • Make seed equal to the last 32 bits of (seed × [41C64E6D] + [6073])
So from the beginning, the seed in Emerald is 0. When the game advances 1 frame, it applies this formula, so the next PRNG state (on frame 1) is : [0] × [41C64E6D] + [6073] = [00006073]. This repeats every time the frame is advanced. This one is an example of a 4 digit hexadecimal seed. These only appear every once in a while. For example the next one is on frame 18625. The seed on the frame before this (frame 18624) is this : [E7368E33]. If you put that into the formula : [E7368E33] × [41C64E6D] + [6073] = [3B67F5220000762A], and the last 32 bits of this number (or 8 digits in hexadecimal) is this : [0000762A]. So basically any PRNG state that is of the form : [0000XXXX] is what you are looking for, because TID seeds can only be 4 digit hexadecimal numbers.

So, if I get this straight, the SID won't matter because the seed is already generated and you have to get to that frame?
SID is created at a different time to your TID (not like 4th gen or R/S where they are created together). I don't really understand what you are asking, but it is still possible to RNG your TID / SID combo using this method.
 
SID is created at a different time to your TID (not like 4th gen or R/S where they are created together). I don't really understand what you are asking, but it is still possible to RNG your TID / SID combo using this method.
I'm sorry. What I'm asking is you take your TID, convert to Hex and plug it in as the seed. If you do not save or turn off the game, the game will stay on that seed and advance the frames? If that's the case then you advance to the frame that popped up as good and you should have your pokemon, does that about sum it up?
 

Skymin_Flower

It's Seed Flare time.
I'm sorry. What I'm asking is you take your TID, convert to Hex and plug it in as the seed. If you do not save or turn off the game, the game will stay on that seed and advance the frames? If that's the case then you advance to the frame that popped up as good and you should have your pokemon, does that about sum it up?
Yea you got it :) but you have to play through the beginning sequence of the game, get your starter + Pokeballs, finish the game (or warp code, whatever), etc. etc. Plus the RNG runs at double speed in a battle. So the seed can't be TOO close to your target :P
 
Yea you got it :) but you have to play through the beginning sequence of the game, get your starter + Pokeballs, finish the game (or warp code, whatever), etc. etc. Plus the RNG runs at double speed in a battle. So the seed can't be TOO close to your target :P
I'm currently running an instance with lua scripting and I see the seed constantly changing, I guess my understanding of the mechanics are a bit rusty. Is there a step I'm missing? I saw something about resetting right after your TID is set?

Wait, wait, wait -- I think I got it. That seed will be the value at the specified frame, right?
 
http://www.smogon.com/ingame/rng/pid_iv_creation

I assume you have read this. If you haven't, it would be good to read it before you read my post xD

The important part is this :
  • Make seed equal to the last 32 bits of (seed × [41C64E6D] + [6073])
So from the beginning, the seed in Emerald is 0. When the game advances 1 frame, it applies this formula, so the next PRNG state (on frame 1) is : [0] × [41C64E6D] + [6073] = [00006073]. This repeats every time the frame is advanced. This one is an example of a 4 digit hexadecimal seed. These only appear every once in a while. For example the next one is on frame 18625. The seed on the frame before this (frame 18624) is this : [E7368E33]. If you put that into the formula : [E7368E33] × [41C64E6D] + [6073] = [3B67F5220000762A], and the last 32 bits of this number (or 8 digits in hexadecimal) is this : [0000762A]. So basically any PRNG state that is of the form : [0000XXXX] is what you are looking for, because TID seeds can only be 4 digit hexadecimal numbers.



SID is created at a different time to your TID (not like 4th gen or R/S where they are created together). I don't really understand what you are asking, but it is still possible to RNG your TID / SID combo using this method.
Interesting, but also quite complex.
I assume there's no way to generate such a file easily (with layman maths)? Just running calculations and flagging whatever ends in [0000xxxx]?
More precisely, there's no way, when I restart the game, to easily predict whichs TIDs I might start up with have high frames.

I wanna go for that 2.8B frame, there's no easy way to deduce what TIDs lie between 2B-2.4B?
 

Skymin_Flower

It's Seed Flare time.
I'm currently running an instance with lua scripting and I see the seed constantly changing, I guess my understanding of the mechanics are a bit rusty. Is there a step I'm missing? I saw something about resetting right after your TID is set?

Wait, wait, wait -- I think I got it. That seed will be the value at the specified frame, right?
In the lua script "seed" = "PRNG state" so yea, you got that right :P

And DO NOT reset after your TID is set, or you will go back to seed = 0.

Interesting, but also quite complex.
I assume there's no way to generate such a file easily (with layman maths)? Just running calculations and flagging whatever ends in [0000xxxx]?
That's where .com's script comes in :P I did a few by myself using PPRNG and findframe.py. Basically you look for any PID that begins in "0000" (because the game creates PID based on the PRNG state), note the frame (e.g. 18625) and then take one that is a couple of frames after that, put it into findframe.py and it will tell you the "First 16-Bit seed" which should be only a few frames earlier. Convert that 16-bit seed into decimal and you have your TID + the frame it will take you to if you get it :)

Of course that takes ages so it's better to have a script.
 
In the lua script "seed" = "PRNG state" so yea, you got that right :P

And DO NOT reset after your TID is set, or you will go back to seed = 0.
Last question! Do you just randomly sample TIDs with a spread in mind or is there a way or targeting spreads? Meaning, you make a save state and then there's your first TID, it doesn't pop out a good spread. You add 1 to your frame and try the next TID to see what spreads pop out, so on and so forth. Or is there a better way?
 

Skymin_Flower

It's Seed Flare time.
Last question! Do you just randomly sample TIDs with a spread in mind or is there a way or targeting spreads? Meaning, you make a save state and then there's your first TID, it doesn't pop out a good spread. You add 1 to your frame and try the next TID to see what spreads pop out, so on and so forth. Or is there a better way?
You cannot control the TID because the timer is too fast, so no, the way you described is pretty much the way to go :P
 

.com

Grumpy old man
is a Forum Moderator Alumnusis a Community Contributor Alumnus
Interesting, but also quite complex.
I assume there's no way to generate such a file easily (with layman maths)? Just running calculations and flagging whatever ends in [0000xxxx]?
More precisely, there's no way, when I restart the game, to easily predict whichs TIDs I might start up with have high frames.

I wanna go for that 2.8B frame, there's no easy way to deduce what TIDs lie between 2B-2.4B?
The file's too big to upload to Smogon (or keep as one file), but the zip here should give you all of them. Hopefully it's still usable.

All the frames on this one will be +1 from what they were on the other one. I started counting from the first advancement before, i.e. the seed 0x0 would be frame -1.

Every TID should appear once across the several spreadsheets.
 
Last edited:
Yea you got it :) but you have to play through the beginning sequence of the game, get your starter + Pokeballs, finish the game (or warp code, whatever), etc. etc. Plus the RNG runs at double speed in a battle. So the seed can't be TOO close to your target :P
From the start to beating Juan, how many frames do you reckon that'll take?
Something like 100M?
 
You cannot control the TID because the timer is too fast, so no, the way you described is pretty much the way to go :P
I've been looking into this a bit more and most of the spreads are not shiny. But, if you used in conjunction with this guide: https://www.reddit.com/r/pokemonrng/comments/44xek8/guide_emerald_tid_seed_rng_abuse/

I was thinking I'd be in business. I get a little lost in section 3, though, because I think he means put TID into hex. And then in section 4, I think he means SID. Near as I can tell, SID is created when entering the game world. The whole thing is kind of frustrating.
 
In Emerald, what decides if a wild encounter is H-2 or H-4?
I'm aiming for a Gen III flawless Ditto, which is on H-2. How do I know it won't pop to H-4 when I hit the frame?
 
Last edited:

Skymin_Flower

It's Seed Flare time.
From the start to beating Juan, how many frames do you reckon that'll take?
Something like 100M?
FireRed took me something like 4 million frames (according to the lua script) to complete the game, but it would have advanced more than that due to running at double speed in battles. Anyway 100 million is probably a bit high :P

I've been looking into this a bit more and most of the spreads are not shiny. But, if you used in conjunction with this guide: https://www.reddit.com/r/pokemonrng/comments/44xek8/guide_emerald_tid_seed_rng_abuse/

I was thinking I'd be in business. I get a little lost in section 3, though, because I think he means put TID into hex. And then in section 4, I think he means SID. Near as I can tell, SID is created when entering the game world. The whole thing is kind of frustrating.
Yea so basically there are a few steps. Firstly you pick a PID you want to make shiny. Load up the game, get your TID (make a save state BEFORE SID is generated), and then see if there is a nearby SID that will make that PID shiny in combination with your SID. If there is, RNG for your SID as normal, and then continue playing the game (your seed will still be your TID in hex).

In Emerald, what decides if a wild encounter is H-2 or H-4?
I'm aiming for a Gen III flawless Ditto, which is on H-2. How do I know it won't pop to H-4 when I hit the frame?
Unfortunately, you don't. Usually if that Ditto generates by H-2, nothing you do can really change it. You will have to RNG a new game for a new spread. It's awful I know :\

And in my limited experience H-2 is just slightly more common (and the spreads are better lol). So it is better to assume H-2.
 
Unfortunately, you don't. Usually if that Ditto generates by H-2, nothing you do can really change it. You will have to RNG a new game for a new spread. It's awful I know :\

And in my limited experience H-2 is just slightly more common (and the spreads are better lol). So it is better to assume H-2.
So, I'm at 62M frames now, trying for 176M, but I won't know if I'll be able to get that Ditto unless I actually hit it.
Whew, that's something to look forward to.
 

Skymin_Flower

It's Seed Flare time.
So, I'm at 62M frames now, trying for 176M, but I won't know if I'll be able to get that Ditto unless I actually hit it.
Whew, that's something to look forward to.
Yea, exactly xD

I know Ditto is Emerald exclusive, but if you want to RNG wild Pokemon in 3rd gen, Ruby and Sapphire is by far the easiest.
 
In Emerald, what decides if a wild encounter is H-2 or H-4?
I'm aiming for a Gen III flawless Ditto, which is on H-2. How do I know it won't pop to H-4 when I hit the frame?
FireRed took me something like 4 million frames (according to the lua script) to complete the game, but it would have advanced more than that due to running at double speed in battles. Anyway 100 million is probably a bit high :P



Yea so basically there are a few steps. Firstly you pick a PID you want to make shiny. Load up the game, get your TID (make a save state BEFORE SID is generated), and then see if there is a nearby SID that will make that PID shiny in combination with your SID. If there is, RNG for your SID as normal, and then continue playing the game (your seed will still be your TID in hex).



Unfortunately, you don't. Usually if that Ditto generates by H-2, nothing you do can really change it. You will have to RNG a new game for a new spread. It's awful I know :\

And in my limited experience H-2 is just slightly more common (and the spreads are better lol). So it is better to assume H-2.
It's been a while since I've done it, but I've had some luck using the in-battle frame skipping to switch wild methods in Emerald. Depending on the spread you could also try different frames/lead abilities.

Basically enter a battle so every other frame is skipped > savestate so you can reload and press A to immediately flee > wait different #s of frames in battle before fleeing.


One last thing I would like to say: Make savestates often, there's nothing worse than waiting for the RNG to advance, only to notice it advanced too far and your last savestate was 10,000,000 frames ago.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 10)

Top