Reputation: 2657
I am trying to procedurally generate a multiplayer world for a game without having to store the world server-side. So, I need a source of random numbers that I can be sure is identical across different platforms when seeded with the same number. I've done some searching, and it seems that Java's built-in Random
class does not provide this guarantee.
Does MersenneTwister
in Commons Math provide this guarantee? The documentation does not specify, but I believe by definition the Mersenne Twister is deterministic, and thus any implementation of it will give the same sequence. I want to be sure my understanding is correct:
Can I rely on it to always give me the same sequence of pseudo-random numbers on different platforms when seeded with the same value?
In what scenarios could the sequence of numbers change (e.g. an update to the library that changes some specific thing)?
Upvotes: 1
Views: 41