ZeroZero wrote:Lol I don't think the MT is overkill for todays computers, not for any game. On my machine I create more than a million MT rnds per second (for 32-bit MT), and the memory used is only a few kB.
Sure, you can do that on modern hardware. What I mean with overkill: you don't really need the stochastic properties and the resulting complexity of MT in any game. You would use MT in simulations, where using RNGs with shorter periods would give wrong results due to spurious correlations in the generated RNs. In a game it just matters that it looks right and that it feels right, and nobody would ever notice the difference, whether you used MT or a simple LCG. So, if I needed to program a game and I had MT in a library I would just use it; however, if I had to implement the RNG myself, I would not bother with MT, and just code a simple LCG.
ZeroZero wrote:Since it has a very "natural" distribution of rnds I think it is one of the best pseudo RNGs available for any purpose. Only alternative could be
a hardware white noise generator, which really would mean overkill, but otoh gave REAL random numbers.
MT is good, but I would doubt that "for any purpose". E.g. cryptographic applications have different needs on RNGs, especially as prectitability is concerned. For creating real numbers also different methods exist, since e.g. scaling integer valued RNs to [0,1] usually results in a not optimal distributions around 0 (see e.g. the RNG used in matlab).
See also this post (
http://groups.google.com/group/comp.lan ... 0a4424068/) from George Marsaglia:
The Mersenne Twister (check Google) is an excellent RNG, with k=624. But it requires an elaborate C program and is slower than many RNGs that do as well in tests, have comparable or longer periods and require only a few lines of code.