Most Generation PRNG Help / Information

Buckert

Obsessive Collecting Disorder
Counting the NPC movements is not the best idea. They tend to be inconsistent and can advance your frame even without moving. I found the best way to do it was to find a spread with a low frame to shoot for, then enter the game and immediately do your journal advances and sweet scent quickly so the NPC cannot make a lot of movements like while doing coin flips. Check your seed based on the pokemon you catch, and if you hit it then you can see how many frames off you were, as sort of a calibration. The next time you can adjust your advances to account for the NPC movements.
Why have I never thought of this? Thanks a lot mate, will try this for sure tomorrow!
 

Fishaman P

Mechanics Maniac!
I have a question about FR/LG, although it's a bit of an odd one. I had recently discovered that my 8-year old Mewtwo from my FR cartridge had near amazing IV's (29/29/31/12/23/27) and I wanted to see what seed/frame I had hit.

So, using the RNG Reporters IV to PID function, I had found that my seed was 5E8C1E93. I then put that seed into Neosyrex's FR/LG seed finder. It brings up a Seed of D833 and the frame of 481.

Now, from what I remember reading in the FR/LG RNG research thread, it advances by 60FPS like R/S/E(unless I'm wrong). That mean's I had started the game, mashed through the starting menu and "Previously on your Journey", and THEN talked to Mewtwo, all in the course of literally 8 seconds.

Now for my question, isn't this basically impossible? It takes at least 7 seconds for me to get past the starting menu in EMERALD, so it'd have to be longer in FR/LG, no? Unless the frames only start at a certain time(Perhaps after the journal entries?) rather than at the start of the game.

It's a difficult question and it's more of me asking out of curiosity rather than a how-to, but I'd appreciate any answers.

Thanks!
I'm no expert a theoretical expert in FrLg, but I believe the frames start counting after you hit "Continue". Also, there's a 1-frame window to skip the journal entirely, so that could help.

Since it seems you have a lot of GBA RNG questions, you could start a PM conversation with me; Gen 3 is my specialty :toast:
 

Cereza

Tastes Like Candy
Thanks! Regarding the two extra frames, what do you mean by that? Sorry, got confused. ^^;
Let's say the ivs and nature you want are on frame 30; you would need to advance to frame 32 to get the correct pokemon. But like I said, quite a few months ago and so I'm not so sure if the newer reporters account for this.
 
On Pickup in Diamond (possibly all Gen4)

Hello,

I just did some research and learn some stuff. Although this may not be very useful, I thought, I'd share it with you.

I wanted to know how the pickup-stuff works in-detail. Originally, I planned to change the function so it would give me items more often (I already patched my Pokeradar and VS Seeker to faster charging methods - using the sun instantly instead of running 50 steps).
Checks for pickup are done at the end of a battle. As the PRNG is cycled like crazy during battle, it seems impossible to precalc or preset the value for those checks.

For the record: I used an english Pokemon Diamond, the simple debugger from free iDeas and four Lv100 Pickup-Slaves.

First, I needed to find the pickup-function. As it needs to call the PRNG I searched for any place in the game that might call 0x0201B9EC (the random function). Those turned out much too many.

So I breakpointed into that function near the end of battle and searched for a savestate in which changes to the seed change the pickup results:
I found a rather small margin: when the screen starts fading to black, it's too late. "wild pokemon fainted" is too early, "own Pokemon gained exp" is too early but not by much. I think it was about 70-80 frames after the exp message that the pickup-results were frozen.
Luckily, I found a state in which I could manipulate the pickup-results by manipulating the seed - so the checks must be done later.

Next, I breakpointed the PRNG and checked where it returns to. It's to be expected that one of them does the pickup-check after it fetches a random number.
I got lots of 222F026. It seems like this is a "do nothing but still cycle like crazy"-function for battle. I also found myself in 2239272 four times and in 2239280 two times. As I got four pickup-slaves with two picking up items (for the seed I savestated), this was a good candidate.

The call to the PRNG from 2239272 is followed by a division by 0xA (ten decimal); the remainder is kept (number between 0 and 9). It is checked against 0, if it is non-zero, the function is done. The interesting thing only happens at zero, which is in (about) ten percent of all cases - the pickup chance stated in literature.
I manipulated the division to always have zero remainder (divide by 1) and all of my pickup-slaves collected stuff.

Naturally, the "which item was found"-part of the function only is called on success. This is the call that returns to 2239280. The random number is divided by 0x64 (100 dec) and again, the remainder is used further - allowing a simple compare to the limits/percentages.
I tried to follow that function any further but got stuck in some strange loop. Instead of iterating just some offsets (like the columns of the pickup-table), it iterated a lot more (does it check on level, too?). I hoped to find a spot where I could force a specific item on the pokemon - maybe even change the pickup-tables - but then gave up.
Instead, I tried to find out which number (remainder of division) resulted in which item:
Code:
0x00 -> 0x1D Revive (30 values, so about 30%)
0x1E -> 0x27 Candy (10 values, so about 10%)
0x28 -> 0x31 Dusk Stone (10 values)
0x32 -> 0x3B Shiny Stone (10 values)
0x3C -> 0x45 Dawn Stone (10 values)
0x46 -> 0x4F Full Restore (10 values)
0x50 -> 0x59 Max Revive (10 values)
0x5A -> 0x5D PP Up (4 values)
0x5E -> 0x61 Max Elixir (4 values)
0x62 TM26
0x63 Leftovers
(I didn't check every number. I just assumed that 0x05 to 0x17 are the same as 0x00 and 0x1D. For each item change, a range was tested. eg. 0x30,0x31,0x32,0x33)

This is strange in two ways:
First of all, PP Up and Max Elixir have the same number of values, thus should have the same percentage. Yet, tables (bulbapedia, smogon) often list one of them with 5% and the other with 3%. Of course, it's possible that the chances are different on other levels but I highly doubt that. Gen5 tables seem to already be corrected to "4%+4%". Is there reason to assume that Gen4 is different?

Also, TM26 is the item that arrives at the Lv91-100 tier, yet has a smaller number. All other items are "shifted in from the right when upgrading pickup level tiers". Of course, this is merely cosmetical.

Regards,

TCC
 
but it would be a good idea to post it in the RNG Research thread.
That thread starts with "reasearch for RNG abuse" and I don't think you can abuse the PRNG for pickup (the blob about mad cycling during battle).
Still "research" seems more fitting than the general help. I copied it there (should I delete the original here?) and added something on the "about n percent").

Regards,

TCC
 

Fishaman P

Mechanics Maniac!
That thread starts with "reasearch for RNG abuse" and I don't think you can abuse the PRNG for pickup (the blob about mad cycling during battle).
Still "research" seems more fitting than the general help. I copied it there (should I delete the original here?) and added something on the "about n percent").

