Who programmed the dice?

Forum rules
Please DO NOT POST BUGS on this forum. Please report (and vote) bugs on : https://boardgamearena.com/bugs
User avatar
Strode
Posts: 296
Joined: 18 April 2020, 04:49

Re: Who programmed the dice?

Post by Strode »

yfimc wrote: 18 November 2024, 19:04 i just wish someone would share the actual statistics of dice rolls over all catan games on bga. then we could have much more confidence that it’s random.

another option would be to let us see the actually implemented code, i guess (not just tell me it’s random_int() but let me see how and where random_int() is called). but i would prefer the statistics. wouldn’t it be funny if they actually revealed a pattern!
Stats would be nice, but even if they showed the numbers weren't perfect, it still wouldn't be fair to conclude that the game is "rigged". People don't just think the randomness is imperfect, they think it is rigged against them personally. That's a different thing.
User avatar
gmrsmrt
Posts: 68
Joined: 08 January 2021, 17:20

Re: Who programmed the dice?

Post by gmrsmrt »

yfimc wrote: 18 November 2024, 19:04 i just wish someone would share the actual statistics of dice rolls over all catan games on bga. then we could have much more confidence that it’s random.

another option would be to let us see the actually implemented code, i guess (not just tell me it’s random_int() but let me see how and where random_int() is called). but i would prefer the statistics. wouldn’t it be funny if they actually revealed a pattern!
You are a premium member.
I think that this stat is shown at the end of each game.
Just take your last twenty games (more even better), add up and you collect a meaningful statistic and can check wether they follow (within
statistical fluctuation) the expected behaviour.
User avatar
Mathew5000
Posts: 661
Joined: 02 January 2021, 01:41

Re: Who programmed the dice?

Post by Mathew5000 »

gmrsmrt wrote: 21 November 2024, 11:30
yfimc wrote: 18 November 2024, 19:04 i just wish someone would share the actual statistics of dice rolls over all catan games on bga. then we could have much more confidence that it’s random.
...
You are a premium member.
I think that this stat is shown at the end of each game.
Just take your last twenty games (more even better), add up and you collect a meaningful statistic and can check wether they follow (within
statistical fluctuation) the expected behaviour.
Yes but remember to do the arithmetic to convert from the percentage to the actual number of rolls. See this thread: https://boardgamearena.com/forum/viewtopic.php?t=27679

It can be a little tricky because you can see the number of turns in the game (by adding up the number of turns of each player) but to get the number of rolls in the game you occasionally need to subtract 1 from the number of turns (because someone might win on the final turn without rolling the dice, typically by playing a knight and getting the Largest Army card).
User avatar
gmrsmrt
Posts: 68
Joined: 08 January 2021, 17:20

Re: Who programmed the dice?

Post by gmrsmrt »

Mathew5000 wrote: 21 November 2024, 23:25

Yes but remember to do the arithmetic to convert from the percentage to the actual number of rolls. See this thread: https://boardgamearena.com/forum/viewtopic.php?t=27679

It can be a little tricky because you can see the number of turns in the game (by adding up the number of turns of each player) but to get the number of rolls in the game you occasionally need to subtract 1 from the number of turns (because someone might win on the final turn without rolling the dice, typically by playing a knight and getting the Largest Army card).
For those genuinely willing to inspect the game output I just found out that it is actually easy to access the information even without
premium and with complete granularity. You can enter reply mode of a game (you DON'T NEED to reply the game). There is a long logfile with all
the moves of the game. You just select it, copy and paste to a file. It is then straightforward to filter all the dices output. Now all what you need to
do is to repeat the same operation for a bunch of games (20, 50, ... CONSECUTIVE games of a player for example, or any other way provided the choice is UNBIASED) and you end up with a sequence of rolls as large as you want.

So go ahead, produce your sample and PROVE your point.
User avatar
Romain672
Posts: 1348
Joined: 05 April 2016, 13:53

Re: Who programmed the dice?

Post by Romain672 »

I will go even further.

Open your game with firefox.
Then goes into the replay where all the logs are displayed.
Then do ctrl+a then ctrl+c (to copy all text present on the page).

On chrome instead just select the logs, and do the same ctrl+a then ctrl+c.
You need to have copied some text with a lot of "rolls dice: " in between, not sure if it work.


Then take my document in googlesheet and create a copy (top left):
https://docs.google.com/spreadsheets/d/ ... 1659177939
Then goes into page 'logs'.
In column B, just do ctrl+v on any cell to paste all the logs.
Then goes to page 'dicerolls' and you will find all the dices rolled.
You will even have in light blue the number of each number you rolled.
RobertBr
Posts: 667
Joined: 08 July 2016, 15:57

Re: Who programmed the dice?

Post by RobertBr »

gmrsmrt wrote: 21 November 2024, 11:30 Just take your last twenty games (more even better), add up and you collect a meaningful statistic and can check wether they follow (within
statistical fluctuation) the expected behaviour.
Yes, absolutely, do that and prove you don't understand how to measure this. Let's not encourage the conspiracy theorists by giving them sloppy descriptions of bad methodologies. The people making these claims have a problem with reality which is fueled by ignorance, and they are not going to let facts or reason get in the way of their imagined grievance.
tugasemnome
Posts: 2
Joined: 07 November 2024, 18:02

Re: Who programmed the dice?

Post by tugasemnome »

I've played 302 Catan games so far.

I've to be honest here I strongly believe that dices are not random at all.
I strongly believe that something is wrong at code level.

Facts:
1-Main important one - too many dice repetitions.
2-A whole game without a 10.
https://boardgamearena.com/table?table=607909702

Please review how this random is coded.

please check the seed that you are using. Use the seed as the time generated number.

Suggestion:
Random randomDice1 = new Random(Environment.TickCount);
Random randomDice2 = new Random(Environment.TickCount);
You may also use:
new System.DateTime().Millisecond
But you need to have a seed, and I believe that this is failing.

int rollDice1 = random1.Next(1, 7);
int rollDice2 = random2.Next(1, 7);

Kind regards
User avatar
euklid314
Posts: 679
Joined: 06 April 2020, 22:56

Re: Who programmed the dice?

Post by euklid314 »

BGA uses the well known and tested PHP function random_int(). You can get all necessary information about that cryptographically safe function on the Internet. The seed is built into the function - no possibility to set it wrong.

@Your observations:
1) Please elaborate further. Humans tend to hugely underestimate repeating numbers, thus one needs to precisely count and analyze to give some judgement.

