Fix Dice changes the misuse of the System.Random class, forcing every part of the game to use the default (and correct) behaviour to create random numbers. This is accomplished by patching the Random(int seed) constructor and switching the supplied seed with Environment.TickCount, in order to bypass the typically incorrect values used in the game’s original code.
In the source code, the game will try to “seed” the random number generator with bad input, which will produce demonstrably non-random outputs. For instance, the slot machine mini game in the casino re-seeds every lever pull with “times played slots + days played + unique id for this game.” The result of the expression is the same as the value used in the previous lever pull, plus one. Because of this, many consecutive games will produce a predictable win/loss pattern (LLLLLLLWLWLW… repeating) as seen here: https://www.youtube.com/watch?v=Z3DrzHecmk0
The specific length and pattern produced by the slot machine is dependent on several factors:
How many times you’ve played the slot machine
How many days you’ve played on the save file
The unique id generated when you created the save file
Your daily luck (as indicated by the fortune teller + luck modifying foods)
Your luck level (the invisible sixth skill which is leveled silently every time you perform a random action)
This bug affects many different parts of the game. The vendor in the sewer is seeded by “days played + (unique id / 2)”, which again produces the same seed as the day before plus one. Breaking rocks is seeded by “x * 1000 + y + days played + unique id / 2” with no regard for order of operations. Breaking a rock directly above or below another rock will use the same seed plus or minus one, which again produces non-random values. Crop harvests. Random events. Mine shaft slime floors. This bug affects many, if not all, of the platforms that Stardew Valley is released on.
This mod fixes the problem, which greatly improves the experience of the game. I hope to see a fix rolled out for all versions of the game some day.