A common (in my experience) requirement for seeded random generators is the ability to seed sub-generators. Among other things, this allows a single master seed to create many random sources which can be used for different parts of a simulation independently (e.g. one for terrain height-maps, one for cloud generation, one for AI, etc.).
Sub-generators are not created with the same seed as their parent (as this would make all generators identical), but rather with a random value chosen by the parent. With the current API, the required code would be:
But this will not give access to the full range of possible seeds due to numeric precision. A better option would be to populate a typed array with values and use that as a seed, but this is very verbose.
Please make it possible to pass an existing PRNG as a seed for a new PRNG:
A common (in my experience) requirement for seeded random generators is the ability to seed sub-generators. Among other things, this allows a single master seed to create many random sources which can be used for different parts of a simulation independently (e.g. one for terrain height-maps, one for cloud generation, one for AI, etc.).
Sub-generators are not created with the same seed as their parent (as this would make all generators identical), but rather with a random value chosen by the parent. With the current API, the required code would be:
But this will not give access to the full range of possible seeds due to numeric precision. A better option would be to populate a typed array with values and use that as a seed, but this is very verbose.
Please make it possible to pass an existing PRNG as a seed for a new PRNG:
This is distinct from the proposed API for cloning a PRNG:
But could cause some confusion due to the similarity.