2 ms·
Why not use RDRAND? Also you can always choose well-established, arbitrarily complex psuedo random algorithms. If you want to guarantee low correlation you co
by willis936 7y ago
Why not use RDRAND?
Also you can always choose well-established, arbitrarily complex psuedo random algorithms. If you want to guarantee low correlation you could use PRBS (whatever shift amount you need, 31 may be enough for most scenarios) with the same shift register values and seeds that are maximally equidistant.
- lvh 7y agoArticle mentions he wants to make the seed explicit so he can reproduce the same (randomly selected) environment. You can use any stream cipher you want instead, of course, but in my experience for video games the problem isn’t “I need a random bit” (which AES CTR is very good at but MT or any PCG/LCG is really just as fit for purpose) but “I need to sample from this weird distribution”. Stuff goes wrong as soon as someone needs to do something as simple as sampling from a set of cardinality not exactly a power of two let alone something more complex.