Some semi-random thoughts on terrain generation
Wow. Just... wow! I found out that our random number generator is not so random after all, and it's not wise to divide or module the number it generates by powers of two directly. It's much better to first divide by a small prime and then divide or module by the power. Generates much better coverage Smile

What this means for terrain generation: trees are finally being placed randomly. Before, they were trying to form clumps at specific coords and thus weren't generated due to overlap.

An image is worth 1000 words, so here's the difference in two images:

Before the change. Note the rather large gaps where there are no trees:
[Image: jungle_before.png]

After the change. Note that the trees cover almost all ground. Ignore the lack of vines:
[Image: jungle_after.png]
Reply
Thanks given by:


Messages In This Thread
RE: Some semi-random thoughts on terrain generation - by xoft - 07-14-2012, 02:33 AM



Users browsing this thread: 7 Guest(s)