Backgammon and other random number games
Isobel DeSantis
All backgammon sets at various times produce far too many double throws, 3 to 4 times more than average and successively. The average should of course be one double every 6 throws but we're seeing many more than that. It's not uncommon for us both to throw the same double three or four times in a row. We've tried it with many different sets using different scripts. What we have found is that when we play on a very low lag region such as Debug 2, the problem doesn't appear at all. It would seem that the random number generator is not resetting itself quickly enough between die 1 and 2 or even between throws, so that it simply returns the previous value when called from most regions. I suspect this must affect more than backgammon.
Log In
Lucia Nightfire
misstoriblack Resident
I assume when you say backgammon, you mean the randomness in the dices. So I made a script to test it.
default {
touch_start(integer number) {
llOwnerSay("Start");
integer totalRolls = 100000;
list stats = [0, 0, 0, 0, 0, 0];
integer doubles = 0;
integer prevRoll = -1;
integer i;
for (i = 0; i < totalRolls; i++) {
if (i % 2000 == 0) {
llOwnerSay(string(i));
}
integer roll = (integer)llFrand(6);
stats[roll] = integer(stats[roll]) + 1;
if (prevRoll == -1) {
prevRoll = roll;
} else {
if (roll == prevRoll) {
doubles++;
}
prevRoll = -1;
}
}
llOwnerSay("Stats : " + llDumpList2String(stats, ", "));
llOwnerSay("Doubles : " + string(doubles) + " [" + string((float(doubles) / (totalRolls / 2)) * 100) + "%]");
// In that last line, we divide by 2 cause we consume 2 rolls for each comparation.
}
}
The theoretical amount of double rolls is 1/6 (16.66666%) as pointed out in this article https://www.statology.org/probability-of-rolling-doubles/
After running it several times on several sim, here are the results
Sim 1 (mainland no lag) (time dilation 0.999)
[07:42] Dice Tester: Stats : 16819, 16530, 16438, 16891, 16734, 16588
[07:42] Dice Tester: Doubles : 8275 [16.550000%]
Sim 2 (Homestead with low lag) (time dilation 0.998)
[07:47] Dice Tester: Stats : 16735, 16723, 16778, 16554, 16626, 16584
[07:47] Dice Tester: Doubles : 8336 [16.672000%]
Sim 2 (Fullsim with lag) (time dilation 0.950 with spike down to 0.400-ish, was VERY slow to complete, it took more than 5 minutes vs a few seconds on the previous ones)
[07:57] Dice Tester: Stats : 16651, 16726, 16756, 16536, 16640, 16691
[07:57] Dice Tester: Doubles : 8361 [16.722000%]
So with this script, I was not able to see any statistical discrepancies... Feel free to use it to test the randomness.
The only question remaining is more : How are you generating your value for the dice ?
Isobel DeSantis
misstoriblack Resident thank you so much for that. I'm a backgammon player not a creator, and I've used 3 or 4 different sets costing from 250L$ to 5000L$ and they all exhibit the same behaviour eventually. I don't know how the values are being generated but I assumed some kind of random number script like yours. We've played several games on different sims, counting each throw and the number of times doubles appeared, and in every case it's been more than 1:6. The last game we tested was on Debug 2 and from 35 throws, 10 were doubles and several of them were consecutive.
misstoriblack Resident
Isobel DeSantis Hi there, on 35 throws I would expected around 6 to be doubles. However with such a "small sample" it's kinda difficult to say.
Could be a bit of a pain in the butt but maybe sampling a few games for a few hundreds rolls would make it statistically more relevant. I'll check if I can get one and try it.