Random question

I wonder does the vassal die roller use the same fundamental random number generator as the bean shell maths random method, such as this 1d6 example from the wiki on this site…

((int)Math.floor(Math.random() * 6) + 1) will return a random number between 1 and 6.


Yes, they all used the stock standard Java random number generator that every other Java program in existence uses, as does the new Beanshell Random(6) function that supersedes that example you quote.

Not the standard Java RNG but the stronger, the better one of the several standard Java RNGs, this guy here: docs.oracle.com/en/java/javase/ … andom.html, the “no seed” variant of it.

Thanks. I have been using Random() in place of the die roller.

You can trust Vassal on this.

The worst I’ve seen was a module that used its own die roller which was seeded with a hardcoded, constant seed, i.e. each new Vassal session would roll the exact same sequence of dice results.

There’s scientific papers written about the human perception bias of randomness, our brains are just not built to understand this stuff and we always feel something is wrong and that there are patterns, especially if the rolls are not in our favor.

I agree. The reason behind my question was so that I can answer anyone who wonders about changing from Dice to Random(). Also, I wrote a small test module to do 500 1d6 rolls at a time and keep running totals between rolls, for the next time someone wants to question Vassal’s dice.