Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: Pradip Fatehpuria Newsgroups: scea.yaroze.programming.gnu_compiler Subject: Re: Good value for seeding the RNG Date: Tue, 27 May 1997 10:37:30 -0700 Organization: Sony Computer Entertainment America Lines: 32 Message-ID: <338B1BDA.A53@interactive.sony.com> References: <5mcp8h$shk3@scea> NNTP-Posting-Host: 206.41.6.40 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win95; I) Paul Kearns wrote: > > This doesn't really have anything to do with the GNU compiler, but it doesn't > have anything to do with graphics or sound, either. Maybe a > "programming.misc", "programming.other", or something newsgroup? > > Anyway, I'm looking for a decent number to seed the random number generator > with. I've always used the real time clock when working with computers, but > there doesn't appear to be such a thing on the Playstation. > > I thought about measuring the amount of time it takes for the user to press a > key, but that doesn't help for the opening animation or non-interactive > demos. All of the other volatile numbers, like clock ticks since program > start or number of vertical blanks since last VSync(), seem like they'll be > the same for each run. > > Is there a location that will always (or even usually) contain a different > number each time the Playstation's powered up?? If I read a pixel out of the > frame buffer without drawing anything, will that be random or zero (and can I > even do that)? What about the current horizontal line being drawn or > something? > > Thanks, > Paul Keanrs > paulk@anon.nymserver.com You can Vsync(-1) to feed the random seed and it gives it preety decent random number generation. I used it in Survival which places the wooden planks randomly when you startup the game. Pradip K Fatehpuria