1. Welcome to Smogon Forums! Please take a minute to read the rules.
2. Welcome to Wi-Fi! Please remember to read the rules and do NOT create a new thread for simple trades or Friend Safari codes.
3. Click here to ensure that you never miss a new SmogonU video upload!

# RNG Manipulation in FireRed/LeafGreen: Wild Pokémon Supported in RNG Reporter 9.93

Discussion in 'Wi-Fi' started by Arseus, Oct 11, 2009.

Not open for further replies.
1. ### mattjblatant Nintendo fanboy

Joined:
Mar 30, 2009
Messages:
4,702
Never thought about it that way. That could have merit. I still think it would widen your Final Frame Range, but what you suggest there would minimize that probably as best as is possible.

When you get set, try it out and let us know if it works for you or not! I think you may be on to something there! :D
2. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
Yo I'm back with more formulas to help out!

I was fiddling with the new seed to time formula, and found something interesting:

If you divide the seed by 16777216, you get the LEAST length of time required to hit your desired seed (IE within the first 3.90625 milliseconds)

What does that mean? It means finding a time to match tempos+ beats to is a no brainer, since all you have to do is a 3.90625x milliseconds to the answer you got above.

Seed / 16777216 + 0.00390625x = tx

note that you can add any number you want before the decimal point, since the numbers to the right always repeat every 256 numbers.

What we can do with this: well; the simplest thing we could do would be to:

FIND THE OFFSET OF SEEDS WHEN SRING

I'll be testing this out on my own, but I wanted to put my findings up here so that others can help out too :D

I'll edit this post when I get my results all collected.

3. ### NixHexONE YEAR Seizure Free!! God bless keppra.

Joined:
Oct 6, 2009
Messages:
2,932
Okay, I'd like to expand on Zari's new formula:

I'd like to put this into code, if I am understanding the equation correctly. Here's my idea in pseudocode:

Code:
int N = 10; //seconds offset, aka "the number before the decimal"
int c = 16777216; //can this number be an int?
int seed = 21757; //0x5f4d ... I'll  explain later
double Tinter; //intermediate time
int t;
int m = 100;
double e = 0.0001; //stop watch offset

int finalx = 100000;
output "Tmin = " + seed/c + " seconds.\n";
output "Desirable Stopwatch Times\n";
for (int x = 0; x<=finalx; x++) {
Tinter = seed/c + N + x/256;
if ( frac(F/m) < e ) {
t = (int) Tinter; //cast Tinter as an integer aka remove decimal part
output t + " sec\n";
}
}

This basically shows times that can be put into a countdown timer (stopwatch) that are very accurate to the hundredth of a second (which is why m = 100). If you are using a stopwatch that does not have a hundredths place display, I recommend finding something else, but you can always set m to 1 so that you get a solid seconds value.

I think this method may be flawed, because what if no values for a certain seed satisfy that accuracy? We'll put that aside for the time being.

As I promised, let me explain my decision for the seed 54fd. What I did was go into Time Finder in RNG Reporter and opened up the min and max frames to about 600 and 640 (these are arbitrary as you will find good numbers anywhere, and they have no significance in FR/LG). I then searched for:
It came up with two spreads:
I put the first seed into Neosyrex's program and it didn't find a seed. So, i input the second seed and it came up with
Code:
Enter seed:
bf0d0283
-32134: 54fd

I then put 54fd into RNG reporter and searched for the seed. It was on a higher frame, 32868. I thought this was weird, so I put it into RNG Reporter's IV to PID function. it gave me a seed of B633AED6. I put this into Neosyrex's program and it gave me the correct frame, 32868, most importantly with the same seed.

I hope this information is useful. I'll keep working on this later.
4. ### mattjblatant Nintendo fanboy

Joined:
Mar 30, 2009
Messages:
4,702
can you hit 54fd with consistency?
5. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
The problem with what you are trying to do is that the formula was not designed to work with a stopwatch. Remember the equation I used to get this formula?

t / 60 = n / T

