Roll20 Blog

Data Delve Dev Blog #1: Introducing QuantumRoll

Written by The Roll20 Team | Mar 25, 2014 7:00:00 AM

In case you missed our announcement email, we’ve named our upcoming Spring Update “Data Delve.” Data Delve will launch in early May and will introduce improved dice rolls, character sheets, and more. We’re previewing the new features on the blog in the weeks leading up to release. Here’s the first post!

Nearly every game that’s played on Roll20 relies heavily on some form of chance. Chance is what allows games to be exciting, non-determined, and different every time they’re played. It also introduces an aspect of “luck” that many players love to take advantage of (or curse, depending on the night).

The element which introduces that chance are dice rolls. Whether you’re rolling a single twenty-sided dice or a whole handful of d6’s, dice allow you to quickly make a decision, determine an outcome, or even create a whole character. One of the largest advantages of a digital tabletop like Roll20 is that it can drastically speed up these rolls. Through saved macros, attributes used as variables, and the quick-adding capability of your computer, you can roll large numbers of dice quickly and easily, instantly seeing the result.

One of the largest disadvantages, however, and one of the toughest challenges faced by program designers, is making sure that the results of those dice rolls are as random as possible. We’re held to a higher bar than physical dice by far. Nearly all dice will have physical imperfections which cause them to not be perfectly random. However, the physical feeling of holding a dice in your hands and knowing that it’s “your roll,” although probably making rolls *less* random in reality, give players a feeling of ownership and fairness that is hard to replicate in the digital realm.

We’ve tackled this issue before in Roll20, even going so far as to roll trillions of dice through our existing random-number generator to make sure that it was fair and as random as possible. However, at the end of the day we were still using a “pseudo-random number generator” (or PRNG for short), which is what nearly all computer programs use. You can scientifically prove that it appears random, but at the end of the day it’s still just fancy math faking unpredictable results.

We went back to the drawing board and asked ourselves – what can we do to put this issue to rest on Roll20 forever? And we think we’ve found the answer.

Today we’re pleased to introduce QuantumRoll, our new dice engine designed to address any lingering doubts you might have about Roll20’s dice rolls, with a better source of entropy and a real-time look into community-wide roll results.

A Better Source of Entropy

Computer RNGs all require a source of entropy. The entropy is the lynchpin of the whole system – if it’s really random, then you get random results. If it can be predicted or it’s not really random, then the results you get aren’t really random, either.

QuantumRoll uses entropy generated by fluctuations in the power of a split beam of light. More details from the scientists who invented this process:

Researchers at the ANU are generating true random numbers from a physical quantum source. We do this by splitting a beam of light into two beams and then measuring the power in each beam. Because light is quantised, the light intensity in each beam fluctuates about the mean. Those fluctuations, due ultimately to the quantum vacuum, can be converted into a source of random numbers.

https://photonics.anu.edu.au/qoptics/Research/qrng.php

Suffice it to say, this is as random of a source of information as we know how to make. There is no known way to predict the data generated by this entropy source, which makes it perfect for generating random numbers.

So, we take random data generated by these researchers in real-time, and then we use that to power the RNG which produces the results of our dice rolls on Roll20. This is overkill, to say the least, but you can now rest assured that Roll20 rolls are as random as humanly possible.

See It In Action

In addition to using this new source of randomness, we also wanted to give the community better insight into how the random number generator is actually performing in real-time. So you can see, for example, that when you’re having a bad night, it doesn’t mean the system is broken, because there are other folks who are rolling all those 20’s you wish you were getting.

Here’s a preview of what this status page will look like:

It shows you the last 2 hours worth of rolls, plotted. How often each number has been rolled, what the average roll is (should be close to 10.5), and even a little listing of people’s rolls in real-time (although it won’t show you the rolls of anyone you play with to prevent you from seeing a roll you shouldn’t see in-game).

We’ve rolled out the new QuantumRoll engine on the Dev Server today, so our Mentor subscribers can start testing it with their macros right away and help us spot any issues we might have overlooked. QuantumRoll will be available to everyone when the Data Delve update goes live in May.