nauthiz
 subscriber, 750 posts
Mon 31 Jan 2022
at 00:13
Dice roller has a problem.
There's an analysis page for the roller if anyone is interested.


https://rpol.net/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
Re: Dice roller has a problem.
nauthiz:
There's an analysis page for the roller if anyone is interested.


https://rpol.net/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.

Greymist
 member, 19 posts
Mon 31 Jan 2022
at 00:31
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
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.

evileeyore
 member, 643 posts
 GURPS GM and Player
 Joined 20150819
Mon 31 Jan 2022
at 01:49
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
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
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.
Gaffer
 member, 1721 posts
 Ocoee FL
 45 yrs of RPGs
Mon 31 Jan 2022
at 04:26
Re: Dice roller has a problem.
So what can a GM do about this?

Just use the dice roller, faults and all.
Use the dice roller and figure some way to adjust for its flaws.
GM and players use some other online dice roller and report their results.
GM and players roll real dice at home and report their results.
Find a site with a more precise dice roller and play there.

Did I miss any possibilities?
Rathmun
 member, 15 posts
Mon 31 Jan 2022
at 04:32
Re: Dice roller has a problem.
Gaffer:
Did I miss any possibilities?

Bring it to the dev's attention with a thread like this?  :)


evileeyore:
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.

I do believe that's exactly what Jaberwok and I did.  We noticed a streak of low rolling in two different games, and have reported it.

This message was last edited by the user at 04:33, Mon 31 Jan.

Skald
 moderator, 957 posts
 Whatever it is,
 I'm against it
Mon 31 Jan 2022
at 06:11
Re: Dice roller has a problem.
Oooooh I used to hate probability at school/uni.  Give me algebra any old day.  OR Sir Terry Pratchett's "million to one shots come up nine times out of ten" ! <grins>

Rathmun - I had a quick look at the die roller for the game in question ...

Looking at your later test samples ... if my maths (aided and abetted by Excel's convert text to columns functionality) is right, then:

a) your 20 x 100D6 rolls was 2000 rolls for 664 successes, and you'd expect 667 (5 or 6 comes up on 1D6 2 in 6 = 1 in 3 times)
b) your 41 x 10D6 rolls was 410 rolls for 148 successes, and you'd expect 137

And I ran a quick test in one of my own games, just for the fun of it:

c) my 10 x 100D6 rolls was 1000 rolls for 331 successes, and you'd expect 333

Those look close enough to the expected results to me ... with your earlier mileage less (admittedly quite a bit less) than expected successes, perhaps the Dice Gods had turned their faces from you (and the rest of your team) ?   :P

I look on it more as a confirmation of the laws of probability - sure if you toss a coin 100 times you should get roughly equal heads and tails, but in theory you can get 100 heads and 0 tails.   Similarly the odds of someone winning the jackpot in the lottery should be so low as to never come up during their lifetime ... but people do win it or so I'm told.    By the same token - it is possible to get a run of low, or high, random rolls.

Though I'll bow to the wisdom of those who know more about the mathematics of probability than I.   :>
NowhereMan
 member, 469 posts
Mon 31 Jan 2022
at 06:16
Re: Dice roller has a problem.
These are true gamers all right. Have a run of bad luck? Blame the (virtual) dice! ;)
Rathmun
 member, 16 posts
Mon 31 Jan 2022
at 06:26
Re: Dice roller has a problem.
Skald:
Oooooh I used to hate probability at school/uni.  Give me algebra any old day.  OR Sir Terry Pratchett's "million to one shots come up nine times out of ten" ! <grins>

Rathmun - I had a quick look at the die roller for the game in question ...

Looking at your later test samples ... if my maths (aided and abetted by Excel's convert text to columns functionality) is right, then:

a) your 20 x 100D6 rolls was 2000 rolls for 664 successes, and you'd expect 667 (5 or 6 comes up on 1D6 2 in 6 = 1 in 3 times)
b) your 41 x 10D6 rolls was 410 rolls for 148 successes, and you'd expect 137