It's not going to work out; because t and n / T are interchangeable, the formula only works correctly when you are trying to match it with tempo and beats. The reason for this is that there are a great many more combinations of n / T that would satisfy e in the code than there are times to hit with a stopwatch; there are 256 different times to match n / T to, compared to only 256 times to hit with a stopwatch. I'll take a look at designing a formula for a stopwatch, but using that one you'd only have a slight probability of getting a value less than e.

Hope that helps explain this a bit more.
6. ### NixHexONE YEAR Seizure Free!! God bless keppra.

Joined:
Oct 6, 2009
Messages:
2,932
Well that's a completely different story lol. The point of my post was to find an appropriate time to see if I can hit that seed. Remember that the ultimate goal of this project is to hit a seed that we choose ourselves, aka being proactive instead of relying on a fluke seed that we happen to hit accidentally.
7. ### mattjblatant Nintendo fanboy

Joined:
Mar 30, 2009
Messages:
4,702
lol sorry I understand now. That's a crazy spread on that seed. Hope you CAN figure out how to target it!
8. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
You could always shoot for the seed a14a, for this hasty spread:

Code:
seed: 9d08ff08, FRAME: 4135, PID: 2ea9e2b9, HASTY, 31 / 31 / 30 / 31 / 31 / 30
in Neosyrex's program:

Code:
Enter Seed:
9d08ff08
-4134: a14a
Granted it doesn't have max speed, but it's a whopping 1:08:91 (not an hour, just a MINUTE) into the game, so that's not a bad reset time :/
9. ### NixHexONE YEAR Seizure Free!! God bless keppra.

Joined:
Oct 6, 2009
Messages:
2,932
Yeah I got this pretty delicious spread at a semi-low time:
Similarly, this doesn't have max SpA, but everything else... flawless. I love it.
I think I'll go for that Hasty spread you showed... that's pretty awesome! Thanks.
10. ### NixHexONE YEAR Seizure Free!! God bless keppra.

Joined:
Oct 6, 2009
Messages:
2,932
@Zari
only ranges from 0 to 0.9999...
So I'm assuming that this is supposed to be multiplied by 65536 to account for the entire range of seeds?
I just need to be absolutely certain of every formula because I am trying my hardest to whip up a program that calculates necessary combos of T and n.

Edit: Idea.
Above I explained how I found good seeds with RNG Reporter, and I assume that's how Zari found that amazing Hasty spread. However, this takes tons of time because we're working off of a program that's capable of calculating 2^32 - 1 seeds (am I right?). The method I used was really clunky. It required working around DPPt seed generation techniques (date, time, delay, frame, etc.) to find good spreads, whose seeds we ended up plugging into Neosyrex's program anyways (and most of them that I found were valid). Therefore we know that most spreads are available in FRLG, which only has 2^16 - 1 seeds (again, am I right?). It would be much easier to write a program that finds ONLY compatible FRLG spreads. It prompts for Method; Nature; Min, Max, or Exact HP,Atk,Def,SpA,SpD,Spe; max hour(indefinite); max minute (0-59); Then it loops through from seeds 0 to 65535 and finds spreads that occur within the given time constraints and outputs each matching seed. It will display the seed, the frame number, hours, minutes, and seconds, nature, IV's for that particular spread.

Code:
prompt Method (1,2,4)? --> int method;
prompt Nature (-1 for any) --> int nature;
prompt Max (2), Min (1), or any (0) HP constraint --> int HPConst; /*this allows you to search for a minimum HP stat (say, 30) if you enter 1, or exact (31) if you enter 0, etc. etc. */
prompt HP --> int HP;
prompt Attack Constraint --> int AtkConst;
prompt Atk --> int Atk;
prompt Def Constraint --> int DefConst;
...
prompt Spe Constraint --> int SpeConst;
prompt Spe --> Spe;
prompt max hour --> int maxHour;
prompt max minute --> int maxMinute;
prompt max second --> int maxSecond;
/* Here are our constants */
int i;
int maxSeed = 65535;

/*get time*/
int maxTime = 3600*maxHour + 60*maxMinute + maxSecond; //in seconds
/*brute force*/
for (i=0; i<=maxSeed; i++) {
/* insert code to check every seed, i, and get the PID, iv's, etc..
then output all of these values, including gender and ability */
}

