Posted April 14, 2024 by Gumpy Function
New update to address a critical problem that was occurring in Dicee!
Story time!
So my wife has been playing Dicee! a lot. And every now and then she comes to me and says she is getting more 1s and 2s in her rolls relative to the other numbers on the d6 and the game is busted. I tell her, "Nah. No, no, it's random. Its picking a number from 1 to 6 at random each time the dice is rolled... You must be introducing some kind of bias." She rolls her eyes and keeps playing but eventually she becomes really quite convinced that the dice are not random and the odds are stacked against her. So she started recording what numbers she was getting per game. Here are her findings for one game:
1s = 43
2s = 34
3s = 17
4s = 15
5s = 13
6s = 13
Well, the data doesn't lie and although it's a small pool of 135 rolls, it suggested something was definitely happening here. If random isn't random, then I have a big problem on my hands. Some further testing needed to be done to get to the bottom of this if I was to make Dicee! actually enjoyable for my wife.
So I made a program to roll 1000 dice and display the results.
And here was a typical outcome. The probabilities in Dicee! were definitely broken! All of a sudden I could no longer trust that any RNG in a game I was making was actually random. Off to GBS Discord I go to figure out what is happening here.
After much back and forth and many heads smarter than I proposing reasons why randomly selecting a number from 1 to 6 in GBS can't give you an evenly distributed outcome despite you asking for a random selection anyway, we finally figured out how to resolve this issue. To make a long story short, because Game Boy and because math and because computer, randomly selecting a number from 1 to 8 and rerolling if 7 or 8, ended up giving me what I was looking for; a more or less even distribution of numbers across 1000 d6 rolls!
So, this is what I have learned and I think its important to know if you want to introduce RNG into your own games:
If you want to ensure you are getting an actual random value when using the set to random operation in GBS, make sure you set the range to a multiple of 8 or else!
That is the main take away from this. Well, that and also, listen to your wife.
Thanks to the generous folks in the GBS Discord for helping me resolve this issue.