Some semi-random thoughts on terrain generation
I'm gonna try my luck with the lake generator.

What I'm thinking is, make a cBlockArea object to hold the lake, fill it with "no action" blocktype, then hollow out a random number of round "bubbles"; fill those with the liquid, if it's lava, make the boundary stone. Then merge the blockarea into the generated chunk using a special merge strategy:
- "no action" blocktype doesn't modify the generated chunk
- liquid blocktype overwrites only stone, dirt, grass, gravel, netherrack or mycelium in the generated chunk
- stone overwrites only dirt or grass in the generated chunk (but not air!)
- air overwrites anything but liquids in the generated chunk
This way, even if a lake is generated inside ocean, it shouldn't be much of a trouble - it wouldn't disturb the ocean, maybe just hollow out its bottom a bit. If a lava lake generates on the surface, its boundary will be stone; at the same time if there is a block on its boundary missing, it will allow the lava to flow out of the lake (good).

The lake's XZ position will be based on a random displacement of the chunk's center coords by a capped amount of blocks, so that only a few lakes can actually intersect any given chunk. The Y position will be capped at the max height in the chunk for which the lake is generated. Thanks to HeightGenCache, that should add only a minimal overhead.
Reply
Thanks given by: NiLSPACE


Messages In This Thread
RE: Some semi-random thoughts on terrain generation - by xoft - 03-18-2013, 04:33 AM



Users browsing this thread: 41 Guest(s)