mercredi 14 août 2019

Why should I use number distribution?

I'm working on a mobile game, and I needed to create a possibility to play the same level in an absolutely same way. This sounded easy because I knew about a seed for a random generator, which should be the same for this purpose.

The problem arised later, when I used std::mt19937 together with std::uniform_int_distribution as it was in many tutorials. As it was noticed in another question here , random number distributions aren't consistent between platforms, while the engine is consistent (how can it be differenent, if it is based on a mathematical algorithm?).

I didn't pay much attention at this problem and just used std::mt19937 without a distribution.

Is it a correct way of usage, if there is no particular requirements on number distribution?




Aucun commentaire:

Enregistrer un commentaire