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.

Most Generation PRNG Help / Information

Discussion in 'Wi-Fi' started by mingot, Mar 16, 2009.

  1. IronGross

    IronGross

    Joined:
    Jun 21, 2008
    Messages:
    24
    Is finding time through sheer stats as effective as listing IVs?
  2. Hamstern

    Hamstern

    Joined:
    Jul 3, 2007
    Messages:
    3,780
    Either find a spread with an odd frame or release one roaming pokémon.
  3. Shika511

    Shika511

    Joined:
    Aug 2, 2009
    Messages:
    51
    so your saying I'd have to advance it 115 then? Because the rng reporter said 114, and the frame is 1?
  4. TCCPhreak

    TCCPhreak

    Joined:
    Mar 1, 2009
    Messages:
    23
    Improbable TrainerID/SecretID-combinations

    Hi there,

    Just found out some things and thought I should share them.

    Seedsetting at start of game:

    1. Before intro comes up, Seed is set to timedate (x1). This has an offset of zero,
    so last byte is year.

    2. Then it is set to zero
    2.1 At this point, 18 random numbers are created.
    2.1 of course, with seed being zero, those are not really random

    3. When switching to title screen, it is set to x1, again

    4. After pressing "continue", it is seeded with new (current timedate)

    ---

    At the beginning of the game (starting new game),

    1. Before intro comes up, Seed is set to timedate (x1)
    2. Then zero
    3. then to x1, again

    4. Before Prof speech comes up, seed is set to current timedate

    5. After TV Scene, a new (current) timedate is put into seed
    5.1 this has a rather high offset (hat 2838 for Year 2009) as prof speech takes some time.

    6. Mersenne Twister is called twice. The second roll gives the Trainer IDs.
    (low 16Bit is public ID, high 16 Bit is hidden ID)

    7. Three calls to RNG are made afterwards, these seem used to set the pointers

    ---

    The most interesting thing about this is (6). A given seed will always result in the same TrainerID/SecretID-combination.

    This throws up a question: Can I hit _every_ number? As this maps 2^32 (seeds) onto 2^32 (possible rolls), two seeds resulting in the same roll would mean that some other number can't be hit - therefore making a specific trainerID/secretID-combination _invalid_.

    I know that Mersenne is better RNG than the other one, but is it possible to calculate back from a roll to the seed, given that you know it's the second roll? Is it easily possible?

    I answered another question myself: It seems like _every_ seed is possible at the beginning of the game. Given a large delay, you can change the seed as if the game was started in another hour.

    Still that means that someone with a TrainerID/SecretID resulting from a Seed xxFFxxxx or even xx00xxxx spent an enormous amount of time listening to the professor at the beginning of the game - thus making these TrainerID/SecretID-combinations rather "unprobable". I waited about 20 minutes just to have the "hour digit" by a single digit. Given that it is 23 =0x17 at max, offsetting it to FF would mean a waittime of 4640 minutes.
    I gotta admit, I did this on emulator so timing might be wrong but if offset is "seconds*60", this still means about 18.2 minutes per digit.

    So my main question to the math geniuses is: Can I rollback the second Mersenne roll to the original seed? Or do I have to create a map by bruteforce?

    Greetings,

    TCC
  5. mingot

    mingot free agent
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Jun 15, 2008
    Messages:
    3,050
    I don't think you are going to have a whole lot of luck with trying to work Mersenne backwards as you need 624 sequential values to even predict future iterates (you can also likely use them to figure out past, back to seed, too).

    Period of 2^19937 − 1 :(

    Of course, if the offset is fixed from seed and you have a relatively small pool of candidate seeds to brute force through it might be pretty easy to at lease figure out what the SID is from just a table of ID's. That would be very very useful. Not helpful to exploiting, but useful just the same.
  6. TCCPhreak

    TCCPhreak

    Joined:
    Mar 1, 2009
    Messages:
    23
    I don't think I need 624 sequential values, if I know I'm on second roll and I know the algorithm behind the initialisation

    t[0] = Initial SEED
    t[n] = (( upper 2bits of t [n-1] ) xor t [n-1]) * 0x6c078965 + n

    where n = 1 - 623

    (taken from page 21).

    I need to check into Mersenne, again - but if I recall correctly, only two or three of these previous values are taken. With second roll, these should be rather fixed.

    Still I'm not sure whether this rollback would be possible - if second mersenne roll is not bijective, then we'd be stuck with anyway.

    TCC
  7. yngstr

    yngstr

    Joined:
    Jul 29, 2009
    Messages:
    156

    Bump
  8. LightningFusion

    LightningFusion
    is a Forum Moderator Alumnus

    Joined:
    Mar 3, 2009
    Messages:
    1,781
    Yes the pokemon is dependent on the frame. That's why there are encounter slots.
  9. yngstr

    yngstr

    Joined:
    Jul 29, 2009
    Messages:
    156
    Uh oh, looks like I missed something here... encounter slots? I was under the false impression that once I had a spread picked out, as long as I had my frames correct, it would assign those IVs to the next pokemon I encountered, whatever that may be. Now I'm confused...
  10. Hamstern

    Hamstern

    Joined:
    Jul 3, 2007
    Messages:
    3,780
    I'm not sure what you meaning. But the formula for for how many journal flips you should do is:

    ((Target frame) - (frame of the legend ) - (number of roamers))/2



    So if you release a roaming pokémon the number of journal flips will be (114-1-1)/2 = 56

    If you don't wanna release any roamer it's best to find a another IV-spread that has a odd frame.
  11. Shika511

    Shika511

    Joined:
    Aug 2, 2009
    Messages:
    51
    thanks, that's what I was asking for. I don't have any pokemon roaming around right now.
  12. RCrayons

    RCrayons

    Joined:
    Mar 1, 2009
    Messages:
    356
    why not just catch a magikarp instead?
  13. mingot

    mingot free agent
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Jun 15, 2008
    Messages:
    3,050
    Check the first page, a few posts down. You'll see the post.

    What pokemon you encounter is determined by the random number generator.

    When you target a specific frame the calls that determine which monster you will catch are fixed, right along with the ivs that are also fixed. So if you hit the same frame with the same same seed you will always get the same monster. Of the same level. Holding the same item.

    Different frames, which may have the same ivs may yield a different monster.
  14. yngstr

    yngstr

    Joined:
    Jul 29, 2009
    Messages:
    156
    Can't do that because my spread is such so that old rod will never catch anything.
  15. bizar

    bizar

    Joined:
    Jul 19, 2009
    Messages:
    235
    I don't get it I have done everyting right when i started the game my standard frame was 9, but i haved to have 26. so i have done 8 pageflips to capture/defeated and one extra to a other page so that i would make my frame to 26. The delay that i must hit was 595 and i did so i did everything right but I still don't get the right IV's :S
  16. mingot

    mingot free agent
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Jun 15, 2008
    Messages:
    3,050
    Um, 9 + (8 * 2) = 25

    Not the 26 that you are targeting.
  17. LightningFusion

    LightningFusion
    is a Forum Moderator Alumnus

    Joined:
    Mar 3, 2009
    Messages:
    1,781
    No you didn't do everything right. 9 + 8x2 = 25, not 26. And " one extra to a other page so that i would make my frame to 26" makes no sense.
  18. bizar

    bizar

    Joined:
    Jul 19, 2009
    Messages:
    235
    Ooh I see, but then I still should get this magikarp:

    31/25/31/31/31/31, I have checked it into my timefinder.
  19. LightningFusion

    LightningFusion
    is a Forum Moderator Alumnus

    Joined:
    Mar 3, 2009
    Messages:
    1,781
    Well, you don't always hit the right delay, and sometimes even seconds. Use the adjacent list to find out where you messed up, because RNG reporter isn't going to be wrong.
  20. Muk

    Muk
    is a Tiering Contributoris a Contributor to Smogon

    Joined:
    May 11, 2009
    Messages:
    691
    If I have a caught Pokemon and a recieved through trade Pokemon on the same journal page, will that do/mess up anything?

    Edit: nvm
  21. Shika511

    Shika511

    Joined:
    Aug 2, 2009
    Messages:
    51
    this doesn't make any sense, how are you supposed to make a legendary shiny with this information?
  22. The Giritina-man

    The Giritina-man

    Joined:
    Apr 15, 2009
    Messages:
    895
    What information are you referring to? It's rather easy, just takes lots of practice and explicit timing.
  23. Shika511

    Shika511

    Joined:
    Aug 2, 2009
    Messages:
    51
    I mean I have no idea how to make legendaries shiny. I've been going over this information for the past week and I still don't understand the process.
  24. MB1010

    MB1010

    Joined:
    Jul 21, 2009
    Messages:
    103
    when i input my chansey's lv 100 stats in metal kids iv calculator i got at special attack IV 15-16 which one should i put in seed finder?
  25. Shika511

    Shika511

    Joined:
    Aug 2, 2009
    Messages:
    51
    try both, and one shouldn't work and the other should. At least in my experiance.

    can someone who's experianced in using the rng to catch shiny legendaries pm me with the whole process? I really don't understand it.

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