Procedural generation w/time component

This topic is 3210 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Share on other sites
Never mind -- I think I came up with a solution. :)

If you use a random number generator that lets you "seek" ahead by an arbitrary number of random values, you can take the original non-gridded algorithm, start your random number generator at the seed value for the region, then seek ahead in time to one generation of trees before the current time, then only play back that single generation. Because obviously every tree that died before then is already dead and gone and doesn't need to be considered.

One possible complicating factor would be if you had constraints on new tree placement that take into account older trees (i.e., don't put things too close together). However, that could be worked around if your placement algorithm was convergent (i.e., you try to get as close to the randomly selected location as possible) and you played back a couple generations.

On this topic: anyone know of a random number generator that lets you seek ahead in constant time? I.e., instead of having to read 1 billion throwaway random numbers to see what the 1-billion-and-oneth random value will be, simply being able to seek 1 billion random numbers and getting the 1-billion-and-oneth random value. It wouldn't need to be true randomness, of course -- just close enough.

[Edited by - KarenRei on March 2, 2010 5:07:22 PM]

Share on other sites
Oh, heck, I just figured out how to do that, too! Instead of using your random numbers as you get them normally (one after another, each built on the last, with only a seed call at the beginning), you have your first random number be seeded with RegionSeed, your second random number be seeded with RegionSeed + 1, your third with RegionSeed + 2, and so forth. So if you want the billionth random number for the region, you seed it with RegionSeed + 1,000,000,000. That would work fine unless there was a lot of overhead on seeding.

I guess I just needed to talk this out. Thanks anyway, everyone!

[Edited by - KarenRei on March 2, 2010 5:19:33 PM]

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• Forum Statistics

• Total Topics
633735
• Total Posts
3013593
×