11. ### NixHexONE YEAR Seizure Free!! God bless keppra.

Joined:
Oct 6, 2009
Messages:
2,932
I notice this thread is slipping to the bottom so I figured I'd update. I am currently about half-way finished with my SpreadSeeker program. It is working pretty well but I am having some issues trying to generate the list of spreads. Hopefully in a few days I can get some screen shots, and when I do, I'll put them up.
12. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718

Yeah, and I'll be working on the actual interface for the program(I have some experience in that kind of work) Obv. I'll need your code to actually test to see if the interface works, but I'll post some screen shots of what I come up with too(Heck, if I have enough time I could probably design it as a web applet first!)

I think the hardest part will be outputting the spreads into a location; if you could send me the errors you are getting (or if you fix them, great) I've got an actual java applet building program that can look up everything we might not know.

I think once I get your code into place, it might take me a little while(give me a day or two to get everything up and running), but I'll put what you have in code form into an interface. It might start out looking crappy, but I'll work on fixing that up later; our priority right now is to get it running, not to make it look nice. That part will come later.
13. ### Misdreavus

Joined:
Feb 27, 2009
Messages:
1,461
It looked like you all were making a lot of progress, but I see there hasn't been a new post in over a month... is anyone still working on this, or has it been put on hold?
14. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
I'm still working on it on and off. Right now I have a basic java program built that spits out seed / frame / nature / PID / IVs, albeit not all the correct values(yet), which is what I have left to fix, then I can get started on incorporating in some FR/LG stuff. Also, atm it only does method 1 stuff, since we don't know how to control wild pokemon yet (and I don't know the code offhand for the other method generations >_>) It's moving slowly, but I'm making progress. I haven't bothered to post anything itt yet, since It hasn't been working product form yet.

As a side note, I'm looking into incorporating an Emloop style timer into this FR/LG version, for convenience. Once I get the crude RNG reporter stuff done I can post it, but nothing has hit a landmark yet that's worth posting :/
15. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
OK it's good news time :) I have the program up and running, spitting out IVs / Nature / PID / seed / frame with consistent results (which I believe are correct). I have yet to incorporate any of the tempo/beat stuff yet, but progress is being made :) Next project is to get the tempo and beats searching mechanism functioning...!
16. ### GoldenBanana

Joined:
Apr 10, 2010
Messages:
137
After a long time of searching for a way to RNG abuse in FR/LG, I have only recently found this thread, and I must say, after reading through it, you guys have been making awesome progress, keep up the good work!

I am not new to RNG abuse, but I wouldn't say I am an expert, although I have RNG abused in Platinum, Heart Gold, and Emerald. I've read/skimmed (sorry, most of it was trial and error anyway) the thread and I still have a few unanswered questions:

1) By what Method are the Roamers Raikou, Entei, and Suicune generated? And how can this be discovered other than speed running through the game several times?

2) Is there any information on eggs yet?

3) Will the new program be an upgrade to RNG Reporter or will it be a separate program?

4) Do shiny spreads require a secret ID and are there any methods to finding it in FR/LG yet?

5) Does this research apply to R/S as well, or is there a separate thread for that?
17. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
I'll answer your questions in the order you posed them.

First off, It's not worth finding out what method the roamers are generated in FR/LG, because of the glitch which fixes the IVs to extremely low values, with only the HP actually being a true variable (I believe the maximum values are 31 / 7 / 0 / 0 / 0 / 0, but I could be wrong); this was fixed from emerald onward.

I've been researching as a side project on how eggs are generated in FR/LG, but I haven't been making much progress, as I'm stumped as to why the natures aren't fixed upon egg generation (yes you read that correctly). Odds are it has to do something with the way wild pokemon are generated in FR/LG, although I'm uncertain if this is true or not.

At this point it looks like it will be a separate program from RNG reporter, although I'm planning on expanding it to include ALL 3rd gen games when I get the chance.

As far as I know you still need to have encountered a shiny on your cart file to find your SID, so for the moment shiny RNG abuse is out of the question.

