From 80e1eb37ddfcbd224fe1d3491201ba8db3e1114f Mon Sep 17 00:00:00 2001
From: Mattes D This article explains the principles behind the terrain generator in MCServer. It is not strictly
-specific to MCServer, though, it can be viewed as a generic guide to various terrain-generating algorithms,
-with specific implementation notes regarding MCServer. This article explains the principles behind the terrain generator in Cuberite. It is not strictly
+specific to Cuberite, though, it can be viewed as a generic guide to various terrain-generating algorithms,
+with specific implementation notes regarding Cuberite. Contents:
Generating terrain in MCServer
-Generating terrain in Cuberite
+
@@ -80,7 +80,7 @@ neighboring chunks.
This leads us directly to the main pipeline that is used for generating terrain in MCServer. For +
This leads us directly to the main pipeline that is used for generating terrain in Cuberite. For technical reasons, the terrain composition step is further subdivided into Height generation and Composition generation, and the structures are really called Finishers. For each chunk the generator generates, in this sequence: @@ -131,7 +131,7 @@ generated for any number of dimensions.
The easiest way to generate biomes is to not generate them at all - simply assign a single constant biome to everywhere. And indeed there are times when this kind of "generator" is useful - for the MineCraft's Flat -world type, or for testing purposes, or for tematic maps. In MCServer, this is exactly what the Constant +world type, or for testing purposes, or for tematic maps. In Cuberite, this is exactly what the Constant biome generator does.
Of course, there are more interesting test scenarios for which multiple biomes must be generated as easy @@ -175,7 +175,7 @@ gives us the seed's X position. We use another Perlin noise and the same calcula seed.
Here's an example of a biome map generated using the Voronoi + jitter grid, as implemented by the Voronoi -biome generator in MCServer:
+biome generator in Cuberite:The following image shows the effects of the change, as generated by MCServer's DistortedVoronoi biome +
The following image shows the effects of the change, as generated by Cuberite's DistortedVoronoi biome generator. It is actually using the very same Voronoi map as the previous image, the only change has been the addition of the distortion:
@@ -241,7 +241,7 @@ either add them somewhere into the decision diagram, or we can make the generato -This is the approach implemented in MCServer's MultiStepMap biome generator. It generates biome maps like +
This is the approach implemented in Cuberite's MultiStepMap biome generator. It generates biome maps like this:
@@ -296,10 +296,10 @@ generator uses distortion before querying the small areas.The following image shows an example output of a TwoLevel biome generator in MCServer:
+The following image shows an example output of a TwoLevel biome generator in Cuberite:
-Note that rivers are currently not implemented in this generator in MCServer, but they could be added +
Note that rivers are currently not implemented in this generator in Cuberite, but they could be added using the same approach as in MultiStepMap - by using a thresholded 2D Perlin noise.
@@ -332,12 +332,12 @@ suddenly become smooth. The following image shows the situation from the previou the averaging process: -The approach used in MCServer's Biomal generator is based on this idea, with two slight modifications. +
The approach used in Cuberite's Biomal generator is based on this idea, with two slight modifications. Instead of using a separate generator for each biome, one generator is used with a different set of input parameters for each biomes. These input parameters modify the overall amplitude and frequency of the Perlin noise that the generator produces, thus modifying the final terrain with regards to biomes. Additionally, the averaging process is weighted - columns closer to the queried column get a more powerful weight in the sum -than the columns further away. The following image shows the output of MCServer's Biomal terrain height +than the columns further away. The following image shows the output of Cuberite's Biomal terrain height generator (each block type represents a different biome - ocean in the front (stone), plains and ice plains behind it (lapis, whitewool), extreme hills back right (soulsand), desert hills back left (mossy cobble)):
@@ -425,7 +425,7 @@ snow, for example. into an ice block if the biome is cold. This means that any water block that is under any kind of other block, such as under a tree's leaves, will still stay water. Thus an additional improvement could be made by scanning down from the surface block through blocks that we deem as non-surface, such as leaves, torches, -ladders, fences etc. Note that MCServer currently implements only the easy solution. +ladders, fences etc. Note that Cuberite currently implements only the easy solution.Most worlds in MineCraft have lava lakes at their bottom. Generating these is pretty straightforward: Use @@ -433,7 +433,7 @@ the user-configured depth and replace all the air blocks below this depth with l that this makes this generator dependent on the order in which the finishers are applied. If the mineshafts generate before bottom lava, the mineshafts that are below the lava level will get filled with lava. On the other hand, if bottom lava is generated before the mineshafts, it is possible for a mineshaft to "drill -through" a lake of lava. MCServer doesn't try to solve this and instead lets the admin choose whichever they +through" a lake of lava. Cuberite doesn't try to solve this and instead lets the admin choose whichever they prefer.
MCServer uses an approximation of the above curves to choose the height at which to generate the +
Cuberite uses an approximation of the above curves to choose the height at which to generate the spring.