Dice Randomization in Riverboat Gambler

Of all the games I’ve added to Riverboat Gambler, Craps (and, later, Crapless Craps) is by far the one of which I am most proud.

It was originally requested by a long-time supporter, Bishop Bryan Oullette, who regularly challenged me to step outside of my comfort zone and add games that were not easy to code.

In all dice games, the die values are 100% random; at least as random as I can make them given the tools at my disposal. I honestly cannot speak to the impact that physics has on two (or three) dice that are rolled on a table. Does how a Shooter holds/stacks the dice influence the outcome? I don’t know. I also cannot reproduce that scenario in a mobile app.

In each dice game, a randomization process executes and it produces the random values for the dice before the dice start "rolling". Then, a cheesy animation sequence executes to "roll the dice" and ultimately display the values that were randomly generated before the animation sequence started.

After the animation, the real work occurs: RBG evaluates the wagers that were made and resolves those wagers based on the results of the dice.

For the folks "way in the back": this means that there is no relationship to how many wagers, which wagers, or how much you wager. The process is simple: generate random dice values, execute some animation to make the dice "roll", end the animation and ensure the dice display the previously generated values. Then, do the real heavy lifting and apply the rules of the game to pay winning wagers and forfeit losing wagers.

Recently, there has been a spike in the number of folks who are downloading Riverboat Gambler to play/practice Craps. That's very exciting and unexpected for me.

However, there has also been a spike in bad reviews that are specifically about the randomness of the dice. I've literally been accused of "rigging the dice to get people to spend money". I can't lie. Those types of comments really piss me off! 😡 But, given that these folks have been fair enough to leave constructive criticism, I highly doubt that they are malicious developers who are trying to disparage my brand and drive my rating down (they really try to do that! 😂). On the contrary, I think they are just honest people who are looking for a reliable Craps simulator and they have "concerns".

Whether or not their concerns are prejudiced by other apps that lean towards letting Players win is too complex to debate.

As I always have, I feel an obligation to try to make RBG better and to do my best to address those concerns. I am not infallible.

Craps/Crapless Craps Beta Program

While I personally believe that the current randomization routine is fair, I've sponsored a beta test that uses a different approach to generating random dice values. In this beta test, my goal is to work together with the Player Community to determine if an alternative way of generating random number will make people feel more comfortable with the app.

At the end of the day, my options are limited for generating random dice values between 1 and 6. Of course, if someone wants to send me a check for $75K-$150K to contract a cryptographic randomization expert in order to make this free app "perfect", I'll cash the check and find an expert!

For now, though, Danny forks over enough of his own money to support this free app that will likely never generate the billions of dollars in revenue that is generated by Candy Crush! 😀

Both Craps & Crapless Crap include a feature that tracks the history of ALL ROLLS (across ALL sessions) and uses those results to generate a histogram of those rolls. This histogram can be accessed from the "Roll History" option on the game menu by tapping the chart icon in the top right corner of the Roll History screen. The histogram will only be generated after at least 200 rolls have been completed.

When the histogram is reset, it is immediately seeded with the roll history for the current session. So, if you want a completely "virgin" histogram, reset it as soon as Craps or Crapless Craps is opened and BEFORE any rolls occur.

The expectation with the histogram is that, over time, the results will display a perfect Bell Curve where 7, the most common roll of two dice (with a probability of 16.67%), will be the middle/peak of the curve.

As part of the beta test, I have updated the histogram so that the graph bars are colored to denote deviations of 1%, 2%, 5%, and more than 5% of the expected outcomes for each potential roll value.

The Beta Program will be conducted in version 66.5.0. In this program, 80+ people have kindly volunteered to evaluate an alternate approach to randomizing the dice values. Folks who are participating in the Beta Test should see the following messages when they open Craps.

Additionally, the first time they open the app after installing the Beta Update, their existing histogram history will be cleared to ensure accuracy of reporting.

My Testing

In RBG, I have incorporated the ability to run a "Test Harness" on most games. The purpose of the test harness is to deal, spin, or roll up to 5,000 times in an attempt to "try to crash a game". I don't concern myself with the final outcome of the games, because no game is predetermined. The RBG game engine doesn't know whether the Player will win or the House will win until a game completes, the game rules are applied, and the hands are compared. The "Test Harness" feature is only useful when trying to determine if a series of dealt cards cannot be properly "read" because of a bug.

It's also valuable when testing Craps because I can automatically roll 5,000 times without having to stay glued to my phone or an emulator.

By combining the features of Dealer Assist (Preferences) and the test harness, I can roll the dice 5,000 times and evaluate the outcomes by reviewing the histogram. That is what I did in creating a potential replacement for the current randomization routine.

For me, it's a coin toss as to whether the legacy randomizer is less effective than the alternate one that will be evaluated in the Beta Test. If I'm being completely, transparent, the alternate randomizer "feels" a little better, but I'll fall back on "random is random" and the results are not starkly different. Human nature being what it is, someone will still complain. 😀

I will be deferring to the feedback I get from the beta test, though. Then, I will not be open to making any future changes to randomization unless there is a new feature released by the mobile device platforms. I have had plenty of people come back from Vegas to report that they were shocked by how accurate Riverboat Gambler truly is.

Below are some random screenshots of the histograms for the current (legacy) random dice algorithm and the potential replacement. Most notable for me is that, over time, both approaches normalize to what one would expect from two, six-sided dice.

I've also included screenshots from a couple of rolls that caught my eye while the simulations were running and I was quick enough to capture the screen.

Important Note: A few months ago, in response to a lot of input and support from long time supporter, Matthew, I unveiled a "Discord Server". This is basically a "chat room" for Players to interact about the app. It's a great place to share screenshots and discuss the app. You can find a link to the server on the home page.

Legacy Randomizer - 202 Rolls:
Legacy Randomizer - 506 Rolls:
Legacy Randomizer - 951 Rolls:
Legacy Randomizer - 4042 Rolls:
Legacy Randomizer - 4738 Rolls:
Legacy Randomizer - 18 Roll Run:
Legacy Randomizer - 45 Roll Run:
Alternate Randomizer - 201 Rolls:
Alternate Randomizer - 503 Rolls:
Alternate Randomizer - 960 Rolls:
Alternate Randomizer - 1426 Rolls:
Alternate Randomizer - 4125 Rolls:
Alternate Randomizer - Hit Make'em All:
Alternate Randomizer - 57 Roll Run: