-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace the PRNG #31
Comments
Note: I'd be very happy to use a simple-as-possible custom PRNG in C# to On 21 September 2016 at 21:03:38, Yannick Lohse ([email protected])
|
Well, inkjs currently uses this one, if you want to have a look at it. They hardly come simpler than that :-) |
Yup, looks ideal! Let's do that then. On 21 September 2016 at 21:17:14, Yannick Lohse ([email protected])
|
If you want a super simple PRNG then I'd recommend Xorshift. It usually scores better on tests than LCGs. |
@joethephish @y-lohse Is this feature still in any demand? It seems like something good I could tackle to learn more about RNG implementation. |
Not sure! I'm going to take a wild guess here and say that @joethephish would still like to switch the PRNG in ink, but is busy creating a game. |
I'm in favour of both having a super simple/lightweight (but effective!) implementation that's the same for both. But yeah, it's not a huge priority for me, but having consistency between CS#/JS would be cool! |
I used this in an Inform project when I wanted reproducible cross platform random seeds. The third one is called xorshift* and is extremely reliable for the code size - only one word of state and 7 operations! https://gist.github.com/Marc-B-Reynolds/0b5f1db5ad7a3e453596 I'd be happy to do up PRs for both implementations if you'd be interested. |
Sounds good to me :) |
It doesn't appear that Hmm, could either of you help me by explaining briefly how NextSequenceShuffleIndex works? Edit: I think I mostly understand. You're not storing the actually shuffled list, so you have to recreate it based on the hash of the container and the storyseed. That means the whole thing will change if SeedRandom is called, right? |
Align the PRNG in inkjs with the C# version so the randomness is the same on all platforms.
The C# version can be found here.
If someone with an up and running C# env wants to tackle this one, feel free to grab it!
The text was updated successfully, but these errors were encountered: