- Home /
How good is Random.Range() for Uniform Distribution?
Hi, I just want to know how reliable or good Unity's Random.Range() for a uniform distribution? Because I will be using Unity's RNG for a game certification.
Answer by metalted · Jun 26, 2019 at 05:27 AM
It depends, Unity's random number generator is not really a generator, it generates a string of numbers and gives the user a new number from the string. A pseudo-random number generator. That's very useful for games when using seeds and stuff but I don't know if that's random enough when you are going to use it for a serious sciency approach.
As the Wikipedia about pseudorandom number generators / deterministic generators mentions: "Potential problems with deterministic generators: Lack of uniformity of distribution for large quantities of generated numbers;" (The page is probably written by a programmer, because some of the lines end with a ";" instead of a "." :P). So what I would do is generate a lot of numbers and check for yourself to see if it fits your needs. (https://en.wikipedia.org/wiki/Pseudorandom_number_generator)
Alright, as of now, I will generate a lot of numbers to test. While waiting for others to give their opinion on this.