dice used in catan is biased

Forum rules
Please DO NOT POST BUGS on this forum. Please report (and vote) bugs on : https://boardgamearena.com/bugs
Post Reply
Rufasu
Posts: 57
Joined: 04 March 2023, 07:31

Re: dice used in catan is biased

Post by Rufasu »

You guys have been wrestling in this thread about not being open with your sources.
It is not a good idea to lie.
I still don't feel that you are being professional.
User avatar
Nekojin
Posts: 121
Joined: 28 March 2024, 01:21

Re: dice used in catan is biased

Post by Nekojin »

My apologies - I forgot that the info on the randomizer was given in a different thread.

Standard BGA code uses Mersenne Twister, MT19937 (feel free to look that up yourself to determine how reliable it is). Mersenne Twister's randomness is 2 to the power of 19937, a number so large that most calculators are incapable of showing it long-form, and only a few can display it in scientific notation.

While it's entirely possible that the Catan devs are using some other randomizer than the standard BGA one, it's not likely - why add more work to yourself, when there's already a very reliable randomizer built in?

If you want the source code, the information on how to acquire it is earlier in that same thread I linked up there. However, they don't just hand out source code to anyone who asks, because there are some people looking for ways to break it so that they can cheat, not just analyze for bugs. You'd likely have to prove that you are both capable of understanding the code, and working in good faith.
Rufasu
Posts: 57
Joined: 04 March 2023, 07:31

Re: dice used in catan is biased

Post by Rufasu »

Thanks for the new info.
I am not in a position to read the source code, so I will give my thoughts.
I think it would be better to use PCG64 or Xoshiro256** for the random number algorithm rather than Mersenne Twister.
And I think it is better not to specify the seed value.
User avatar
Nekojin
Posts: 121
Joined: 28 March 2024, 01:21

Re: dice used in catan is biased

Post by Nekojin »

Rufasu wrote: 29 July 2024, 08:30 Thanks for the new info.
I am not in a position to read the source code, so I will give my thoughts.
I think it would be better to use PCG64 or Xoshiro256** for the random number algorithm rather than Mersenne Twister.
And I think it is better not to specify the seed value.
If you're not in a position to read and understand the source code, why do you believe that those others are superior? Can you explain it in your own words (not quoting some tech site)?

I can say that the Xoshiro256** is one of the most-used algorithms, being used by Microsoft's .Net framework, LUA, Julia, and available in java. To me, that level of exposure means more people trying to figure out ways to break it - it's less secure.

None of these are cryptographically secure, but it's not a for-cash gambling site, we're dealing in a relatively simple gaming site, so that's not really relevant. It does not have to be super-fast (like an FPS might need), it just needs to be adequately fast, and the difference between 20 calls per second and 150 calls per second is functionally irrelevant for this purpose.

As for the seed value - I don't know it, but I'm quite certain it's not fixed. It wouldn't be hard to make the seed based on the time, down to the second, that the game starts, and that will prevent any seed-based attack vectors.

But we're getting into the weeds. All three of these - PCG64, Xoshiri256**, and Mersenne Twister - are suitable for this level of computation. AFAIK, there are no board games that involve anything more complex than shuffling cards, randomizing balls, or rolling dice, and even the most complex of these (fully-expanded Terraforming Mars) is still rolling numbers of less than 1000 possibilities. There's nothing here making Calculus-based (or even Algebra-based) computations.

The question isn't, "What's better," the question is, "What's wrong with the current setup, and why should it be changed?" Some people thinking that their numbers aren't random enough because they're seeing streaks isn't a valid reason to change. Even if the other two are better than Mersenne Twister, you'd have to demonstrate an actual failing for Mersenne Twister within the scope of this purpose and use-case.
Rufasu
Posts: 57
Joined: 04 March 2023, 07:31

Re: dice used in catan is biased

Post by Rufasu »

I have written many times why I think there is a problem with the random number process, so I will omit it.
Randomizers are designed to always have the same value if a seed value is specified, so it is better not to specify a seed value.
It is not enough to say that random numbers are against human intuition, or to ask users with less data available than the operation to prove it.
Our job as engineers is to write better programs if the users are dissatisfied.
Instead of saying “it's the user's fault,” I and my fellow engineers invariably respond, “We'll improve the program.”
It is no secret that the Mersenne Twister algorithm has problems.
It alone has room for improvement.
User avatar
Jellby
Posts: 3550
Joined: 31 December 2013, 12:22

