So I've worked through and, with the help of posts I've found on the subject, developed a PRNG that works for me pretty well...however, I'd love to develop something that gives me a random seed value for it prior to, say, player input.
Does anyone have any methods for this? Having a random seed value sort of initialize with the rest of the init data?
Thanks!
Most games appear to use time from power on to pressing Start as the seed. If you want something with no player input, such as a randomly selected animation at power on, use one of the methods described in
this topic.
Three methods in the past:
- Tepples discovered a method for reading random noise from
$2007 during rendering.
- Blargg discovered a method for reading random noise from
OAM RAM.
- Older games count the number of vblanks between button presses and feed that into their PRNG... but this allows luck manipulation.
On my title screen, I just spin in a loop polling the controller until they press start, bumping the PRNG each time. It runs many, many times per frame, so it's very good randomness on real hardware. On an emulator it is probably equivalent entropy to just counting vblanks. because the emulator's underlying gamepad polls are probably only once per frame.