OpenXcom Forum

Contributions => Programming => Topic started by: Ninawindia on April 18, 2019, 02:12:31 pm

Title: RNG innerworkings?
Post by: Ninawindia on April 18, 2019, 02:12:31 pm
Hi, figured this might be the best place to ask. Anyone know how the rng works? As doing certain actions leads to certain things and I'm just genuinely curious as to how this works out/ how they worked it out.
Title: Re: RNG innerworkings?
Post by: Meridian on April 18, 2019, 04:26:30 pm
The RNG is just a pseudo-RNG (https://en.wikipedia.org/wiki/Pseudorandom_number_generator)... which means that exactly the same actions on the same starting point will lead to the same results.
But as soon as you have a tiny little difference in actions or starting point somewhere, the result can be completely different.
Title: Re: RNG innerworkings?
Post by: Yankes on April 18, 2019, 05:14:38 pm
For comparison: https://www.youtube.com/watch?v=pq3x1Jy8pYM
Only caveat is that doom RNG have cycle length of 255 and OXCE have cycle length around millions.
From implementation perspective they are different but from mathematic perspective they are same.