Re: dice used in catan is biased

Post by Jellby »

Rufasu wrote: 29 July 2024, 11:12 Our job as engineers is to write better programs if the users are dissatisfied.
But users are dissatisfied with random numbers (and I don't mean RNG, I mean truly random numbers), do you suggest that programmers shout tweak the "random" numbers such that users are no longer dissatisfied? Good luck with that :D
User avatar
Nekojin
Posts: 121
Joined: 28 March 2024, 01:21

Re: dice used in catan is biased

Post by Nekojin »

Rufasu wrote: 29 July 2024, 11:12 It is no secret that the Mersenne Twister algorithm has problems.
It alone has room for improvement.
What problems? In what ways do these problems actually affect a 2d6 roll?
Rufasu wrote: 29 July 2024, 11:12 Randomizers are designed to always have the same value if a seed value is specified, so it is better not to specify a seed value.
Even if you knew that the seed is based on the exact time, down to the second, that the game starts, how are you going to know exactly what that is, when the site only tells time in minutes? And whether it uses the date or not as part of the string?

And how are you going to reconstruct that within the timespan of a live game?
Stroom
Posts: 428
Joined: 14 July 2016, 19:10

Re: dice used in catan is biased

Post by Stroom »

https://en.wikipedia.org/wiki/Confirmation_bias

There is nothing wrong with the current RNG system. The differences between the different RNGs proposed here, are not seemingly different from each other when you use them at the heavily simplified scale of rolling 2d6 about 70 times per game. RNG systems are meant for generating much much larger random numbers and if you round all of these results down to only 6 numbers at a time, you are already off by several orders of magnitude. The results are random enough for a simple game as Catan.

Now this is where your bias comes in. You assume that the same numbers should not be rolled several times in a row. Or that after 70 dice rolls you'd assume to see the normal distribution already. This is not correct. This is what RANDOMNESS is. Random. You can have unfair things happen. And based on such a small scale of results and dice rolls, these random events will very likely happen anyway. What you fail to see is that for a 7, you could roll 1+6 or 2+5 or 3+4 or 4+3 or 5+2 or 6+1 so if you roll several 7s in a row, maybe you didn't actually get the SAME result but rather a different combination that happened to sum up to the same number. Most people who whine about RNG just do not understand statistics and probabilities.

You could abstract 72 x 2d6 dice rolls results down to 2 coin flips. A biased human would say that if you flip a coin 2x then you would always have to end up with heads-tails or tails-heads. But that's only 50% of all possible outcomes. It's equally as possible that you get either tails-tails or heads-heads. In a very abstract manner, you could approximate that about 50% of all Catan dice outcomes are going to be "unfair" from a biased person's perspective.

These topics come up every other month and each time the people who whine about RNG do not know anything about the topic. Only biases and saltiness because they lost a few games due to bad RNG. It's easy to whine about the dice but not about the shuffled decks. But they very likely use the same RNG.
User avatar
Nekojin
Posts: 121
Joined: 28 March 2024, 01:21

Re: dice used in catan is biased

Post by Nekojin »

Stroom wrote: 30 July 2024, 07:35 These topics come up every other month and each time the people who whine about RNG do not know anything about the topic. Only biases and saltiness because they lost a few games due to bad RNG. It's easy to whine about the dice but not about the shuffled decks. But they very likely use the same RNG.
There's also a tiny bit of arrogance in it as well - they would have won, if not for the dice, cards, etc. They never consider that maybe they didn't plan adequately.

Personally, I know I'm pretty bad at Catan. I can accept that. It's easier to improve when you know where your weaknesses are. Arrogance involves denying one's own weaknesses; you can still improve, but it's much harder.
Rufasu
Posts: 57
Joined: 04 March 2023, 07:31

Re: dice used in catan is biased

Post by Rufasu »

Are you escaping into statistical faith again?
I'm sick of it.
The point is whether or not you are willing to provide better quality work to your customers.
Apparently there isn't.
Post Reply

Return to “Catan”