1. Welcome to Smogon! Check out the Smogon Starters Hangout for everything you need to know about starting out in the community. Don't forget to introduce yourself in the Introduction and Hangout Thread, too!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.
  3. Welcome to Wi-Fi! Please remember to read the rules and do NOT create a new thread for simple trades or Friend Safari codes.

Past Gen RNG Research

Discussion in 'Wi-Fi' started by mingot, Sep 12, 2009.

  1. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    Normal + Normal Dream World breeding produce the same PIDs if they are grabbed at the same frame on the same seed. If you have international parents, it is different from normal. Not sure if International : International DW has any differences.

    NPID generation of Normal(+DW) eggs
  2. Sniffles

    Sniffles

    Joined:
    Jul 24, 2010
    Messages:
    44
    Wait, what's the program were using to find the predicted IVs? Also, that ditto thing is pretty awesome. But, are you sure the ditto isn't international with the other parent? That could be what's going on and making the results different.
  3. The Shadow Knight

    The Shadow Knight

    Joined:
    Nov 23, 2006
    Messages:
    1,212
    I've been getting different frames using Riski's Japanese Hex flawless Ditto.
  4. Sniffles

    Sniffles

    Joined:
    Jul 24, 2010
    Messages:
    44
    Ok. Just making sure that's not what's altering the results.
  5. reklaw_vahn

    reklaw_vahn

    Joined:
    Aug 7, 2010
    Messages:
    611

    Just so you know mattj, it isn't necessarily easy. You got lucky getting two as quick as you did. It took EE almost a 1000 to get his and I am on 200+ and I haven't got my two 31's yet. It can take time, it is all up to chance.
  6. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    After looking at the base IV inheritance reports from users, I'm pretty sure the memory location of where the MTRNG lookup table grabbed frame # is region called from is at 02215B94 in White, 02215B74 in Black.

    Started at 270 at the start of the game. (Heh this memory position/value is used in the battle sequence! See that research here. Might give us a hint as to why/how the MTRNG can reseed.)

    I watched it over the process of the first egg, quickly changed to 07 to 0D. In plain english, that's 8->13. Difference of 6. Checked a later egg. Started on 36 when the "available egg" was called out. From that to 3D->43 (62-68), a difference of 6 again!

    You can adapt the check code from the template to see the ending frame of after you grab the egg just to see the ending IV line, to see if it will accurately predict the base IVs.

    Hopefully this will eventually help uncover the reason why the IV frame range isn't the same for all eggs/seeds/tests.
  7. Sniffles

    Sniffles

    Joined:
    Jul 24, 2010
    Messages:
    44
    What's the program you're using? Sorry to ask again, but I want to start trying the RNG out myself.
  8. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    To get 2 IVs 31 in the place you want is 1/1024, to get 2 in any of the six places is 1/34.1

    They are using researcher.

    ---

    I'm honing in on how the game advances the MTRNG IV call position from the lookup table. It appears to be ingame related kind of like once something trips it (which I don't know). These triggers could be used for RNG abuse to forward the IV frames to the group of six you want.

    What's even more interesting is that once the 270 is tripped, the MTRNG position is "reseeded". I don't think this is the case anymore, since the game always will start at 270 and once receiving a Pokemon you can still predict from later frames from that initial seed (270). Since it is advanced past 270, there is a new value in the MTRNG position, which was thought to have no relation to the IVs. With my RNG knowledge from "Current Seeds" in gen 4, the initial seed position could be changed, but always was related to the initial seed. I believe this is the same case, but for this generation.

    Hypothesis:
    Every 270 MTRNG, it undergoes some advancement but is still related to the initial seed. Thus for an egg after 20 eggs, the base IVs could still be determined from that initial seed except the frame in the table would be above 500. (just some ballpark numbers)

    ---

    ===
    This trigger appears to be related to a step counter. The position advances by +2 every 128 steps. YAY!

    So, you can change the IVs of the egg (and pokemon) by X (X=# pokemon in party) frames further down the list by walking 128 steps.

    ===

    With this memory location I've been confirming the IV advancement of legends and wild pokemon. Starts at 270, changes from 01-06.
  9. ΩDonut

    ΩDonut don't glaze me bro
    is a Programmeris a Forum Moderatoris a Community Contributoris a Pokemon Researcheris a Contributor to Smogon
    Moderator

    Joined:
    Aug 23, 2006
    Messages:
    3,727
    This is exactly how the Mersenne Twister works. It takes a seed, makes a table of 624 values (624 = 0x270), modifies each of them slightly. When it needs the 38th RNG result, it grabs the 38th result from the table. If you ask for 625th RNG result or beyond, it recalculates the values in the table, then grabs the (i % 624)th value from the new table. Here's a little Perl code that shows you how it's recalculated:

    Code:
    for ($i = 0; $i <= 623; $i++)
    {
    	$y = ($MTarray[$i] & 0x80000000) | ($MTarray[($i+1) % 624] & 0x7FFFFFFF);
    	$MTarray[$i] = $MTarray[($i + 397) % 624] ^ ($y >> 1);
    	if ($y % 2 == 1)
    	{
    		$MTarray[$i] = $MTarray[$i] ^ 0x9908b0df;
    	}
    }
    Researcher Mode in RNG Reporter should show you the correct results for value 624 and beyond; it does this same recalculation.
  10. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    So what I was thinking was that even if it supasses 270 (624 dec) and thus a new value is shown, researcher will still tell you the correct IVs even though they are above frame 624. Not sure on the CGear, but pressing yes on the activate changes to 270+2=(02) walking 128 steps changes by +2 (04), with no change to the MTRNG location (But it was changed by the CGear).

    Show Hide
    Hopefully the CGear uses the delay to advance something like 624(dec)*Delay and roll forward to 2. One can only hope!

    For my ballpark example I forgot to convert from hex to decimal, lol. It should be above this 624 decimal (~60 eggs made/300 advancements LOL)

    I found 9908b0df at 02215B9C, just two words right of the 270 counter. That's got to be the end of the MTRNG, agreeing with the code :P

    I guess now we can just go back and see what frames IVs are grabbed from for the roamers and other encounter types!
  11. reklaw_vahn

    reklaw_vahn

    Joined:
    Aug 7, 2010
    Messages:
    611
    It isn't the same because NPC movement/Time between obtaining eggs advances the frames. I have a post in the previous page that gives some data on this phenomenon. I am pretty positive that my results are conclusive.

    If you go a few pages back there is a few posts by Kaphotics and Omega that explain the AR seed code checker use and researcher use. Check there.
  12. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    Steps taken (128) will depend on if there is an egg or not available at the man, you just have to walk over the line to see if there is one or not. It is true that the NPCs will affect the main RNG (Nature, inheritance, and PID). Time and NPCs will not change the 270 counter (IV MTRNG) at least for the timespan I measured (which was 20 minutes of just letting it sit).

    So if it takes longer to generate an egg, you've been walking longer, thus stepping more than last time. This increases the position by more than last time thus increasing the difference of row start positions between eggs.

    From what I was saying was that taking 128 steps will move the rows down by 2 if you choose to do so when you are able to grab an egg. I was able to reliably repeat and confirm it.

    The amount of jumps it does while talking to the man/pokemon (from 270->07 is a jump) could be different depending on the start RNG frame, MTRNG frame, or it could be advanced by something else (codes, viewing something, hatching?). This is the only way I can think of the rows changing from a non even incremental amount (7 difference between rows, 12 difference between rows)
  13. ΩDonut

    ΩDonut don't glaze me bro
    is a Programmeris a Forum Moderatoris a Community Contributoris a Pokemon Researcheris a Contributor to Smogon
    Moderator

    Joined:
    Aug 23, 2006
    Messages:
    3,727
    I just applied the Mersenne transformations to the first few entries of the MT table generated after firing up the C-Gear, and compared them to the IVs of a caught Pokemon.

    [​IMG]

    The IVs started on Mersenne frame 2 of that table, confirming your findings.

    So the reason we couldn't use the value at 022151D4 before was just because the table had already been transformed a few times. I'm going to look into reversing the MTRNG - I know someone already managed it, although you needed all 624 values in the table to do so. So it couldn't be used for figuring out the initial seed from the IVs alone, like we could last gen. But since we know all 624 values in the table, we should be able to use it to get a better idea of how the initial seeds are generated.
  14. ΩDonut

    ΩDonut don't glaze me bro
    is a Programmeris a Forum Moderatoris a Community Contributoris a Pokemon Researcheris a Contributor to Smogon
    Moderator

    Joined:
    Aug 23, 2006
    Messages:
    3,727
    ...

    Oh, fuck me.

    Remember when I said that the C-Gear seed was supposedly calculated by
    except it looked like it didn't? Well, turns out it is after all. Could've had RNG abuse with more control about a month ago.

    So, I'm making a list of seeds that produce good IV sets (for wild Pokemon, eggs, and roamers), seeds that can be hit by turning on the C-Gear at the right time. It's going to take some time, because it's a computationally-intensive process. Unfortunately, some of these seeds are going to be impossible to hit on some DSes due to the MAC address making them unreachable. And this technique is harder to pull off because it requires way more precise timing. But it's a way we can predict the IVs for wild Pokemon (including Dream World Pokemon) without lots of trial and error.
  15. Expert Evan

    Expert Evan every battle has a smell!
    is a Forum Moderator
    Moderator

    Joined:
    Jan 16, 2007
    Messages:
    3,881
    One thing I notice when I'm targeting for my seed over and over again, is that I consistently see at least 3 other seeds appearing each time usually more than others. I'm not sure why. The seed I'm targeting seems to come up 1 out of 8 times.
  16. mattj

    mattj blatant Nintendo fanboy

    Joined:
    Mar 30, 2009
    Messages:
    4,686
    Just tell us what to do and we'll test it Mike. Oh and when you said it will be more precise did you mean more precise than non-cgear rng, or more precise than 4th gen rng?
  17. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    Can't believe I overlooked this with the step counter. MattJ if you would? :P

    Code:
    Eggs
    Start	Frame	IV Calls	RNG Process		IV Rows of Pokemon	
    0270 	(0)	07-0D [07-13]	Jump 7, Advance 6 	[08-13]
    0002 	(2)	09-0F [09-15]	Jump 7, Advance 6 	[10-15]
    0005 	(5)	0C-12 [12-18]	Jump 7, Advance 6 	[13-18]
    0011 	(17)	18-1E [24-30]	Jump 7, Advance 6 	[25-30]
    
    Wild Pokemon
    Start	Frame	IV Calls
    0270	(0)	1-6	
    
    
    Dream World	Talk		Engage
    001C	(28)	1C->1D->29	29->2A->36
    0020	(32)	20->21->2D	2D->2E->3A
    Not sure yet on which IVs are taken, since it is a +1, +12 twice.
    
    Wonder Cards
    11E->125->12C->133
    11F->126->12D->134
    134->13B->142->149
    +7+7+7 [B]ಠ_ಠ[/B]
    The reason it increased by 2 was because I had two Pokemon in my party. So when I picked up an egg, it increased by 3 every 128 steps. heh that explains a lot!

    Walking 128 Steps increases the MTRNG row by how many Pokemon (including Eggs) are in your party.
    Just like the last generation (except on the regular RNG).


    The amount of jumps it makes could be different for different encounter types.


    To see what the current IV Frame is, just plugging in the memory location provided earlier in the template.
    IV Frame Check Code (Up). $=0 (open)
    White
    Code:
    94000130 FFBF0000
    DA000000 02215B94
    D7000000 022696A4
    A226969A 00000000
    1226969A 00000000
    DA000000 02215B94
    D6000000 0226969A
    D2000000 00000000
    Black
    Code:
    94000130 FFBF0000
    DA000000 02215B74
    D7000000 02269684
    A226967A 00000000
    1226967A 00000000
    DA000000 02215B74
    D6000000 0226967A
    D2000000 00000000
  18. reklaw_vahn

    reklaw_vahn

    Joined:
    Aug 7, 2010
    Messages:
    611
    The reason I was thinking that what you said was off was because of a particular incident where I just accepted an egg and then walked down to the entrance line, where you get the message for an egg, and I got another egg. I then went directly back up and collected. I only had the one Pokemon and one egg in my party and my frames went from 8-13 on egg one to 21-26 on egg two. If you were right about the 128 steps then I should have only jumped up 2 rows from 8-13 to 15-20...right? There must be something else affecting this too.
  19. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    It jumps 7 times before producing the egg.

    So for your case
    0270 for the starting frame (0000).
    No advancement since the egg is already there. Before collecting the egg it jumps 7 times from 0270(0000) to 0007.
    07->0D for the first egg (8-13)
    No advancement, before collecting the egg it jumps 7 times from 0D->14.
    14->1A for the second egg (21-26)

    Since 0270 is result 0 of the table (synonymous to 0000), so the ending frame (0D and 1A) are actually 13 and 26 respectively.

    Hatching and if the man has an egg or not is determined from some other trigger. Consider yourself lucky for the time to get that next egg!
  20. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    Going back with the new info we have on the IV generation, with respect to the roamers. Confirming mattj's tests on the cart concerning IVs

    0270, as you regain control of your character after witnessing the roamer appear it advances to 07. 0000-0007, IV range of rows (0-7). Different from regular pokemon IV generation!

    Can't see the order of which they were taken, as this all happened in 1/60th of a second in the game. The IV row did not advance as I did not trip the step counter. The rain did nothing. PID/Shiny should be hard for these guys, it'd still be pretty hard to find the memory location in which the PID is stored. So for now no Nature/Shiny RNG on the roamers because of the stupid rain!
  21. mattj

    mattj blatant Nintendo fanboy

    Joined:
    Mar 30, 2009
    Messages:
    4,686
    Do you know of any other VGC11 mons that might have their IVs generated differently? Anyone looked Landros? Now that I know I can't use Zekrom, I'm just going to catch him, so I can move on and look at the others.
  22. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    I've got a save catalogue next to all the stationary legends. I'll check them all out and edit this post for each one.

    Code:
    Terakion	0270-0006
    Kobaruon	0270-0006
    Birijion	0270-0006
    Kyuremu		0270-0006
    Victini		0270-0006
    Urgamoth	0270-0006	00A9-00AF
    Wild Pokemon Near Uragmoth	0270-0006	0209-020F
    Starters	0270-0006
    Shaking Tile	0018-001E
    
    White Forest Tile (Mareep)	000C-0012	(tripped step counter twice walking to forest)
    White Forest Tile (Togepi)	000C-0012
    Another nearby Tile (Rhydon)	000C-0012
    Above White Forest (Jigglypuff)	0012-0018	(I had 6 pkm in party tripped oncemore)
    
    Double Battle Tiles
    Double Battle	004E-0054-005A
    Single Battle	004E-0054
    
    Landros		001E-0024
    Everything I tested followed the Frame 1-6. All are in the same "method" of IV generation.

    To answer your question, Landros acts like any other stationary legend. The IVs are exactly from the lookup table. Good news!
  23. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    RNGing a Landros for whatever nature, just trying to RNG IVs.

    [​IMG]

    Heh. Pretty easy!

    For these method Pokemon, have the MTRNG counter advance to the frame right before your target Starting IV frame. So for this test I advanced to 131, and engaged Landros. Got the IVs!

    ==

    Went back to the odd advancement of the IV frames I noticed when I was withdrawing pokemon.
    Code:
    0005->000C
    000C->0013
    0013->001A
    001A->0021
    0021->0028
    et cetera
    Withdrawing a Pokemon increases the IV frame by 7.
    This will help hit high frames.

    ==
  24. mattj

    mattj blatant Nintendo fanboy

    Joined:
    Mar 30, 2009
    Messages:
    4,686
    Woah. Bro. Hold up.

    Are you saying you know how to advance frames on the MTIVRNG for Capture Mons? Like you normally get frames 1-6. How are you advancing it?

    [edit]
    After re-reading it, you're saying that withdrawing a mon from your PC advances the frame by 7? Like, you get the IVs from frames 7-12 instead of 1-6? And you just hit your seed, withdraw X times and then walk to and capture your mon?
  25. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    781
    Hehe yes I do.

    Walking 128 Steps advances the "MTIVRNG" by 1*# of Pokemon in your party.
    Moving a Pokemon from the box to your party (Move Pokemon) advances it by 7.

    So from 1-6, it would be 8-13. I believe this is why eggs are this way as it is placing the Pokemon in your party that advances it. Of course the withdrawing thing only is in multiples of 7, so you'd advance it as much as you can with that. Then whatever is left has to end at the frame before your wanted IVs, so you have to be mindful of that and how many steps you walk (without going over).

    There has to be more ways to do it, those are the only ones I've seed + confirmed so far.

    I'm doing the Landros with those IVs for a Jolly Nature right now. Undoubtedly it will become inferior once some good seeds come out, but I'll probably freely redis it when a better one replaces it. :)

Users Viewing Thread (Users: 0, Guests: 0)