Regards,

TCC
You should definitely be fine; XD and Gen 2 RNG info was posted there, but it's certainly not possible on hardware. (atm)
 

Fishaman P

Mechanics Maniac!
Alright. Thanks for the info. Orn another note, does anyone know how many SR's it would take on average to get an Adamant Chimchar with decent stats?
That depends on what you call decent.
Say you mean all IVs are 16+.

1/25 chance of Adamant * (1/2 * 1/2 * 1/2 * 1/2 * 1/2 * 1/2) chance of 16+ IVs = 1/1600 chance, and those IVs aren't even close to perfect.

EDIT: Oh, and Psiiionic is wrong about the NPCs advancing the frame; there are no NPCs present when you get your starter, and I speak from experience.
 

Hozu

RNGenius
is a Contributor Alumnus
What... it's entirely possible. Just practice hitting the seed on an old save file on the cart, then you can shoot for it on the new save. You can always trade to check if you keep getting the same wrong result.
 
Hello, I am new to this forum as well as RNG. I have followed Hozu's guide on RNG manipulation of egg PIDs to get a shiny charmander in emerald (I am not concerned about good IVs, I just want the shininess).

Please keep in mind that I am using vba, and the only cheat I've used is the gameshark SID finder.

Initially, I was stuck at the calibration step no 7 as I could not figure out which was the calibration value from eepid.exe. However with trials and errors, I found out that my calibration value is 21 (I first started with 20 as I have not caught the latios in my game, and added 1 to it following Hozu's advice about vblank and after that I started finding my eggs' PIDs in the RNGreporter list therefore I assumed 21 as my value for subsequent tries)

