Cuberite Forum
Some semi-random thoughts on terrain generation - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Some semi-random thoughts on terrain generation (/thread-409.html)



RE: Some semi-random thoughts on terrain generation - xoft - 07-13-2012

Ah, found the culprit for air-based trees. They were generated for an offset pair of coords (GetTreeImageByBiome added 3 and 5 to coords before passing them to GetJungleTreeImage)


RE: Some semi-random thoughts on terrain generation - NiLSPACE - 07-13-2012

so the jungle trees are fine nowBig Grin


RE: Some semi-random thoughts on terrain generation - xoft - 07-13-2012

Not yet. Either they're slow, or they overwrite logs with leaves. Need to fix that. But I'm going to bed now 'cause I haven't slept much last night and I look like a zombie nowTongue


RE: Some semi-random thoughts on terrain generation - NiLSPACE - 07-13-2012

sleep well Smile


RE: Some semi-random thoughts on terrain generation - xoft - 07-14-2012

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]


RE: Some semi-random thoughts on terrain generation - NiLSPACE - 07-14-2012

wow that is a big difference :S when did you figure it out??Tongue


RE: Some semi-random thoughts on terrain generation - xoft - 07-14-2012

I ran across a similar issue while writing ravines, now that I've been working with trees again, I tried the alternate approach and was amazed as to how much that tiny change helped.


RE: Some semi-random thoughts on terrain generation - xoft - 07-15-2012

Jungle trees committed. Now all they need is branches. And maybe better shaped leaves around the top, these look much better:
http://www.minecraftwiki.net/wiki/File:JebJungle.jpg

Also, I got rid of the vines on trunk because they were't written good enough. If someone is brave enough to try, be my guest.


RE: Some semi-random thoughts on terrain generation - xoft - 07-22-2012

I did some experimental dissection of vanilla minecraft to see how it generates caves. I think the results are worth sharing, so here's a video:

Basically, I made MC-server read an Anvil world created by vanilla MC, and upon reading it, "invert" the ground - everything solid was replaced by air and original air was replaced by stone. This produces solid "worms" where the caves were.
Btw. this is exactly what Rev 690 does, when enabled Smile


RE: Some semi-random thoughts on terrain generation - FakeTruth - 07-22-2012

Cool :o