And I ran a quick test in one of my own games, just for the fun of it:

c) my 10 x 100D6 rolls was 1000 rolls for 331 successes, and you'd expect 333

Those look close enough to the expected results to me ... with your earlier mileage less (admittedly quite a bit less) than expected successes, perhaps the Dice Gods had turned their faces from you (and the rest of your team) ?   :P

I look on it more as a confirmation of the laws of probability - sure if you toss a coin 100 times you should get roughly equal heads and tails, but in theory you can get 100 heads and 0 tails.   Similarly the odds of someone winning the jackpot in the lottery should be so low as to never come up during their lifetime ... but people do win it or so I'm told.    By the same token - it is possible to get a run of low, or high, random rolls.

Though I'll bow to the wisdom of those who know more about the mathematics of probability than I.   :>


Thank you for moving this to the correct location.

I did note that on the later rolls as well.  But that does still leave a rather streaky dice roller.  3.76 sigma low for 300 dice is a streak so bad you wouldn't expect to see it more than once in 30,000,000 rolls.  So there's a lot more dice to roll before we can show that a streak that bad is not indicative of a problem.  A couple dozen million more dice in fact..  And we can't just clump those all together, we need them recorded so that we can take the average of a sliding window to see how far away from normal it is at any point along that 30 million rolls.

In the long term the roller might average out to normal, but as noted before, it needs to not wander wildly off into the weeds along the way either.



NowhereMan:
These are true gamers all right. Have a run of bad luck? Blame the (virtual) dice! ;)

Actually, the set of rolls that really slapped me in the face, I was rolling for both sides.  I was trying to break through a wall, and the GM had me rolling the wall's damage resistance too.  So bad luck for the wall was good luck for me.  From that perspective it's both good and bad luck taken to extremes.

This message was last edited by the user at 06:50, Mon 31 Jan.

Westwind
 member, 88 posts
 "[Sad] is happy for deep
 people" - Sally Sparrow
Thu 3 Feb 2022
at 13:08
Re: Dice roller has a problem.
I'm assuming that the person doing the "fairness calculation" for any game is also the game owner / DM. Otherwise one runs into the complications of fudged and hidden rolls skewing the results.

What is more important in my mind, though, is whether the deviation changes significantly depending on who is rolling. As long as everyone is playing with roughly the same deviations, given a large enough sample set, then the dice roller is fair.

Don't sacrifice the good while searching for perfect.
SunRuanEr
 subscriber, 437 posts
Thu 3 Feb 2022
at 13:13
Re: Dice roller has a problem.
Westwind:
What is more important in my mind, though, is whether the deviation changes significantly depending on who is rolling. As long as everyone is playing with roughly the same deviations, given a large enough sample set, then the dice roller is fair.

Don't sacrifice the good while searching for perfect.

This is pretty much my take.

The problem with anything involving 'probability' is that it's not perfect. It can't be perfect, because there's always chance involved. Sure, you can say what a roll set *SHOULD* be, or what the average of a set of rolls *SHOULD* be, or whatever...but that doesn't mean it's what it *IS*. It doesn't even mean the dieroller isn't working right. It just means that on those rolls, chance was involved.

...which is the one *SHOULD* that we can count on. =)
Carakav
 member, 693 posts
 Sure-footed paragon
 of forthright dude.
Thu 3 Feb 2022
at 13:28
Re: Dice roller has a problem.
Or if the probability shifts by die-type, which can impact specific players depending on character builds they might favor.
Rathmun
 member, 17 posts
Thu 3 Feb 2022
at 19:01
Re: Dice roller has a problem.
Westwind:
then the dice roller is fair.

No.  No it is not.

Let's take the most common system, the one everyone probably knows, even if they've only played it once, D&D.

