P0-P-172: Part 101: Object Generator
My solution to render the trees correctly (and repeatably) on the client and the server is to use the existing quadtree system of the terrain.
I will add a custom “seed” value to each terrain chunk, which will be based on its parent seed. This means that as the chunks subdivide, and more child chunks are generated, I will end up with the same chunkseed numbers each time.
I will then use these chunkseed values to generate the random locations for the trees, or other objects. I am actually using rocks for now, because I have rock objects available.
This system seems to be working well so far, I can reproduce the seed values every time.
I now need to decide how to store the individual objects being generated on each chunk, and load them in and out of the scene.
This could be difficult, since I intend to support reasonably dense forests and clusters of objects.