Re: Random Number generator - Java-Games

This is a discussion on Re: Random Number generator - Java-Games ; Jean: Jesus Christ! If you are making a game (is this `comp.games.development.design' or is this `mil.communications.digital.cryptography' ?) just use rand(). If you are not making a game then I suggest you enroll in university for a graduate mathematics degree, because ...

+ Reply to Thread
Results 1 to 4 of 4

Re: Random Number generator

  1. Default Re: Random Number generator

    Jean:

    Jesus Christ! If you are making a game (is this
    `comp.games.development.design' or is this
    `mil.communications.digital.cryptography' ?) just use rand().
    If you are not making a game then I suggest you enroll in university for a
    graduate mathematics degree, because you'll need one to understand why we
    can't make `truely random numbers'. Or you can just take us at face value
    when we say `one can not, with a PC, in any convenient manner, make truely
    random numbers' and use rand().

    I am not w/o experience in this matter, as I had to have some rudimentary
    understanding of pseudorandom number generation when I had to deal with
    cryptography while in the Air Force back in the early 90s, but I had a
    head-start before that from programming

    ANSI has established a standard that is both pretty fair and fairly
    pretty; via con rand();.

    </RANT>



  2. Default Re: Random Number generator

    In article <3aGpb.6294$Bv6.1933688@news1.epix.net>,
    Timothy J. Bruce <uniblab@hotmail.com> wrote:
    >If you are making a game (is this `comp.games.development.design' or
    >is this `mil.communications.digital.cryptography' ?) just use
    >rand().


    This may not be the best choice if programming under Windows, as
    the rand() implemented under MS Visual C++ 6.x/.NET (and probably
    other versions) has RAND_MAX defined to 32767. Thus, you're only going
    to get 15 usable bits out of it, tops. [rand() under most Unix
    libc-versions has 31 usable bits, which is far more usable.]

    The Mersenne Twister (free BSD-license source, see a site like
    http://www.math.keio.ac.jp/~matumoto/emt.html ) has a period of
    2^19937-1, and claims that it is sometimes faster than rand(). It's
    not industrial/crypto-grade, but it's not MS's Fisher-Price toy
    either.

    Nathan Mates
    --
    <*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
    # Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
    # NOT speaking for Pandemic Studios. "Care not what the neighbors
    # think. What are the facts, and to how many decimal places?" -R.A. Heinlein

  3. Default Re: Random Number generator

    Nate:

    Thanks for the tip!

    </RANT>



  4. Default Re: Random Number generator

    In article <3fa73b16$0$41291$a1866201@newsreader.visi.com>, nathan@visi.com (Nathan Mates) wrote:
    >In article <3aGpb.6294$Bv6.1933688@news1.epix.net>,
    >Timothy J. Bruce <uniblab@hotmail.com> wrote:
    >>If you are making a game (is this `comp.games.development.design' or
    >>is this `mil.communications.digital.cryptography' ?) just use
    >>rand().

    >
    > This may not be the best choice if programming under Windows, as
    >the rand() implemented under MS Visual C++ 6.x/.NET (and probably
    >other versions) has RAND_MAX defined to 32767. Thus, you're only going
    >to get 15 usable bits out of it, tops. [rand() under most Unix
    >libc-versions has 31 usable bits, which is far more usable.]


    What matters is how usable the bits are, rather than how many one
    obtains on each iteration. The MSVC rand() has a 32-bit seed, and this
    is probably a better criterion (it may well be that Unix versions have a
    longer seed, I don't know).

    In general, rand() is sufficient for the majority of games, but there
    are game certain applications (map-making, generating IDs for online
    play, to give two obvious possibilities) in which it would be wise to
    look for something better.

    Gerry Quinn
    --
    http://bindweed.com
    Screensavers and Games for Windows
    Download free trial versions
    New arcade-puzzler just out - "Volcano"



+ Reply to Thread

Similar Threads

  1. random number generator function
    By Application Development in forum vhdl
    Replies: 14
    Last Post: 11-27-2007, 07:37 PM
  2. Random number generator help needed
    By Application Development in forum Javascript
    Replies: 1
    Last Post: 05-08-2007, 12:44 PM
  3. random number generator of Math.random() ?
    By Application Development in forum Java
    Replies: 3
    Last Post: 05-30-2006, 04:01 PM
  4. Re: Random Number generator
    By Application Development in forum Java-Games
    Replies: 0
    Last Post: 11-10-2003, 08:33 AM