I didn't trust the source RNG implementation when I came to EU4, but I did test it empirically, and it converged to the mean one would expect. IIRC there's a "testrng" console command remaining from that, though I'm unsure if output means anything without knowing context.
The source RNG generates a 31 bit positive random integer or alternatively a floating point number in the range [0, 1[. However, there's a possibility for the programmer to use generated numbers in an erroneous way due to lack of high level random variable shaping functions in Clausewitz. I've seen nothing of that in dice roll code though since that is utterly simple. e.g. die_roll = random31uint % 6 + 1; (lazy almost linear approximation of one die).
I think the bigger issue is the fact pure RNG is used which will sometimes be unfair by its very nature.
It would perhaps be cool to try something that adjusts the random variable's expected value to cancel out mean unbalanced series after some number of outcomes. Not my concern any more though, but I once read about some version of Civilization taking a similar intervention approach in battle outcomes to prevent players from feeling unlucky or feeling that the game cheats even though it doesn't. (Perhaps they simply reduced the probability of the really bad events for humans, can't recall.)
The source RNG generates a 31 bit positive random integer or alternatively a floating point number in the range [0, 1[. However, there's a possibility for the programmer to use generated numbers in an erroneous way due to lack of high level random variable shaping functions in Clausewitz. I've seen nothing of that in dice roll code though since that is utterly simple. e.g. die_roll = random31uint % 6 + 1; (lazy almost linear approximation of one die).
I think the bigger issue is the fact pure RNG is used which will sometimes be unfair by its very nature.
Last edited:
- 20
- 5