Is the code available to review?

Forum rules
Please DO NOT POST BUGS on this forum. Please report (and vote) bugs on : https://boardgamearena.com/#!bugs
User avatar
Jest Phulin
Posts: 1856
Joined: 08 July 2013, 21:50

Re: Is the code available to review?

Post by Jest Phulin »

(Edit:This became more of a rant picking apart every detail of the argument the further I went into it. Just skip to the "bottom line" statement.)
SluggerBaloney wrote: 20 May 2020, 05:31
Jest Phulin wrote: 20 May 2020, 02:15 SluggerBaloney, please forgive us if we misinterpreted your question.

The vast majority of people who have ever asked about the random number generator on BGA follow it with "because something is obviously buggy/not representing reality/flawed/biased with it." Their "proof" tends to be what Pastor Flapps has been doing.
You can't handwave away his claims. That's being dismissive, and not helpful. I would ask him to start recording roll results and then when he has a significant sample size of actual data, we can look at them.
Jest Phulin wrote: 14 May 2020, 21:27 You have several anecdotal reports. But no statistical analysis.
There was a request. It was ignored.

Also...
SluggerBaloney wrote: 13 May 2020, 01:38 I do not believe the game is coded correctly based on the results I have been seeing. The randomizer does not appear to be properly implemented.
What results were you seeing that led you to believe the randomizer is not properly implemented? I'm sorry I didn't reread your original post before apologizing, because now I see it also fell into 'the vast majority of people who have ever asked about the random number generator on BGA follow it with "because something is obviously buggy/not representing reality/flawed/biased with it."' category.

SluggerBaloney wrote: 20 May 2020, 05:31 So looking at random_int(), it is used to generate a "cryptographically secure pseudo-random integer". In the case of Can't Stop, that's pretty much pointless. A "cryptographically secure" RNG is the exact same as any other RNG. It just gets it's seed from an "unguessable" source, like hardware interrupt calls or something. But the generation of the random number is not handled any differently.
A cryptographically secure RNG is not the same as any other RNG. All CS-RNGs satisfy the requirements of non-CS-RNGs, but the reverse is not true. One of these requirements is that it passes "the next-bit test. That is, given the first k bits of a random sequence, there is no polynomial-time algorithm that can predict the (k+1)th bit with probability of success non-negligibly better than 50%" (Katz, Jonathan; Lindell, Yehuda (2008). Introduction to Modern Cryptography. CRC press. p. 70. ISBN 978-1584885511.)
It produces a number that can't be predicted.


