I'm wondering how one could use a PRNG with a given seed to get same results even when multithreading the process.
Clarifications:
The world will be using a Coherent Noise such as Perlin or Simplex to generate height, this noise would be determined by a World Seed
. Then I would want each chunk to generate some randomness such as how many trees are placed within the chunk, where the trees are placed, how many flowers should be placed and etc. This randomness should be the same every time the same World Seed
is given. The chunks could be loaded in different order each run of the game depending on what direction the player came from, (If the player came from the north it would have a different order then if the player came from the south).
How do I use a Seeded RNG across threads in a way that chunks can be generated in any order and still get the same result as it did the last time.
Edit:
The solution is probably using the chunk position (which would be x, y Coordinates) and the world seed to generate a new PRNG for each of the chunks. However this would mean that each chunk would need to generate a new PRNG to get some amount of random numbers, is that really the best way to avoid the problem?