in combat a skewed dice roller can be fair only as long as there are no spellcasters.  Because a spellcaster often makes other people do all the rolling.  After all, you roll to save vs their spells, and you roll to hit them.  They don't roll for either of those.  If the dice roller trends high, the spellcaster is at a disadvantage, because people are more likely to hit them and more likely to make their saves.  If the dice roller trends low, they get an advantage, for exactly the inverse reason.  People fail their saves and miss their attacks more often than they should.

Or take the Cypher system that someone else pointed out above.  The players do all the rolling, players roll to hit their enemies, and they roll to avoid getting hit by them.  If the dice roll high, the players have an advantage, if they roll low, they're at a disadvantage.


There are math tricks you can do with something like an unfair coin to get a fair result, paired flips for example, even if you have a coin that gets heads 90% of the time, that means that for independent pairs of flips you have heads-heads being 81%, tails-tails being 1%, heads-tails being 9%, and tails-heads being 9%.  With that knowledge you can get a fair flip, though you do have to make sure they're independent pairs, because heads-heads-tails is going to be far more common than tails-tails-heads.  HOWEVER, you can't do that with a computerized dice roller.  There may be tricks with physical dice, but the weighting of a physical die can't change from roll to roll.  With a PRNG that's streaky, it can.
drewalt
 subscriber, 121 posts
Thu 3 Feb 2022
at 22:49
Re: Dice roller has a problem.
I deeply suspect we'd need a statistician and a software engineer (or teams thereof) to really address this topic.

I have to generate random numbers for testing purposes sometimes, and I remember a long time ago we were actually just using the "RAND" function in Excel, but the scuttlebutt came down forever ago from several professional associations/groups/entities that this was this was not random enough in the resulting distribution.

The industry, at great expense, began to invest in very expensive software packages to generate random numbers instead of using free random generators, functions built into common programs, etc.

Someone a lot smarter than me explained that getting a truly random seed using a computer was actually a nightmarishly complex problem using a lot of words I don't remember and don't understand.  Apparently if you type a random function into a random software you typically get something "random enough" but not random enough for people who need statistical rigor.  I can't explain why this is, it's just been pounded into my dense skull many times by people much smarter than I am.

The point being, I suspect whatever the solution is the site is using under the hood isn't a statistical software package with a license fee that probably costs handsomely.  But I also suspect the die roller is many orders of magnitude more "random" than just asking a disinterested person on the street to pick a number between 1 and 20.  After all you have to consider the purpose of the site, something which will more or less work and costs very little or has no additional cost at least is infinitely better than any solution that involves more cost and complexity.  No one is going to court over losing DnD.  I hope.

Although I've seen the die roller do some very wacky things, I know just enough about probability to understand that it's very, very easy to outsmart yourself and convince yourself that just because you were always pretty good at calculus means and actually bust out DeMorgan's laws sometimes to try to think through problems that you understand what's actually going on where probability is concerned.  There are actually court cases in multiple countries where people have been convicted based on the calculations of probabilities which were arithmetically correct, but based on invalid yet very reasonable and logical sounding assumptions applied by sharp and rational people.  People often miss assumptions they are making (and so do other people as people tend to think like people), and any assumption that isn't reduced to a sufficiently robust logical notation and tested in same is always suspect (and even then someone will argue the axioms are wrong).  Epistemology is interesting.

