BGA_rand is not very random

Game development with Board Game Arena Studio
User avatar
abcde
Posts: 22
Joined: 24 January 2014, 18:30

BGA_rand is not very random

Post by abcde »

bga_rans often gets stuck on certain numbers.

I see that in my testing and in the games I play

This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
User avatar
Tisaac
Posts: 2351
Joined: 26 August 2014, 21:28

Re: BGA_rand is not very random

Post by Tisaac »

abcde wrote: 07 February 2023, 08:06 bga_rans often gets stuck on certain numbers.

I see that in my testing and in the games I play

This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
Can you please provide stats ? Data analysis ? Or anything more serious than just "i Can see that, it's evident, everyone knows that"
User avatar
Fletcheese
Posts: 158
Joined: 21 March 2022, 03:16

Re: BGA_rand is not very random

Post by Fletcheese »

abcde wrote: 07 February 2023, 08:06 This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
Have you considered that there could be other reasons for this? In most games there tends to be a color (or two) that players are not picking because it doesn't align with their strategies. The result is that this color accumulates.

Also the colors for energy in Gizmos is determined by an ID ranging from 1 to 52 mod 4. Are you suggesting that the random function is specifically skewed toward producing the same value mod 4 in repetition? Sounds rather unlikely :)
User avatar
abcde
Posts: 22
Joined: 24 January 2014, 18:30

Re: BGA_rand is not very random

Post by abcde »

Fletcheese wrote: 07 February 2023, 16:54
abcde wrote: 07 February 2023, 08:06 This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
Have you considered that there could be other reasons for this? In most games there tends to be a color (or two) that players are not picking because it doesn't align with their strategies. The result is that this color accumulates.

Also the colors for energy in Gizmos is determined by an ID ranging from 1 to 52 mod 4. Are you suggesting that the random function is specifically skewed toward producing the same value mod 4 in repetition? Sounds rather unlikely :)
I love your implementaion of Gizmo, Fletcheese

Thank you for bringing it to BGA
Through testing my games , i have found BGA rand often favors a certain number and disfavor another. For example, a player will always roll alot of 6s, but not alot of another number.

My apologies for using Gizmo as an example. you have done an awesome job!
I cannot help often seeing color biases that is beyond your control
User avatar
Strode
Posts: 100
Joined: 18 April 2020, 04:49

Re: BGA_rand is not very random

Post by Strode »

You need evidence to support this. Randomness doesn't mean that of every dozen d6 rolls, you'll get two of each number. Or even that each number will come up at all. People notice it (and sometimes post about it) when the low percentage stuff comes up, and don't make note when the distribution is normal looking. So this leads them to wrongly believe that something is amiss.
User avatar
ufm
Posts: 1348
Joined: 06 January 2017, 08:38

Re: BGA_rand is not very random

Post by ufm »

Strode wrote: 09 February 2023, 00:56 You need evidence to support this. Randomness doesn't mean that of every dozen d6 rolls, you'll get two of each number. Or even that each number will come up at all. People notice it (and sometimes post about it) when the low percentage stuff comes up, and don't make note when the distribution is normal looking. So this leads them to wrongly believe that something is amiss.
Confirmation bias, in other words.
User avatar
Strode
Posts: 100
Joined: 18 April 2020, 04:49

Re: BGA_rand is not very random

Post by Strode »

ufm wrote: 09 February 2023, 01:01
Strode wrote: 09 February 2023, 00:56 You need evidence to support this. Randomness doesn't mean that of every dozen d6 rolls, you'll get two of each number. Or even that each number will come up at all. People notice it (and sometimes post about it) when the low percentage stuff comes up, and don't make note when the distribution is normal looking. So this leads them to wrongly believe that something is amiss.
Confirmation bias, in other words.
Yes, that plus a failure to appreciate how many iterations it takes for things to even out.
User avatar
tchobello
Posts: 526
Joined: 18 March 2012, 13:19

Re: BGA_rand is not very random

Post by tchobello »

I often answer to this with the Birthday Problem...

you only need 23 students in a classroom to have 50% chances of two of them having their birthday on the same day.

it seems really counterintuitive but that's a fact !
User avatar
abcde
Posts: 22
Joined: 24 January 2014, 18:30

Re: BGA_rand is not very random

Post by abcde »

Tisaac wrote: 07 February 2023, 09:25
abcde wrote: 07 February 2023, 08:06 bga_rans often gets stuck on certain numbers.

I see that in my testing and in the games I play

This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
Can you please provide stats ? Data analysis ? Or anything more serious than just "i Can see that, it's evident, everyone knows that"
Thanks for your reply
From my many testings with games that use 6 sided dice, often, I found that a player will continuouly roll disportionately more of a certain number . To fix this, I would use another player to roll the dice and this always fixes the problem.

This fix should not work if BGA rand was truly random
User avatar
byte5115
Posts: 2
Joined: 25 March 2020, 15:50

Re: BGA_rand is not very random

Post by byte5115 »

Randomness is a pretty huge topic on its own, it might be by chance you are hitting the same numbers for now and one of definition of randomness is how frequent the repeats are (see table 1 of https://acadpubl.eu/hub/2018-118-22/articles/22a/48.pdf) . In that paper alone, it's already expected that pseudo random generator will create repeats.

Also another point is you need a huge sample size to see if it is actually screwed to one side . Fun fact you can check out https://alexromanov.github.io/2021/12/1 ... andomness/ to see how different php random differ than random.org , I think from there you can see how bias or 'not enough' randomness exist in the php version.

But on that subject, I would be more than happy to help implement a newer PRNG into BGA as i recent read and implemented the following algo into my excel macros : https://www.researchgate.net/publicatio ... om_Numbers
Post Reply

Return to “Developers”