I would very much like to have 2 different Random instances, one which poops out real-random (or the unity approach to that) and one of which I can set the seed to a given Integer, making it poop out the same sequence every game cycle.
What i tried: searching on google ofcourse.. but it qutie hard to formulate a question that is not ambigious.
I tried instantiating a Random object by var rnd = new Random() but this is just a new pointer to the Random instance which unity provides. (probably because it is a singleton or something like that)
I hope this is clear enough.
As for sample code with which I tested the outcome:
asked Sep 06 '11 at 08:18 AM
You could use the .NET framework System.Random instead; that will let you have distinct instances. It's still kind of a voodoo black box thing though, and you can't read the seed, or reseed it if you want to generate the exact same sequence of numbers again (for instance, if you want to save and reload the state of your random number generator).
Fortunately a linear congruential generator is not hard to implement yourself; it may be perfectly sufficient for throwaway random number generation that doesn't need to be particularly robust. See http://en.wikipedia.org/wiki/Linear_congruential_generator
edit: actually this is the wiki page I was thinking of- http://en.wikipedia.org/wiki/Lehmer_RNG