My point being, I think a reasonably intelligent (or in my case, significantly below average but unfunny and pretentious) person who is, alas, not a probability expert is more likely to fall into the trap of thinking they understand the die roller better than they actually do than someone who has no particular talent at all for calculation, so I'm very careful to not judge the quality of the die roller or gauge how random it truly is, no matter what the calculated probability of a certain set of events may be.  I'd suggest most of us probably fall into that bucket, unless you happen to be the PhD in statistics (there's got to be at a few of you out there on a site like this) reading this.

Check out sometime what a lottery machine costs.  Trying to get an analog way to get a random result isn't cheap either.  Randomness is truly a fascinating topic with many rabbit holes to go down.

To wrap it up, surely there's a better die roller than the one the site has which could be had (in principle).  But, it's a question of where do you get those resources from, and also if we had them is that truly the best use of them.  Also, no matter how high quality the random number generator, people still swear it's off (I see it at work all the time) because our monkey brains are so wired to see patterns they often force them.

This message was last edited by the user at 22:51, Thu 03 Feb.

facemaker329
 member, 7384 posts
 Gaming for over 40
 years, and counting!
Fri 4 Feb 2022
at 04:13
Re: Dice roller has a problem.
My favorite example of random bad luck beating the odds--

When I was in college, we went to a theater festival in Las Vegas.  And, of course, we spent one evening at a casino playing slots (everyone else went for the free drinks provided to people playing the games...since I don't drink, I just went to be part of the company.)

I went through ten dollars' worth of quarters...with no payouts.  Everyone else had also started with ten dollars, and most had gotten that much back and more, some had even doubled their money.  Them being drunk, they couldn't believe that I hadn't won ANYTHING off ten dollars and that, statistically, the machine I was playing HAD to pay out at some point...so they started feeding me their winnings to keep me playing.

Not only did I not get anything back on my ten bucks--I spent EVERYTHING the rest of the group had won (I didn't take their 'seed money'), and STILL didn't win.

So, yeah...maybe you've got an argument.  But it's not unprecedented for a random generator to deliver an incredible long string of less-than-desirable results.  I still remember the D6 Star Wars group that I played in through college...we had one player whose character was a Mercenary.  She couldn't hit ANYTHING with a blaster...unless she was Stunned or Wounded.  It wasn't a quirk that the player came up with...it was just how the dice worked for her.  Full complement of dice to roll?  She consistently came up short of her target number.  Take away a die, and she was almost always well above her target number.

Sometimes the dice just do weird things.
Skald
 moderator, 958 posts
 Whatever it is,
 I'm against it
Fri 4 Feb 2022
at 07:39
Re: Dice roller has a problem.
Some more info for those who understand the intricacies of such things ... have a look at the following thread I've just dug up that jase prepared earlier, cunningly entitled "Randomness and the die roller": link to a message in this forum

Specifically:

msg #1 - "the die roller utilises Perl and the /dev/urandom device on RPoL's Debian server. It is seeded once, automatically, by Perl."  Must be good.

msg #29 - jase addresses Entropy, Chi Square, Arithmetic Mean, Monte Carlo value for Pi and the Serial Correlation Coefficient in relation to the dice roller's results.   I hope those terms mean more to you than to me, but I think the upshot of his message was that it's as random as is sensibly possible !  :>
Westwind
 member, 89 posts
 "[Sad] is happy for deep
 people" - Sally Sparrow
Fri 4 Feb 2022
at 23:20
Re: Dice roller has a problem.
Rathmun:
Westwind:
then the dice roller is fair.

No.  No it is not.

It is because it affects healing rolls, damage rolls, saving throws, etc. for the players and the NPCs.

My brother has a knack for rolling natural 20s on a d20, far above average, no matter whose dice he's using.

My daughter wins ridiculously often at Yahtzee and Bingo.

Random isn't always random. Or, is randomly random.

My advice is to not worry about the fairness and simply enjoy the game.
Rathmun
 member, 18 posts
Fri 4 Feb 2022
at 23:44
Re: Dice roller has a problem.
Westwind:
It is because it affects healing rolls, damage rolls, saving throws, etc. for the players and the NPCs.


Did you even read the thread?  There are multiple examples provided where only one side or only the other are doing the rolling, where all low rolls favors one side, and all high rolls favors the other.  Hell, there's an entire damned system where that's the case (Cypher).




Embedded images don't work in this forum apparently, but here.
https://imgur.com/a/u6UneKs

This is a plot of the kurtosis (prevelance of outliers) for 30524d6.  This took quite a while to do all the rolling, and the data isn't perfectly clean because other people were using the roller at the same time I was, but please note the semi periodic spikes.  There is also a lot of noise on the graph, which you may think is desirable for an RNG, but you should remember that this is a plot of how many outliers there are.

I used a target number of 5 for the rolling, because I first noticed something going weird in a Shadowrun game.


I would love to have the perl code that takes /dev/urandom and turns it into dice.  I could set up a debian install in a VM and just get a million dice in a row without anyone else consuming some of the numbers.  But this is the best I can do at the moment with the tools I have.

This message was last edited by the user at 23:44, Fri 04 Feb.

donsr
 member, 2508 posts
Fri 4 Feb 2022
at 23:50
Re: Dice roller has a problem.
the bottom line here? Everyone has to remember this isn't table top...its PBP. every sport in the word, has 'ground rules" for stadiums and venues.

 here, we have ( what i think) is one of the best Dice  rollers in PBP...load in your Numbers, and info if you need to and   click.

 IF..... you think the dice rooler is  too stilted? Then back offm making the  rolls so important. My games..yes..the dice roller  does come into play, but  the players  Mods  and RP factor in much more.

 If you have to  roll a half dozen times per post, You need a new system!
Rathmun
 member, 19 posts
Sat 5 Feb 2022
at 00:02
Re: Dice roller has a problem.
donsr:
If you have to  roll a half dozen times per post, You need a new system!

I usually don't.  It was an unusual case of "how long does it take you to break a hole in the wall?" that tipped me off to the issue initially.  As noted in the first post of the thread, both I and the wall were rolling terribly.  One-in-thirty-million bad luck.  That's when I took a look at all the rolls for that entire game, and found that everyone together was rolling terribly.



Claims that "It's fair as long as everyone rolls terribly" can piss off.  Unless those people have never used any systems with fixed difficulties, they're talking out their backside.  Skewed dice are unfair unless literally everyone is rolling, including the inanimate objects.  The only system I'm aware of that does that is Donjon.  (Incidentally, neat system, look it up.)
  • If you know the dice are skewed, then you have to have casters in D&D roll to figure out what the save DC of their spells is.  You can't have a fixed base of 10, because that assumes fair dice.
  • If you know the dice are skewed, you have to make everyone in your D&D game roll their AC, because not everyone relies on attack rolls.  So you have to have an armor save instead of an AC, to bring it in line with the other saves.
  • If you know the dice are skewed, you can't play World of Darkness or Shadowrun, becuase rolling ones without any successes has specific consequences, even on unopposed rolls.
  • If you know the dice are skewed, you have to change literally every roll in Cypher because only one side is rolling at all.


And sure, this might be one of the best dice rollers in PBP.  It might even be the best, I don't know.  But that doesn't make it perfect, and quite a few people's reaction so far consists of "You will eat it and you will like it.  Don't even THINK about asking if it can be improved."  Sorry, but no.

This message was last edited by the user at 01:47, Sat 05 Feb.

Carakav
 member, 694 posts
 Sure-footed paragon
 of forthright dude.
Sat 5 Feb 2022
at 00:06
Re: Dice roller has a problem.
I think the point here is that an obviously technically proficient person (Rathmun) has uncovered something interesting and is offering to investigate/dig deeper to make the dice roller we have work better for everyone.

Admins (and Jase) are not under any obligation to accept their input, but it's still a healthy conversation to have, and it's pretty clear to me that this issue does objectively matter to a subset of site users.
JAM2019
 member, 71 posts
Wed 2 Mar 2022
at 14:17
Re: Dice roller has a problem.
while you guys have used some impressive mathematical aptitudes to express your findings, theories, and concerns why not simply ask the admin to look into this troubling phenomenon. I agree that the RNG is annoying as hell at times. RNGs have many tendencies that make them undesirable for many situations. I am sure that the moderators know this as well. so, simply ask them to look into. No demands. No you need to do this lines. Just ask.

RPOL has provided a great place for play by post games. I feel that they are sincere and honest with the people they provide services to. And the price is awesome! So please lose the vim and vigor in your posts. Pat these guys on the back. And simply ask them to look into it.