And, your bolded statement that "PHP doesn't generate the number, the underlying OS does" implies there is a problem with the underlying OS being able to perform that function. What is wrong with
https://docs.microsoft.com/en-us/window ... cng-portal
and
http://man7.org/linux/man-pages/man2/getrandom.2.html ?
(arc4random_buf() and /dev/urandom are no longer used with PHP 7. See https://www.php.net/manual/en/function.random-int.php)

The statement of no real site uses PHP to shuffle the cards, and backed by your linked article of https://www.datamation.com/entdev/artic ... curity.htm doesn't seem to be accurate. The article points out that reseeding based on the system time clock was the largest problem. it goes on to state
the article wrote:Key to the success of our algorithm is the choice of a random number generator (RNG). The RNG has a direct impact on whether the algorithm above will successfully produce decks of even distribution as well as whether these decks will be useful for secure online card play. To begin with, the RNG itself must produce an even distribution of random numbers. Pseudo-random number generators (PRNG), such as those based on the Lehmer algorithm, have been shown to possess this mathematical property. It is therefore sufficient to use a good PRNG to produce "random" numbers for card shuffling.

As we have seen, choice of initial seed for the PRNG is a make or break proposition. Everything boils down to the seed. It's absolutely essential that players using a deck of cards generated using a PRNG can't determine the seed used to produce that particular shuffle.
And this is exactly what a cryptographically secure random number generator like random_int() provides.



Bottom line -- All* games are available to be replayed, by any BGA user. The data is available, but I have never seen anybody who has made the claim that the RNG used by BGA does not create random numbers ever post a statistical analysis that supports that claim. Or, prove the claim by becoming the top rated player on the site by exploiting the flaw.

------notes
*OK, there have been reports of isolated incidents where some replays have been corrupted, and there is an age limit of a couple of years to the replays. But enough games to provide a statistically sound population are available.
User avatar
RicardoRix
Posts: 2540
Joined: 29 April 2012, 23:43

Re: Is the code available to review?

Post by RicardoRix »

SluggerBaloney wrote: 20 May 2020, 00:25
RicardoRix wrote: 15 May 2020, 02:07 When someone wins the lottery, what do you do, fall down dead in disbelief?

Play a game in real-life, with real dice, you'll get the same results.
You actually won't. Computers are pseudo random number generators. They do not imitate real life randomness.
Even if it's different, you (as a human) won't be able to tell, which is my point. It's after playing Can't stop that you 'think' there is a difference - there isn't. This is mainly just human understanding and experience not accepting unusual events, hence the lottery statement.

This subject has been brought up before, and BGA did bite once, and wrote a long response. You can try and search for it. They cited using statistical tools like suggested here:
https://www.random.org/analysis/

To answer the original question: Can't Stop was written outside of BGA studio, and so the source code is not available. As a BGA Studio coder you can use whatever random tool you like (e.g. php shuffle, php rand). The BGA framework provides and promotes the use of a random number generating function that as suggested via the BGA admin team passes the many rigorous statistical tests. You will also not be able to see the code behind that function.

http://en.doc.boardgamearena.com/Main_g ... randomness
User avatar
N_Faker
Posts: 1078
Joined: 09 September 2016, 10:16

Re: Is the code available to review?

Post by N_Faker »

...maybe I'll poke into those functions more if someone knows what OS BGA's web servers run on. But probably not, I don't really care all that much.
Nothing more to say then.
User avatar
47878478645674
Posts: 18
Joined: 13 May 2020, 15:45

Re: Is the code available to review?

Post by 47878478645674 »

Players wins 4 & 11 (yes 4 AND 11) in one turn AND THEN wind 3 in the next turn ... I was two steps away on column eight for both rounds ... which is all I needed for the win.

WHAT ARE THE ODDS?

------

Beuhc wins column 3
Beuhc chooses to stop
Beuhc progresses on column 3
Beuhc progresses on column 8
Beuhc progresses on column 8
Beuhc progresses on column 8
Beuhc progresses on column 8
Beuhc progresses on column 8
Beuhc progresses on column 8
Beuhc progresses on column 10
Beuhc progresses on column 3
Beuhc progresses on column 3
Beuhc progresses on column 8
Beuhc progresses on column 10
Beuhc progresses on column 8
Beuhc progresses on column 3

----------------

Beuhc wins column 11
Beuhc wins column 4
Beuhc chooses to stop
Beuhc progresses on column 4
Beuhc progresses on column 11
Beuhc progresses on column 11
Beuhc progresses on column 4
Beuhc progresses on column 4
Beuhc progresses on column 4
Beuhc progresses on column 11
Beuhc progresses on column 5
Beuhc progresses on column 4
Beuhc progresses on column 11
Beuhc progresses on column 5
14:31
Beuhc progresses on column 5
Beuhc progresses on column 4
Beuhc progresses on column 11
Beuhc progresses on column 4
User avatar
RicardoRix
Posts: 2540
Joined: 29 April 2012, 23:43

Re: Is the code available to review?

Post by RicardoRix »

To progress 11 times of 3,8,10 = (0.8333) ^ 11 = 13.45 %

To progress 11 times of 4,5,11 = (0.7785) ^ 11 = 6.3 %

*A slight over simplification because they might advanced 2 times in one round, or if they win a column and then continue going afterwards the odds will change.

As suggested, even if the number is not random, then this would still mean that somehow the game relates the dice throws to the columns the players are climbing...
User avatar
SluggerBaloney
Posts: 83
Joined: 07 February 2020, 14:26

Re: Is the code available to review?

Post by SluggerBaloney »

Deleted
Last edited by SluggerBaloney on 12 January 2024, 16:49, edited 2 times in total.
User avatar
SluggerBaloney
Posts: 83
Joined: 07 February 2020, 14:26

Re: Is the code available to review?

Post by SluggerBaloney »

Deleted
Last edited by SluggerBaloney on 12 January 2024, 16:49, edited 2 times in total.
User avatar
Jest Phulin
Posts: 1856
Joined: 08 July 2013, 21:50

Re: Is the code available to review?

Post by Jest Phulin »

SluggerBaloney wrote: 20 May 2020, 18:18
Jest Phulin wrote: 20 May 2020, 08:18 And, your bolded statement that "PHP doesn't generate the number, the underlying OS does" implies there is a problem with the underlying OS being able to perform that function.
No it doesn't. Don't put words in my mouth and then criticize me for them. That is antagonistic and shifting the discussion towards attacking the person rather than discussing the topic.
OK. The topic.
SluggerBaloney wrote: 13 May 2020, 01:38 I do not believe the game is coded correctly based on the results I have been seeing. The randomizer does not appear to be properly implemented.
What results are you seeing that make you believe the game is not coded correctly?
User avatar
SluggerBaloney
Posts: 83
Joined: 07 February 2020, 14:26

Re: Is the code available to review?

Post by SluggerBaloney »

Deleted
Last edited by SluggerBaloney on 12 January 2024, 16:48, edited 2 times in total.
User avatar
RicardoRix
Posts: 2540
Joined: 29 April 2012, 23:43

Re: Is the code available to review?

Post by RicardoRix »

SluggerBaloney wrote: 20 May 2020, 19:00 I've been looking at some of the numbers coming up in my games, and in my (limited) view of the results, rolling 3 of a kind seems to be happening far more than it should. Mathematically, 3 of a kind should be rolled about 1 every 11 rolls. It's coming up for me about 1 in every 6 rolls.
If you roll triples then this is when your climbers fall most often due to a lack of combinations.

So we have one of you complaining about falling down too often, and another posting all of his lucky opponents storming to victory. The two ends of the luck spectrum - combine your findings and your back to the law of averages. Both can't be true.

About the doubted programming. How exactly does one roll meant to effect the other if you roll 3 of a kind?
Even between turns the server does not have any reference to previous throws.
Can you explain how any potentially skewed randomness would show up in this manner? What exactly in the code would you be looking for? Do you have any hypothetical examples?

According to the games page, Can't Stop is BGA developed, the same people who came up with the BGA_rand function and had it tested to the umpteenth degree, and who's professional existence relies upon providing an enjoyable experience to it's users. Without any publicly available statistical data to analyse, I know which side I'm more willing to believe.

You can if you like make a BGA studio account and make a test project. And then do any statistical test you like which will be running on the same game servers.
Post Reply

Return to “Can't Stop”