RolePlay onLine RPoL Logo

, welcome to Technical Discussions

10:42, 19th April 2024 (GMT+0)

Dice roller has a problem.

Posted by Rathmun
Rathmun
member, 7 posts
Sun 30 Jan 2022
at 22:31
  • msg #1

Dice roller has a problem.

So, in a shadowrun game, I just had reason to roll a great many dice.  (Breaking through a barrier while rolling for both sides, if anyone's curious.  306 total dice, d6's, target number of 5.  Across that 306 total dice, I had 71 successes.

This is 3.76 standard deviations low.


Going back and collecting the data from every roll I can see in that game including other players, it's 845 dice with 248 hits.  The mean is 281, the standard deviation is 13.7.  The game as a whole is 2.4 standard deviations low.


What is wrong with the dice roller?  This entire site depends on that thing working correctly!
This message was last edited by the user at 22:50, Sun 30 Jan 2022.
Hunter
member, 1719 posts
Captain Oblivious!
Lurker
Sun 30 Jan 2022
at 22:46
  • msg #2

Dice roller has a problem.

That's more or less how it's always been.   Which is why I tend to let my players do some variation on "Taking 10" or "Buying Hits" outside of combat.
jaberwok
member, 220 posts
Twas brillig & the slithy
toves did gyre and gimbal
Sun 30 Jan 2022
at 22:56
  • msg #3

Dice roller has a problem.

In reply to Rathmun (msg # 1):

I would be curious to know how you calculated that this result is -3.76 sigma?
Rathmun
member, 8 posts
Sun 30 Jan 2022
at 23:20
  • msg #4

Dice roller has a problem.

jaberwok:
In reply to Rathmun (msg # 1):

I would be curious to know how you calculated that this result is -3.76 sigma?



Wolfram alpha
"Binomial distribution, p=0.333333, n=306"

Results
mean102.
standard deviation8.24621
variance68
skewness0.0404227
kurtosis2.9951

102(mean)-71(actual)=31
31/8.24621=3.759

I rounded from 3.759 to 3.76.

I used the same method to calculate that the game as a whole is 2.4 sigma low.
This message was last edited by the user at 23:24, Sun 30 Jan 2022.
Harley Quinn
member, 186 posts
Sun 30 Jan 2022
at 23:20
  • msg #5

Re: Dice roller has a problem.

Rathmun:
This entire site depends on that thing working correctly!

No it doesn't.
Rathmun
member, 9 posts
Sun 30 Jan 2022
at 23:22
  • msg #6

Re: Dice roller has a problem.

Harley Quinn:
Rathmun:
This entire site depends on that thing working correctly!

No it doesn't.

Oh, sorry, large portions of this site depend on having fair dice.  You're right, games that don't actually use dice don't need it to work, just the games that actually roll them.
This message was last edited by the user at 23:22, Sun 30 Jan 2022.
Carakav
member, 691 posts
Sure-footed paragon
of forthright dude.
Sun 30 Jan 2022
at 23:31
  • msg #7

Re: Dice roller has a problem.

I know there's always been the joke that the dice roller hates us, but I've been playing a Tunnels and Trolls game recently, and the bias has felt particularly real in that game. I've been tracking the dice results, and there's definitely been a pattern revealing over time... though I haven't really done the math on it. Could still just be 'luck'.
Gaffer
member, 1720 posts
Ocoee FL
45 yrs of RPGs
Sun 30 Jan 2022
at 23:37
  • msg #8

Re: Dice roller has a problem.

IMO the dice roller doesn’t need to be 100% “correct”. It needs to roll the same for everyone; it needs to be “fair”.
Carakav
member, 692 posts
Sure-footed paragon
of forthright dude.
Sun 30 Jan 2022
at 23:41
  • msg #9

Re: Dice roller has a problem.

Some dice systems require hard-coded results though to acheive a pass or fail state. So for some games, having a biased system can result in more failures or successes than, say, a module or dungeon was designed for.

Sometimes the DM needs to be able to predict outcomes, or else the game could be easier or harder than intended... or worse: players could get frustrated or demoralized when they fail more often than they should.
donsr
member, 2502 posts
Sun 30 Jan 2022
at 23:42
  • msg #10

Re: Dice roller has a problem.

its sorta funny..i mean..dice rolls are what they are..machine or hand rolled.

 I one of my games, a Player had to roll 1d4...failed  almost everytiem, but when i rolled, (dm) Imade it almost every time.

I use 1d100 most of the time in my games..I have  Mod  that either   get added or subtracted from your  roll..or? I use that Mod  to set the  roll you need .

 i mix whther you have to roll high or  low, through the game... I haven't seen anyhtign overly stacked? 1's  come up as  many times  as 100...
Harley Quinn
member, 187 posts
Sun 30 Jan 2022
at 23:42
  • msg #11

Re: Dice roller has a problem.

Gaffer:
IMO the dice roller doesn’t need to be 100% “correct”.
How can a dice roller be correct?
Dream Sequence
member, 74 posts
Certainly the loveliest,
most civilized of us all
Sun 30 Jan 2022
at 23:53
  • msg #12

Re: Dice roller has a problem.

In reply to Harley Quinn (msg # 11):

By reasonably approximating true randomness.
Rathmun
member, 10 posts
Mon 31 Jan 2022
at 00:00
  • msg #13

Re: Dice roller has a problem.

Harley Quinn:
Gaffer:
IMO the dice roller doesn’t need to be 100% “correct”.
How can a dice roller be correct?

It can produce results that aren't horribly skewed.  That's how.

If you have outliers here and there, that's fine, but when the entire course of a game has literally everyone rolling substantially lower than they should, it's a problem.

Shadowrun has glitches and critical glitches as part of the system.  If you roll zero successes, something goes a little wrong.  If you roll no successes and at least half 1's, they go very wrong.  Having a dice roller that rolls low means that players will be getting critical glitches more than they should on unopposed rolls.


NPC's don't usually make unopposed rolls.  Sure, it's fair in a fight if everyone rolls low, but outside a fight, the game system is designed with the assumption that people will get a certain number of hits on average.  If the lock requires 5 hits to open, someone with 12 dice should get that a little less than half the time.  But if the dice are weighted such that the average is actually three hits instead of four, that door that's supposed to delay the players a couple turns can end up delaying them a dozen turns instead.

TLDR: A dice roller that rolls badly for everyone is fine, as long as everyone is rolling.  And by "everyone" there, I mean including the inanimate objects.  Oh, and also the random piece of trivia your wizard might have heard in class once.  That needs to roll vs. being remembered too.  Can't have a fixed difficulty to remember things if the dice are skewed.

Edit: Another example.  Say you have a character in D&D who is a spellcaster with a high AC, however they got that.  The caster isn't rolling to attack, they just cast a spell, and the enemy has to roll to avoid the spell.  The caster is also not rolling to avoid getting hit, the enemy has to roll to hit them.  If the dice are rolling low for everyone, that caster gains an advantage.  Enemies are less likely to make their saves, AND less likely to hit them.
This message was last edited by the user at 00:06, Mon 31 Jan 2022.
tmagann
member, 760 posts
Mon 31 Jan 2022
at 00:01
  • msg #14

Re: Dice roller has a problem.

Harley Quinn:
Gaffer:
IMO the dice roller doesn’t need to be 100% “correct”.
How can a dice roller be correct?


The odds on the results of rolls match the actual results on the rolls over a sufficiently large sample.

Statistics, in other words, should bear out. Roll a pair of d6 36 times, you may not get an exact breakdown. You probably will if you roll 3600 times, and certainly should if you  roll 36000 times. Being 1 or 2% off is one thing(and could happen randomly, although less often the larger the sample size), but being 33% off is an issue. And an "incorrect" die roller.

The number 36, in this case, are the total number of combinations of 2d6
2 & 12: 1 time each
3 & 11: 2 times each
4 & 10: 3 times each
5 & 9: 4 times each
6 & 8: 5 times each
7: 6 times
Dream Sequence
member, 75 posts
Certainly the loveliest,
most civilized of us all
Mon 31 Jan 2022
at 00:03
  • msg #15

Re: Dice roller has a problem.

Rathmun:
TLDR: A dice roller that rolls badly for everyone is fine, as long as everyone is rolling.  And by "everyone" there, I mean including the inanimate objects.

Agreed, or even imagine something like Cypher System, where all the dice are player-facing.  If PC swings at a monster, the player rolls to hit; if the monster swings at a PC, the player rolls to dodge.  A skewed dice roller horribly upsets the game balance.
jaberwok
member, 221 posts
Twas brillig & the slithy
toves did gyre and gimbal
Mon 31 Jan 2022
at 00:07
  • msg #16

Dice roller has a problem.

In reply to Rathmun (msg # 4):

Interesting. I approached this from a different direction -- using the Shadowrun 4th Edition roller, I rolled 27d6 vs a target of 5, 25 times, and got:

9, 6, 9, 7, 7, 10, 7, 7, 9, 5, 7, 8, 11, 10, 9, 5, 9, 8, 10, 9, 5, 6, 8, 5, 9

which, quite frankly, is kind of weird. There are far more odd numbers here than I'd normally expect, and far fewer even numbers. I'd expect that I should have gotten 9 exactly approximately 4x times, but in this distribution it came up 7x. In addition, the distribution is skewed low, as OP noted -- the average is less than 8.
Rathmun
member, 11 posts
Mon 31 Jan 2022
at 00:13
  • msg #17

Re: Dice roller has a problem.

jaberwok:
In reply to Rathmun (msg # 4):

Interesting. I approached this from a different direction -- using the Shadowrun 4th Edition roller, I rolled 27d6 vs a target of 5, 25 times, and got:

9, 6, 9, 7, 7, 10, 7, 7, 9, 5, 7, 8, 11, 10, 9, 5, 9, 8, 10, 9, 5, 6, 8, 5, 9

which, quite frankly, is kind of weird. In addition, the distribution is skewed low, as OP noted -- the average is less than 8.

Your sample is 195 hits on 675 dice.  According to Wolfram Alpha

mean225
standard devaition12.2474

225-195=30
30/12.2474=2.445 sigma below the mean.  This is way low too.
nauthiz
subscriber, 750 posts
Mon 31 Jan 2022
at 00:13
  • msg #18

Dice roller has a problem.

There's an analysis page for the roller if anyone is interested.


/info.cgi?action=analysedice

Which was originally linked in this thread by Jase.

link to a message in this forum
Rathmun
member, 12 posts
Mon 31 Jan 2022
at 00:25
  • msg #19

Re: Dice roller has a problem.

nauthiz:
There's an analysis page for the roller if anyone is interested.


/info.cgi?action=analysedice

Which was originally linked in this thread by Jase.

link to a message in this forum


So, that data looks like it's just an analysis of the actual prng at the heart of the generator.  But that's not the only place a problem can exist with a computer dice roller.  They can also creep in through the way the prng output is converted to dice rolls can have significant problems.


Just as an example, if you had a perfectly random number generator, which output a single byte at a time, that's 256 values. 0-255 if you're unisgned, -128-+127 if it's signed.

let's assume it's unsigned, and that the way it's calculating 1d6 is rand%6+1 (modulo will produce 0-5, and we want 1-6)  Well, there's a problem right away.  6 doesn't divide evenly into 255, 42*6=252, so 253, 254, and 255 produce biased data.  You're going to have slightly more 1's, 2's, and 3's than you should.  Not that much, but a bit, and that's if you're using a full 8 bits of your prng for the number.  If you try to get efficient things get worse.


If you have 8 bits of entropy, you might be tempted to try to get more than one d6 out of it.  after all, every value of a d6 fits in three bits, so you could get 2d6 out of one byte of random data.  Except that 3 bits gets you 0-7, so the 0-5 you're trying to randomize has a couple values hanging off the end.  If you try to use modulo arithmetic to wrap those back around, what you get is a d6 that rolls a 1 or a 2 literally half the time.  That would be worse than the results we're seeing, so that's probably not what's happening, but it's demonstrative of the problems that can happen.


So even if the site has a perfect prng at the heart of the dice roller, the actual result could be horribly skewed depending on how the prng output gets turned into dice.
This message was last edited by the user at 00:32, Mon 31 Jan 2022.
Greymist
member, 19 posts
Mon 31 Jan 2022
at 00:31
  • msg #20

Re: Dice roller has a problem.

I started tracking d20 rolls for several of my D&D characters as I felt that dice roller was rolling low.

So far, 241 rolls, average is 9.85, expected average is 10.5.

Not at all scientific, and a small sample size, but it certainly reflects the luck of many of my characters!
Rathmun
member, 13 posts
Mon 31 Jan 2022
at 00:43
  • msg #21

Re: Dice roller has a problem.

Rathmun:
That would be worse than the results we're seeing, so that's probably not what's happening, but it's demonstrative of the problems that can happen.


Actually, if you used 4 bits, a half-byte, for a d6, you'd get 1-6 twice, and then 1-4.  With hits being limited to 5&6, that means you'd have an average of 4 hits every 16 dice instead of the 5.33 that you should.  That gives you p=0.25.  How far off is Jaberwok's example if we use that value?

Binomial distribution, p=0.25, n=675

mean168.75
standard deviation11.25
variance126.563
skewness0.0444444
kurtosis2.99901

So, with a mean of 168.75, and a standard deviation of 11.25, his 675 dice roll example with 195 hits...  Would be 2.33 stddev high.  So...  Whatever is going on behind the scenes isn't using 4 bits for a d6, that would be much worse than what we're seeing.

5 bits would be 10 hits on 32 dice, or p=0.3125, with a mean of 210 and a deviation of 12.0424.

mean168.75
standard deviation11.25
variance126.563
skewness0.0444444
kurtosis2.99901

210-195=15, that's only a little more than one sigma away from the mean, which is easily within the realm of chance.  So a 5-bit conversion would produce results in-line with what we're seeing.  Is that what's happening?  I don't know, I don't have the source code.  But the results it would produce fit with observed behavior.
This message was last edited by the user at 00:46, Mon 31 Jan 2022.
evileeyore
member, 643 posts
GURPS GM and Player
Joined 20150819
Mon 31 Jan 2022
at 01:49
  • msg #22

Dice roller has a problem.

I experimented with it once as I spent a year never seeing a "crit" result int he GURPS games I was in.  So I rolled over 10,000 times (which is way easier with a dice roller than by hand).  I discovered the overall result was slightly biased in higher rolls than lower rolls (which for GURPS means a tendency towards failure on skill rolls, better results for non-skill rolls, like damage and Reaction Rolls).

But the difference was just under 1% for how often the roller rolled 9-11, however it began to deviate more the closer to the extremes, up to about 5% difference (less) at the 3-5 and 16-18 results (rolling 3d6).  So I shrugged and carried on, as the statistical differences were so low as to be meaningless.

And I've been in a number of Free Leagues games which require a roll of 6 on a d6 for success and never noticed any particular irregularity (outside of the standard "oddity" of rolling whole bunches of 5s or 2s, but overall we were getting the "statistically required" number of successes and critical failures).

I suspect that if you roll a statistically significant number of dice (upper thousands of rolls) you'll see your "deviation" shrink.
Rathmun
member, 14 posts
Mon 31 Jan 2022
at 03:01
  • msg #23

Re: Dice roller has a problem.

evileeyore:
I suspect that if you roll a statistically significant number of dice (upper thousands of rolls) you'll see your "deviation" shrink.

The problem with this sort of thinking is that it's still suceptable to streaky RNG.

If you have a coin that flips heads 100x in a row, followed by tails 100x in a row, and just repeats that pattern forever, I'd hardly call it a fair coin.  But if you flip it a million times, you'll still end up with 500000 heads and 500000 tails.
evileeyore
member, 644 posts
GURPS GM and Player
Joined 20150819
Mon 31 Jan 2022
at 04:25
  • msg #24

Dice roller has a problem.

Rathmun:
The problem with this sort of thinking is that it's still suceptable to streaky RNG.

Granted, however as the results can be recorded, that can be watched for.
Sign In