0

I'm using a 1D Perlin Noise to generate a 2D terrain for my game. I'm currently looking for the best method to generate terrain with a fixed seed that should look always the same across different platforms/hardware. Currently I'm using Mersenne Twister but that give me different results on Windows Phone 8 than on Android / iOS ( as I mentioned in my last post: 1D Noise using Mersenne twister giving different results on different devices )

What I need is a number generator that produces always the same values between 0.0 and 1.0 when using same seed. A simple pseudo random or just a number generator giving me different results would be fine. The only thing that matters to me is that it has to produce the exact same output on every hardware/platform for a given seed.

Any help appreciated.

Community
  • 1
  • 1
  • `Currently I'm using Mersenne Twister but that give me different results on Windows Phone 8 than on Android / iOS` Which implementation? `std::mersenne_twister` is supposed to produce the same output on any platform. If it does not it is a compiler bug. – sbabbi May 12 '15 at 09:57
  • strange, a Mersenne twister should give the same output regardless of platform for the same seed... plenty of online casinos assume it will. You might try something more exotic like a Blowfish implementation which should be platform independent and well worked out. – joshstrike May 12 '15 at 09:59
  • Are you sure the difference is in the Mersenne twister and not in another step? Subtle differences in the treatment of floating point numbers may lead to the accumulation of small inaccuracies. Of course this can’t happen on platforms that correctly implement IEEE 754 but there are compiler flags to deliberately break compatibility for performance. – Konrad Rudolph May 12 '15 at 10:09
  • It is the distribution, not the generator, that tends to differ. Write your own distribution. – Yakk - Adam Nevraumont May 12 '15 at 11:24
  • @sbabbi you can see partial implementation at the link I posted – user3433660 May 14 '15 at 17:18
  • Assuming a correct Mersenne Twister implementation, the only factor that could produce possible disparities, besides compiler flags, is the endianness of processing units you are using. Have you yet tried to reverse bits order of your inputs / results to check ? –  Jun 13 '15 at 12:13

0 Answers0