Source Code

Discussions about BGA (all languages)
Forum rules
Warning: challenging a moderation in Forum = 10 days ban
More info & details about how to challenge a moderation: viewtopic.php?p=119756
User avatar
nik592
Posts: 1390
Joined: 16 October 2022, 13:54

Re: Source Code

Post by nik592 »

Jellby wrote: 18 July 2024, 14:01 Even if it's just calls to random functions, they could find things like: But most likely, they'll just claim that's not the real code.
Which are absolutely bugs and should be (and have been) reported. Though, those kind of bugs still randomly favour different players, you still have to get "lucky" for them to fall in your favour.
User avatar
tchobello
Posts: 693
Joined: 18 March 2012, 13:19

Re: Source Code

Post by tchobello »

maveleo wrote: 02 July 2024, 09:21 Anyone knows where is post to see the source code of the various games in this platform?
We do not create our own random methods and BGA uses Mersenne Twister, MT19937. You should be relieved, no ?
User avatar
Nekojin
Posts: 121
Joined: 28 March 2024, 01:21

Re: Source Code

Post by Nekojin »

tchobello wrote: 18 July 2024, 19:02
maveleo wrote: 02 July 2024, 09:21 Anyone knows where is post to see the source code of the various games in this platform?
We do not create our own random methods and BGA uses Mersenne Twister, MT19937. You should be relieved, no ?
Thank you for that. MT19937 has a period of 2^19937-1, which means that it could take octillions* of numbers before it starts repeating itself. This is vastly more than a simple dice-roller like Catan would need, and is even robust enough to generate a few billion games of Terraforming Mars in sequence before a trackable and exploitable repetition could be found. And, of course, all of these games are not generated in sequence, each game has its own seed.

* I may be off by a few (million) orders of magnitude on this. There are no online calculators that can explain that period in a long-form number.
User avatar
Silene
Posts: 980
Joined: 23 October 2013, 17:50

Re: Source Code

Post by Silene »

This person asked nicely for help in where to see the source code. They even voiced their concern only after they were asked.
Asking for source and then actually looking at it is the absolutely best thing one can do when having doubts about something. It deserves respect. No need to bash them or assume their reaction while they didn't even have a chance to do their digging.
Check out the Allround-League: https://boardgamearena.com/group?id=7870115 --> a league where you have matches of random games vs. other players in your group. Season 9 registration oct. '25.
Gulchen
Posts: 220
Joined: 01 October 2017, 06:55

Re: Source Code

Post by Gulchen »

Another possible thing maveleo might find is code that chooses an index for

[ (1,1) , (1,2) , (2,2) , (1,3) , (2,3) , (3,3) , (1,4) , (2,4) , (3,4) , (4,4) , (1,5) , (2,5) , (3,5) , (4,5) , (5,5) , (1,6) , (2,6) , (3,6) , (4,6) , (5,6) , (6,6) ]

, ​ rather than choosing from (1,2,3,4,5,6) twice independently.


(Such code being used would mean the claims of too-many-doubles were accurate.)
User avatar
tchobello
Posts: 693
Joined: 18 March 2012, 13:19

Re: Source Code

Post by tchobello »

Silene wrote: 18 July 2024, 19:27 This person asked nicely for help in where to see the source code. They even voiced their concern only after they were asked.
Asking for source and then actually looking at it is the absolutely best thing one can do when having doubts about something. It deserves respect. No need to bash them or assume their reaction while they didn't even have a chance to do their digging.

Code: Select all

$armory_choice_key = bga_rand( 0, count( $armory_choices ) -1 );
is it gonna help ?
User avatar
Meeplelowda
Posts: 3836
Joined: 14 March 2020, 10:31

Re: Source Code

Post by Meeplelowda »

Gulchen wrote: 18 July 2024, 20:09 Another possible thing maveleo might find is code that chooses an index for

[ (1,1) , (1,2) , (2,2) , (1,3) , (2,3) , (3,3) , (1,4) , (2,4) , (3,4) , (4,4) , (1,5) , (2,5) , (3,5) , (4,5) , (5,5) , (1,6) , (2,6) , (3,6) , (4,6) , (5,6) , (6,6) ]

, ​ rather than choosing from (1,2,3,4,5,6) twice independently.


(Such code being used would mean the claims of too-many-doubles were accurate.)
Was this ever actually done in a game, or is it just theoretically a mistake someone could make?
Play Now lobby 4ever! https://boardgamearena.com/lobby
Gulchen
Posts: 220
Joined: 01 October 2017, 06:55

Re: Source Code

Post by Gulchen »

Meeplelowda wrote: 18 July 2024, 23:04
Gulchen wrote: 18 July 2024, 20:09...
Was this ever actually done in a game, or is it just theoretically a mistake someone could make?
It is just theoretically a mistake someone could make.
User avatar
GTSchemer
Posts: 1130
Joined: 09 August 2013, 03:26

Re: Source Code

Post by GTSchemer »

Gulchen wrote: 19 July 2024, 05:41 It is just theoretically a mistake someone could make.
The problem with this sort of thing is that it is a combination of ignorant and insulting to those of us who are developers and have spent years carefully making the various game modules on here.

If someone truly, in good faith, is interested in double checking the dice code for a certain game, they could say "May I please see the dice code for Go Goa? I understand curve-fitting, have basic knowledge of statistics, and basic understanding of source code."

Someone might say "I played 5 games, carefully recorded the dice rolls for each, and the after applying a curve fitting check, it does not fit within reasonable margin."


In that case, I could say "Sure, here you go:"

Code: Select all

      $new_dice_values = [];
      $new_dice_values[] = bga_rand(1, 6);
      $new_dice_values[] = bga_rand(1, 6);
      $new_dice_values[] = bga_rand(1, 6);

But the problem is, users almost never do this. Instead, threads go down rabbit holes, e.g. suggesting "Here is some mistake which might theoretically be made." Not because they have a careful summary of dice rolls in 10 consecutive games, not because they have seen the source code, but because they have a feeling.

Sure, in THEORY someone might implement XKCD's getRandomNumber() function https://xkcd.com/221/ or any other silly approach, but they almost certainly haven't.

And above all, when some of us are spending literally years carefully adjusting every detail of a game implementation, it is tremendously draining to attempt to convince someone of basic source code functionality when they likely do not have the background, domain knowledge, or attitude where it would make a meaningful difference.

This is why these threads are largely ignored. Because I know my code has bga_rand(1, 6), and you know it does, and suggesting something is still wrong with this carries a very high burden of proof.
User avatar
nik592
Posts: 1390
Joined: 16 October 2022, 13:54

Re: Source Code

Post by nik592 »

This is the thing - devs (usually) put a lot of work into making sure games work properly, and appropriate randomness is a big part of that. Most complaints tend to stem from one or maybe a few games where a user FEELS they've been unlucky, or another player has been too lucky. There's no attempt to record data objectively, even though that's the next logical step if you think there's an actual issue. To not put at least that work in can feel frustrating and disrespectful to the devs who put in all that hard work implementing the game for you.

Spoken as someone who has never developed a game for BGA, but is a developer in the real world, and still gets frustrated by people who don't appreciate the complexity of the job and the pride that (good) devs take in their work. Not saying there aren't lazy and/or bad devs, but like most professions, they're usually the exception.
Post Reply

Return to “Discussions”