I don't believe there is a separate thread for R/S research at this time, although I have been doing some behind the scenes already. Most of the information in this thread doesn't apply to R/S apart from the seeds; what little I've found out indicates that R/S uses the same seeds as FR/LG, albeit not the same seeding mechanism. R/S abuse is definitely gonna be in the program however; as I mentioned above, I'm planning to turn the program I'm writing into a 3rd gen program and not just FR/LG, just like RNG reporter is all 4th gen and not just DP[Pt].

If those answers don't satisfy what you're looking for, or if you have any more unanswered questions, you can find me most of the time on #smogonwifi on irc :)
18. ### GoldenBanana

Joined:
Apr 10, 2010
Messages:
137
I know about the roamer glitch in 3rd gen and have had PLENTY of experience with it. :)
I'm just interested in having shiny dogs (and lati@s, i guess) in 3rd gen, but as you said, that's out of the question for the moment, so drat.
19. ### Misdreavus

Joined:
Feb 27, 2009
Messages:
1,461
I'm a bit confused by the whole "beat/tempo" talk. What exactly do you mean by those terms? Are you talking about actually having your program play a consistent beat (either auditory or visual) for the user to attempt to synchronize their button presses during the opening sequence with in order to hit a specific seed?

Keep up the great work!
20. ### Ray Jay"Jump first, ask questions later, oui oui!"

Joined:
May 20, 2010
Messages:
1,743
I read that you guys often reporteed inconsistencies with frame advancement in both noisy and quiet zones.

Just a thought, is it possible that roamers affect frame advancement?
21. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
The program is going to be designed to generate a tempo/beat that will allow you the greatest chance of hitting your seed; it will tell you some numbers that correspond to the time on which the game goes to your target seed. So far the idea hasn't been to include a metronome, just to generate the tempo/beats that give you the greatest chance to hit your seed, although if enough people want a metronome included I can try to implement it :/
22. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
Posting to say that I have found a (somewhat) reliable method on hitting the same seed in FR/LG, albeit there is a limited selection of what you can hit (depending on how fast you press A repeatedly you can get different results).

I have already hit (within <20 resets) 3 seeds in VERY close proximity to each other, those being 52d4 *2 / 52d6 *2 / 52d7. What is extremely interesting is that I am able to do this without any external device/metronome/GC turbo controller, only emloop and rhythmic button mashing.

Basically, how I did this was I timed my button mashing so that I would skip the entire intro AND the charizard "flash", instead making it do the cry immediately. What this did was make my timing extremely consistent, since I knew what to look for each reset.

Just wanted to let those of us without a GC turbo controller know that hitting the same seed is very possible if you follow what I did above (note that it should be possible to obtain any seed this way; all you would have to do is vary the length of the charizard/venusaur "flash" sequence, which can be done by varying the speed at which you mash the A button. It should be possible to do this at any speed of mashing, because skipping the intro entirely only really depends on the "first" button mash at the beginning of that sequence)

Btw, my target for this attempt is 52d4, hasty, 31 / 24 / 29 / 29 / 31 / 31 frame 96758 (for SD Mewtwo!)

EDIT: Flawless Mewtwo stats (Lv50) 4 Atk / 252 SpA / 252 Spe: 181 / 131 / 99 / 206 / 110 / 200
this Mewtwo's stats (Lv50) 4 def / 252 SpA / 252 Spe: 181 / 127 / 99 / 205 / 110 / 200

4 points off flawless :D

EDIT2: just hit 52d7 again :/
23. ### Sy123

Joined:
Dec 17, 2009
Messages:
1,040
Can we confirm that we dont need our SID for this?
24. ### ZariWhat impossible odds?

Joined:
Jan 22, 2009
Messages:
718
You don't need your SID to RNG in FR/LG, but if you're going for shinies you will, just like 4th gen (meaning it's mostly luck, since you have to find your SID via catching a shiny mon)
25. ### Sy123

Joined:
Dec 17, 2009
Messages:
1,040
Gah, I never get natural shiny pokemon.
Will they be soon publishing a Noob's Guide to FRLG RNG?