2) The probability of having no 10s in a game of 59 rolls (as in your example) is 0.589% = (33/36)^59. It happens on average in 1 out of 170 games, i.e. several times each day on BGA.

Rolling not a single 10 or rolling not a single 4 (which is equally likely) has a probability of 1.18% or 1 out of 85 games. That is, every 85 games on average the number 10 or 4 (or both) is not rolled.

Do you have any cause to believe that the event happens more often on BGA? If you have played 302 games thus far, you should have approx. 4 games where either 10 or 4 was not rolled.

Edit: Note that your example was a C&K game which are usually longer than standard CATAN games. In standard games such events of a number not being rolled is even higher. If a game lasts only 50 moves, every 1 out of 40 games you will have no 10 or 4.
tugasemnome
Posts: 2
Joined: 07 November 2024, 18:02

Re: Who programmed the dice?

Post by tugasemnome »

Hi,
Thank you for your detailed and Enlighted answer.
Tried to understand: https://www.php.net/manual/en/function.random-int.php
This indeed matches what you say. That seeding is automatically. Looks like that it goes getting the seed from: /dev/urandom (if working with Linux)
Unfortunaly I don’t have the know-how to help at this level, but I saw some issues related with this, if application does not have permission to access /dev/urandom to access this automatically seeding. If possible try to check that.

You wrote:
@Your observations:
“1) Please elaborate further. Humans tend to hugely underestimate repeating numbers,”

My observations and experience in generating random number is the following:
when I did development and worked with random numbers (for dungeons and dragons) and seeding was not properly done I’ve observed a lot of repetitions.
.. and that experience is kinda similar to what I see in Catan games:
In same game having:
Too many 3 in a row. Example I saw like 6 times appearing a 3.
Too many 12 or 11 in a row.
This experience is not only mine experience and opinion.

Please check the seeding. Is it done getting /dev/urandom?
Does application have permission to it?
Honestly not sure… but I’m really uneasy about the random behaviour observed.

Kind regards,
User avatar
euklid314
Posts: 679
Joined: 06 April 2020, 22:56

Re: Who programmed the dice?

Post by euklid314 »

tugasemnome wrote: 31 December 2024, 13:49 My observations and experience in generating random number is the following:
Too many 3 in a row. Example I saw like 6 times appearing a 3.
Too many 12 or 11 in a row.
Kind regards,
Thank you for giving a clear claim that can be discussed. I checked in your last 5 games (game no. 608391048, 608349174, 608312674, 608230107, 607921287) how often a 3 is followed by a 3 and how often a 11 is followed by a 11. Both observations should happen on average (!) with a probability of 2/36 = 5.56%.

Your last 5 games have 74+56+52+65+69 = 316 rolls, 11+5+4+7+9 = 36 of which were 3s or 11s.

Only once in these 36 cases the number repeated, namely in your game 607921287 you rolled two 11s in a row.

It took me 15 minutes to gain that data (you dont have to replay the game because it is sufficient to analyze the game summaries).

If you are serious about your claim then you should analyse at least your last 50 games, better all of your games. Because I do not have to tell you that my observation that 3s and 11s repeat less (!) than one should expect is from a very small sample size. But it is you that makes the claim that 3s and 11s repeat more often than expected - thus you should back it up with data if you mean it seriously.

As long as you have not found something that seems wrong you don't need to worry about a wrong implementation. First, you should check if your gut feeling is indeed correct (hint: it probably isn't).
Post Reply

Return to “Catan”