I'm using setSeed for seeded runs in a game and was really surprised by the behavior. Two main issues:
- The only valid input seems to be positive numbers. Passing a string would be really useful, but for both strings and negative numbers, the state is always the same. The first uniform is:
2.3283064365386963e-10
- There is no avalanche effect. Similar seeds produce similar random numbers at least for the first one.
123 produces 0.0599007117561996 and 124 produces 0.060387709410861135. The numbers do diverge after that first uniform value, so it's probably easy enough to just throw away the first value?
Perhaps these are known behaviors, but from the developer perspective I found them really confusing... and it's quite easy to write some broken randomness by not knowing it. Even some notes on the docs would help out a lot.
I'm using
setSeedfor seeded runs in a game and was really surprised by the behavior. Two main issues:2.3283064365386963e-10123produces0.0599007117561996and124produces0.060387709410861135. The numbers do diverge after that first uniform value, so it's probably easy enough to just throw away the first value?Perhaps these are known behaviors, but from the developer perspective I found them really confusing... and it's quite easy to write some broken randomness by not knowing it. Even some notes on the docs would help out a lot.