BuzzerBeater Forums

Bugs, bugs, bugs > Put at least some random in GE

Put at least some random in GE

Set priority
Show messages by
From: RSX

This Post:
00
263046.14 in reply to 263046.12
Date: 10/7/2014 9:51:03 AM
Overall Posts Rated:
181181
So how comes these two games are identical? Using srand with unix timestamp should give you different random values for these two games. I see no problem with C++ here (not to mention stdlib is a C library).

Last edited by RSX at 10/7/2014 9:51:20 AM

From: BB-Marin

To: RSX
This Post:
00
263046.15 in reply to 263046.14
Date: 10/8/2014 6:44:58 AM
TrenseRI
III.2
Overall Posts Rated:
36003600
Second Team:
ChiLeaders
I ask myself the same question: how? But it is. And Charles had the same problem, couldn't fix it. And he's a top notch programmer (understatement).

From: aamcguy

To: RSX
This Post:
00
263046.16 in reply to 263046.14
Date: 10/9/2014 12:29:42 PM
Overall Posts Rated:
1919
The problem with random number generators is that they aren't actually 100% random. Depending on how the stream is manipulated, even different seeds can create identical sequences for limited data sets.

Even with the limited chance of this happening, it could have all been avoided had at least one team played with a different attitude, had a different starting enthusiasm in game 1 so enthusiasm decay was different, set a different lineup, selected a different coach setting, played a different offense, played a different defense, or even guessed at their opponent's tactics.

Last edited by aamcguy at 10/9/2014 12:31:08 PM

From: RSX

This Post:
00
263046.17 in reply to 263046.16
Date: 10/9/2014 2:44:50 PM
Overall Posts Rated:
181181
If those two seeds were generating identical random numbers, then I'm pretty sure they would discover it quickly.

From: GM-hrudey

To: RSX
This Post:
00
263046.18 in reply to 263046.17
Date: 10/9/2014 3:01:40 PM
Overall Posts Rated:
32293229
If those two seeds were generating identical random numbers, then I'm pretty sure they would discover it quickly.


And this has happened on enough occasions that it wouldn't be likely to be the case anyhow. (Well, technically since it's random I suppose it's possible at a very low probability, but not as a practical consideration). I still wonder if it's a case of either the RNG instance being on the server/service level and not refreshing once created unless the server/service stops, or if it's a case of some call creating a new default random number generator rather than the one initialized with the time-based seed. I also am glad I am not the one who has to try to figure that out.

From: aamcguy

To: RSX
This Post:
11
263046.19 in reply to 263046.17
Date: 10/9/2014 3:12:40 PM
Overall Posts Rated:
1919
Without knowing how the generated numbers are being used, I can't comment more specifically. Different seeds would most definitely yield distinct streams of pseudo-random numbers.

However, the practical random number stream is influenced by how many possibilities they are testing for with each call to the random number and how many number of times the function is called. For example, if you are using a random number to check for a pass-fail--even if you weight the results due to player characteristics/strategy, etc--it still comes down to a test of even vs. odd numbers. So for each call, there would be between perhaps 30 to 70% of all random numbers that would allow the same result.

Now, the chances of this happening exactly the same way twice with different random number streams obviously decreases with each successive call (and even further if there are more complicated decisions happening), but it's not like an incredible lack of randomness gets noticed on a weekly basis.

People should be happy, given an assertion from admins that there are at least some random factors, that by and large if you build a strong team and make strong tactical choices you are going to get rewarded for it.