Improve Random Block Selection RNG#11537
Conversation
|
Thank you for the PR. We are not going to deviate from vanilla's logic at the whim that it "looks more random". |
|
I remember some fork a while ago attempted to optimize block update RNG at some point. @ScriptLineStudios If you can prove that this RNG pattern causes problems, you would need to raise issues with Mojang directly? Otherwise it must have been a deliberate choice, the same magic number is used here as an increment:
|
|
Hi, I know that this PR is old but I wanted to clarify something. Paper uses an LCG random for random block selection during random ticking. Specifically, we take the lower 12 bits of Random#nextInt(). If you find an issue with this implementation, you may open an issue on https://github.com/Tuinity/Moonrise. |
The RNG used in selecting random blocks for updates, is fundamentally flawed, plotting some values sampled from this RNG clearly indicates the problem:
Modifying the algorithm to include a couple more terms yields a much nicer and random looking result:
Additionally this PR removes the deprecated threadSafeRandom object used for providing the client with seeds for sound variant selection in favor of using the improved randValue :D