Random Has Non-Deterministic Behavior

Reporter: RobertBColton  |  Status: open  |  Last Modified: January 19, 2019, 09:12:14 PM

Ok, so while writing some drawing tests with a fixed random seed, I ran into this problem.

for (i = 0; i < 3; i += 1) {

This always produces 3, 5, 9 in GM8 for me, but in ENIGMA the second two numbers are not correct. This has to do with the fact that the next seed chosen by ENIGMA is not based on the current seed, making the behavior totally non-deterministic.

I get the same results in GMSv1.4 except the numbers are always 1, 8, 8.

@RemoveRusky correctly found the issue for me, which is here:

enigma::Random_Seed = mtrandom32();
The random() regression did show up at some point and is now being picked up by the test harness. Fortunately, this is non-fatal (for now), as the added failures are not affecting the game's return code. This would mean that our tests are broken, but random() is presently the only test suite using gtest_expect_ rather than gtest_assert_. So we can probably fix both in one go.
Please sign in to post comments, or you can view this issue on GitHub.