Closed kralverde closed 2 weeks ago
Hey i actually never heard of XOROshiro128. Can you may explain a bit?. It looks like its an random generator. I wonder where Mojang uses this implementation
I also found that rust rand
crate has xoshiro128 aswell
https://github.com/rust-random/rand/blob/79f1b0ffdbc8605c99ce8348d40ee073a2a7bd0f/src/rngs/xoshiro128plusplus.rs#L17
I never heard of it either, my code is basically 1-1 of the Minecraft Java. I saw the rust crate too, but it gives different values for the same seed as the Minecraft one
Actually let me double check myself
Yeah, I just used this as a wrapper around the rust implementation and the tests failed. It may have been user error, but this works and I think is good enough (TM)
We can always come back to it and change the internals, I just wanna get a stepping stone for chunk generation out of the way
Oh, i think I spotted an error on my side. Alright I'm hooked now, I'll see if I can get the rust crate working as a back-end implementation
I can confirm that the rust implementation uses different magic numbers than the java version. I refactored a bit, but I am confident that this is what we should use for the XorOshiro128 implementation
Thank you @kralverde
A rust implementation of one of Minecraft's RNGs: XOROshiro128, including tests cases against the results of equivalent java code