I have both charmander parents under my OT after a few trading and breeding, and made my female hold everstone, did the SRs and timed the 255th step and finally had an egg that has a shiny PID (2510th frame below)




and I used RSEdecoder to confirm it's PID and it's shininess




however, after hatching it, it turns out that my charmander is not shiny. The nature and gender is correct, and IV wise, I do not know how to have its exact IV as of now so I cannot confirm that it's the exact same charmander as the one in RSEdecoder and RNGreporter. I am confused and would appreciate some enlightenment as to why this happened to me. Thank you very much!
 

Fishaman P

Mechanics Maniac!
What... it's entirely possible. Just practice hitting the seed on an old save file on the cart, then you can shoot for it on the new save. You can always trade to check if you keep getting the same wrong result.
I wasn't talking about starter RNG being impossible (I did it myself :P), I meant that there's no way to verify your seed or even check later (unless you're willing to play up until the GTS or are able to trade, as you mentioned).
 
Emulators tend to have a different calibration value due to inaccuracies in the emulation.
Thank you for the fast response! Does that mean that 21 might not be my true calibration value even with PIDs that match those in RNGreporter list? If so, would there be a way to find out, or perhaps would you please elaborate on step 7? Because I've tried the spinda method but I was stuck because I could not interpret the result that eepid.exe give clearly;





Any help would be appreciated :)
 
I'm trying to RNG a Yanma, but I have problems doing so. As the date changes, so does the swarm, and as the Yanma I'm RNGing is only available during it....any suggestions?
 

Hozu

RNGenius
is a Contributor Alumnus
Thank you for the fast response! Does that mean that 21 might not be my true calibration value even with PIDs that match those in RNGreporter list? If so, would there be a way to find out, or perhaps would you please elaborate on step 7? Because I've tried the spinda method but I was stuck because I could not interpret the result that eepid.exe give clearly;

Any help would be appreciated :)
You are saved inside of the Day-Care building on the 254th step, correct? And you're not saved on the carpet of the building inside yes? Since walking outside does not count as a step...
 
Yes! I saved at my 254th step on the carpet, but I took my 255th step to the right (not straight outside) and only after that would I then go outside to check if the old man had the egg. Will the calibration value change halfway anyway? I have no clue of why RNGreporter and RSEdecode showed that the egg PID is the shiny PID but it doesn't hatch shiny though its nature and gender matched. By the way I tried another shiny frame, some 15000 frame into the game, got the egg PID confirmed by RSEdecode and it didn't hatch shiny as well, unfortunately... I was thinking of catching the latios first before trying again, do you think that'll work?

EDIT: I DID IT! Shiny charmander hatched. I was reading up about cloning and decided to clone rare candies so I can check its exact IV for further confirmation, and after cloning rare candies I flew to fallarbor (had the crazy idea that it might not work if I try to hatch it at the mauville-verdanturf LOL) so I just flew there and walked around and when it hatched, it came out shiny! I hope this is not purely coincidental and will try another 1 or 2 tries. Thank you for the help, Hozu!

EDIT 2: A few more tries yield positive results. All shiny PID eggs hatched shiny. I wonder what caused the problem, and perhaps flying to other areas, opening up PC, or cloning items had anything to do with it? Thank you very much anyways! :D
 
How does Rotom/Dialga RNGing work? I assume Rotom is the same as stationary pokemon, but I'm not sure about Dialga due to all of the stuff that happens before you battle it.
 

Hozu

RNGenius
is a Contributor Alumnus
Dialga would be stationary... I'm pretty sure you're able to save immediately before encountering it.

For Rotom, you would want a seed that is during night time. Or you could wait until the clock reaches night before advancing, but that is far more time-consuming and possibly unreliable.
 

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

Top