A small piece of tech for an ongoing project. This save generates one random integer per frame, but crucially, it can be seeded. If you need to replay a random sequence, you can just restore the previous RNG state..
subframe
random
psuedorandom
prng
Comments
-
@Jerehmia cool - you definitely beat me on size and sophistication. Do you know a good reference for how to calculate the periodicity for a given suite of shifts?
-
Nice, this is the same the same XorShift PRNG I implemented a while ago. I used shift constants A(11, 3, 13) which result in a 2^30-1 period generator, check id:2861441
-
Do you mind if I use this for an RPG style thing?