Most Generation PRNG Help / Information

ok i fixed that.
anyways lets a say i caught a pokemon with sweet scent and now want to check the IV's. so do i have to have an AR or how can i check them?
 
It's been said that this ARNG (in your linked material) generates the PID for wonder card pokemon. I wonder if that's really the case, now, or is it _only_ using this routine for PID modification to un-shiny them, when in fact, there was some earlier method used to create the initial PID. What makes me think it could be is that the IRNG actually uses this routine when you have parents from different regions in daycare to modify the PID (up to 3 times) to increase the chance of it being shiny.
As the info says the seed for the mystery gift pokemon is made from the two locations given (16 bits each) then the ARNG is used exclusively.

Here is a video which shows the mystery gift algorithm in action: http://rapidshare.com/files/173485208/MG.avi

and an explanation: http://www.pokecommunity.com/showthread.php?t=163030
 

mingot

free agent
is a Site Content Manager Alumnusis a Battle Simulator Admin Alumnusis a Top Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
And any idea what puts the values into the two locations given that lead to their seeding or the ARNG?

If those numbers could, in any way, be correlated back to the initial seed that LCRNG and IRNG use then it might actually be possible to do a soft hack check on them.
 
And any idea what puts the values into the two locations given that lead to their seeding or the ARNG?

If those numbers could, in any way, be correlated back to the initial seed that LCRNG and IRNG use then it might actually be possible to do a soft hack check on them.
This might be a possibilty. I'll let SCV know and see what he can find about the IRNG. Would he be able to find everything he needs to find it in the RAM in this thread?
 

mingot

free agent
is a Site Content Manager Alumnusis a Battle Simulator Admin Alumnusis a Top Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
He'll probably want the magic numbers for MT, which is at least linked. I spoke with him a bit ago and he put me right on the wondercards. :)
 

mingot

free agent
is a Site Content Manager Alumnusis a Battle Simulator Admin Alumnusis a Top Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
Thats the one you want to choose. The next version renames all options to DPPt, but it is not out yet. Thanks :)
 
This is all so confusing to me. ?_? Can someone please tell me what RNG stands for before I start to try to comprehend how all of this works? And can someone please give me link to threads that include information that'll be useful to me?
 
the Jonny2Code has at least 2 mistakes: an | must be replaced with a + and a & with a xor somewhere but I don't remember where...time has passed :D.
Found them - the hard way. ;-)

also my own generator now outputs the same numbers as mingot's does. Decided to go for C++ because the STL-Map seems rather nice for it - also my other pokemon-related-tools were written in C++

Code:
typedef map<uint32_t,uint32_t> t_mersenneTable;

t_mersenneTable createInitialMTable(uint32_t seed){
  t_mersenneTable myTable;
  { // insert seed
    pair <uint32_t,uint32_t> myEntry;
    myEntry.first=0;
    myEntry.second=seed;
    myTable.insert(myEntry);
  }
  uint16_t tableIndex;
  map<uint32_t,uint32_t>::iterator lastPos=myTable.begin();
  for (tableIndex=1;tableIndex<=623;tableIndex++){
    pair <uint32_t,uint32_t> myEntry;
    myEntry.first=tableIndex;
    myEntry.second=((lastPos->second / (1<<30)) xor lastPos->second) *0x6C078965 + tableIndex;
    myTable.insert(lastPos,myEntry);
    lastPos++; // advance iterator 
  }
  
  //t[n] = (( upper 2bits of t [n-1] ) xor t [n-1]) * 0x6c078965 + n
  return myTable;
}

uint32_t getPreRandom(t_mersenneTable* currentTable){
  uint32_t currentIndex=currentTable->rbegin()->first+1;
  uint32_t temp_h=0;
  uint32_t randomNumber;
  temp_h = temp_h + ((*currentTable)[currentIndex-624] & 0x80000000); // front bit
  temp_h = temp_h + ((*currentTable)[currentIndex-624+1] & 0x7FFFFFFF); // back
  // temp_h is equivalent to k[0]
  
  randomNumber=(*currentTable)[currentIndex-227] xor (temp_h / 2) 
                xor ((temp_h % 2) * 0x9908B0DF);
  // last xor only useful if temp_h is even.
  
  { // insert into table
    pair <uint32_t,uint32_t> myEntry;
    myEntry.first=currentIndex;
    myEntry.second=randomNumber;
  
    currentTable->insert(myEntry);
  }
  return randomNumber;
}

uint32_t temper(uint32_t randomNumber){
  uint32_t temp;
  temp = randomNumber;
  temp = temp xor ((temp >> 11)); // (equivalent to ( / 0x800)
  temp = temp xor ((temp << 7) & 0x9D2C5680); // equivalent to ( * 0x80)
  temp = temp xor ((temp << 15) & 0xEFC60000); // equivalent to ( * 0x8000)
  temp = temp xor ((temp >> 18));
  return temp;
}
now I just need to put it into a class file on its own, write some nice command-line-interface... but the main work is done.

@mingot: Thanks for posting the example code. I really helped finding the flaws in my stuff.

TCC
 

mingot

free agent
is a Site Content Manager Alumnusis a Battle Simulator Admin Alumnusis a Top Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
For everything except checking your SID, yes you can do it without a cheating device as long as you have rare candies.
Actually if you have a shiny pokemon that you have caught, not including chained pokemon, you can find your SID without any hacking device.

@ TCC It looks very nice and clean :)
 
after lots of procrastination I finally gave a shot at this with my Pearl gme and finally got the bold female shiny feebas I always wanted on my second try. :)
 
It has been a LONG time since I bred anything but as soon as I read that this was possible to do on D/P I had to try it.
I managed to lock myself on a Shiny-Adamant-Technician-Scyther-egg after only 300+ taps and 9 coin flips :D
Now if only the RNG that generates the IVs of eggs was figured out too this would be a breeze but for now I'm SRing the good old fashioned way as always.
Thanks to everyone that make this possible.
 

mingot

free agent
is a Site Content Manager Alumnusis a Battle Simulator Admin Alumnusis a Top Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
It's been figured out, just waiting on documentation and new software (which is really done now so just documentation). Warning -- It's not like Emerald and it WILL test your patience and sanity. Some with good parents will likely opt to continue the old fashioned way.
 
my brother just did 316 taps, and 5 coin flips, just like the app said. but he didn't get a shiny sheildon like he was breeding for. what's the cause?
 

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

Top