Asked March 9, 2022 9:47 AM:
When I use the same runtime input, will it produce the exact same results?
e.g. no random factor is used.
I would like to be able to use selection of random seeds and use that to produce for example building layouts. However, when the player would return to same area the buildings should look exactly the same. I would only need to store placement and seed(s).
Thanx. It looks very impressive and seems to fit my needs.
Yes, it can be used in a fully deterministic way so that the same input values will produce the same output. Having one (or more) seed values as input will allow lots of variety and yet be reproducible. This is exactly what I’m doing in this video where each room has a seed (and size/entrances) which is used when it is regenerated each time the player approaches it, and being discarded when no-longer nearby.
Even when fully deterministic you can introduce variation as long as you use the input seed (or a seed derived from it) to drive the generation choices. The RandomRange operators take a seed value for this reason, also producing a new seed value to allow chaining together of random number production. There is also a RandomTwist operator for ‘jumping tracks’ of the random stream which is needed in some cases to avoid repetition, e.g. seeding a 2D grid of objects. This blog post covers some of this in detail if you want to know more.
I hope this helps, happy to answer questions.
Sam