Anonymous user
User:Sherkel/RNG Notes: Difference between revisions
m
no edit summary
>Sherkel m (Sherkel moved page User:Sherkel/Notes to User:Sherkel/RNG Notes without leaving a redirect) |
>Sherkel mNo edit summary |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1:
Well well well, how the turntables...
== Generation III ==
{| class="wikitable"
|+ Sequential RNG calls
Line 14:
|}
[https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/random_r.c;hb=glibc-2.26#l362 Why does this multiplier look so...familiar?]
Method H determines nature first (to account for Synchronize) based on what it would be otherwise, then conducts a "hunt" for a PID that matches it in the possible ones for the numbered method, then generates the two IV halfwords based on above▼
Reason for Method 4: [https://patater.com/gbaguy/gba/ch5.htm VBlank takes priority when it occurs]; Box probably doesn't emulate the CPU timing well enough for uninterrupted Method 1
XD LCG: increment 269EC3, multiplier 343FD
ID in FRLG is 0x04000104 (Timer1 -- https://www.cs.rit.edu/~tjh8300/CowBite/CowBiteSpec.htm#Memory-Mapped%20Hardware%20Registers ); SID is upper 16 of RNG state
"FRLG initial seed is Timer1 as well
The timer starts counting when the screen changes to the "Press Start"-Screen.
This is initiated by the first button press or waiting till intro is finished.
Once it started counting, it will do so until the initial seed has been determinated.
A soft reset will have the same effect as if you switch off the GBA. "
~ flovv
http://www.coranac.com/tonc/text/timers.htm
▲Method H determines nature first (to account for Synchronize
How the hunt (also in Gen 4's Method J/K) works: [https://www.smogon.com/forums/threads/rng-manipulation-in-firered-leafgreen-wild-pok%C3%A9mon-supported-in-rng-reporter-9-93.62357/page-16#post-3807317 The game takes a seed and does (seed >> 16) % 0x19. Then it starts making PIDs and doing PID % 0x19 and it keeps making PIDs until it gets a match to that original (seed >> 16) % 0x19.]
Method H is rarely H-1 as it's slow enough to fill up VCount
[https://www.smogon.com/forums/threads/rng-manipulation-in-firered-leafgreen-wild-pok%C3%A9mon-supported-in-rng-reporter-9-93.62357/page-16#post-3809232 In some maps, the LCG advances exactly twice per frame]
blocks of three 31s (0b11111 11111 11111) are bold
Line 21 ⟶ 49:
|+ Example
|+ seed: C69FB838, LCRNG (Gen 3)
! Frame !! 32bit !! 16bit high !! Method 1 PID !! Method 1 IVs !! Method 1 IVs
|-
| -1 || 35CC77B9 || 35CC || EF72C69F || 04AF'''7FFF''' || ? || '''3FFFFFFF'''
Line 27 ⟶ 55:
| 0 || C69FB838 || C69F || 7942EF72 || '''3FFFFFFF''' || FFFFFFFF || '''3FFF'''A899 || E1695F0A(*) || 34AC44F6
|-
| 1 || EF72E04B || EF72 || FFFF7942 || '''3FFF'''A899 || FFFFA899
|-
| 2 || 7942BA62 || 7942 || FFFFFFFF ||
Line 37 ⟶ 65:
| 5 || 1158F7DF || 1158 || 6536D3E1
|}
(*) E1695F0A is Timid and
== Generation V ==
Initial seeding:
"Time is in (decimal)
00SSMMHH
HH from 00-11 (12-11AM), 52-63 (12-11 PM).
0XDDMMYY date
X=weekday, [starting at 0]"
~ Kaphotics
Kazowar: OFFSETS BLACK (add 0x20 to offset for white)
02216084 = SEED
0221608C = 0x5D588B656C078965
02216094 = 0x0000000000269EC3
SEED = (0x5D588B656C078965 * SEED) + 0x0000000000269EC3;
== Generation VIII ==
Shiny generation: twitter.com/Kaphotics/status/1197027047224176640
|