From 345d4778499494616a0fac8568fbefa881627285 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 2 Jun 2014 21:43:07 +0200 Subject: Generator article: Finished the Biome-gen section and images. --- docs/Generator.html | 39 ++++++++++++++++++++++++-------------- docs/img/multistepmapdistance.jpg | Bin 0 -> 44859 bytes docs/img/multistepmapgrid.jpg | Bin 0 -> 62455 bytes docs/img/perlinrivers.jpg | Bin 0 -> 58103 bytes docs/img/twolevellargeareas.jpg | Bin 0 -> 47661 bytes docs/img/twolevelsmallareas.jpg | Bin 0 -> 67231 bytes docs/img/twolevelsmallgrid.jpg | Bin 0 -> 122477 bytes docs/img/voronoi.png | Bin 0 -> 19306 bytes 8 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 docs/img/multistepmapdistance.jpg create mode 100644 docs/img/multistepmapgrid.jpg create mode 100644 docs/img/perlinrivers.jpg create mode 100644 docs/img/twolevellargeareas.jpg create mode 100644 docs/img/twolevelsmallareas.jpg create mode 100644 docs/img/twolevelsmallgrid.jpg create mode 100644 docs/img/voronoi.png (limited to 'docs') diff --git a/docs/Generator.html b/docs/Generator.html index b7586a183..0963f8505 100644 --- a/docs/Generator.html +++ b/docs/Generator.html @@ -109,7 +109,7 @@ biome generator does.

Of course, there are more interesting test scenarios for which multiple biomes must be generated as easy as possible. For these special needs, there's a CheckerBoard biome generator. As the name suggests, it -generates a grid of biomes.

+generates a grid of alternating biomes.

Voronoi diagram

Those two generators were more of a technicality, we need to make something more interesting if we're @@ -117,7 +117,7 @@ going for a natural look. The Voronoi generator is the first step towards such a Voronoi diagram is a construct that creates a set of areas where each point in an area is closer to the appropriate seed of the area than the seeds of any other area:

- +

To generate biomes using this approach, you select random "seeds", assign a biome to each one, and then for each "column" of the world you find the seed that is the nearest to that column, and use that seed's @@ -218,19 +218,24 @@ either add them somewhere into the decision diagram, or we can make the generato this:

-

To decide whether the point is in the ocean, land or mushroom, the generator uses a DistortedVoronoi -approach where the seeds get the "ocean", "land" and "mushroom" values; special handling is added so that a -mushroom value is always surrounded by ocean values on all 8 sides:

- +

To decide whether the point is in the ocean, land or mushroom, the generator first chooses seeds in a grid +that will be later fed to a DistortedVoronoi algorithm, the seeds get the "ocean" and "land" values. Then it +considers all the "ocean" seeds that are surrounded by 8 other "ocean" seeds and turns a random few of them +into "mushroom". This special seed processing makes the mushroom biomes mostly surrounded by ocean. The +following image shows an example seeds grid that the generator might consider, only the two framed cells are +allowed to change into mushroom. L = land, O = ocean:

+ -

For the Voronoi cells that are calculated as mushroom, the distance to the nearest-seed is used to -further shrink the mushroom biome and then to distinguish between mushroom and mushroom-shore:

- +

Next, the generator calculates the DistortedVoronoi for the seeds. For the areas that are calculated as +mushroom, the distance to the nearest-seed is used to further shrink the mushroom biome and then to +distinguish between mushroom and mushroom-shore (image depicts a Voronoi cell for illustration purposes, it +works similarly with DistortedVoronoi). O = ocean, M = mushroom, MS = mushroom shore:

+

The rivers are added only to the areas that have been previously marked as land. A simple 2D Perlin noise is used as the base, where its value is between 0 and a configured threshold value, a river is created. This creates the rivers in a closed-loop-like shapes, occasionally splitting two branches off:

- +

For the leftover land biomes, the two Perlin noises, representing temperature and humidity, are used to generate the biomes, as described earlier. Additionally, the temperature map is used to turn the Ocean biome @@ -239,7 +244,7 @@ into FrozenOcean, and the River biome into FrozenRiver, wherever the temperature

Two-level Voronoi

The 1.7 MineCraft update brought a completely new terrain generation, which has sparked renewed interest in the biome generation. A new, potentially simpler way of generating biomes was found, the two-level -Voronoi generator.

+DistortedVoronoi generator.

The main idea behind it all is that we create large areas of similar biomes. There are several groups of related biomes that can be generated near each other: Desert biomes, Ice biomes, Forest biomes, Mesa biomes. @@ -253,13 +258,19 @@ the nearest seed's distance, but also the distance to the second-nearest seed; t is used as an indicator whether the column is in the "inside" or on the "outskirt" of the smaller Voronoi cell. This allows us to give certain biomes an "edge" biome - the Mushroom biome has a MushroomShore edge, the ExtremeHills biome have an ExtremeHillsEdge biome on the edge, etc.

-
-
-
+ +

The images below illustrate the process with regular Voronoi diagrams, for clarity purposes. The real +generator uses distortion before querying the small areas.

+
+
+

The following image shows an example output of a TwoLevel biome generator in MCServer:

+

Note that rivers are currently not implemented in this generator in MCServer, but they could be added +using the same approach as in MultiStepMap - by using a thresholded 2D Perlin noise.

+

Terrain height

diff --git a/docs/img/multistepmapdistance.jpg b/docs/img/multistepmapdistance.jpg new file mode 100644 index 000000000..74e972b2a Binary files /dev/null and b/docs/img/multistepmapdistance.jpg differ diff --git a/docs/img/multistepmapgrid.jpg b/docs/img/multistepmapgrid.jpg new file mode 100644 index 000000000..7e7bf870f Binary files /dev/null and b/docs/img/multistepmapgrid.jpg differ diff --git a/docs/img/perlinrivers.jpg b/docs/img/perlinrivers.jpg new file mode 100644 index 000000000..148348aff Binary files /dev/null and b/docs/img/perlinrivers.jpg differ diff --git a/docs/img/twolevellargeareas.jpg b/docs/img/twolevellargeareas.jpg new file mode 100644 index 000000000..4d6b418b1 Binary files /dev/null and b/docs/img/twolevellargeareas.jpg differ diff --git a/docs/img/twolevelsmallareas.jpg b/docs/img/twolevelsmallareas.jpg new file mode 100644 index 000000000..8bfa54ab3 Binary files /dev/null and b/docs/img/twolevelsmallareas.jpg differ diff --git a/docs/img/twolevelsmallgrid.jpg b/docs/img/twolevelsmallgrid.jpg new file mode 100644 index 000000000..29f61c8ac Binary files /dev/null and b/docs/img/twolevelsmallgrid.jpg differ diff --git a/docs/img/voronoi.png b/docs/img/voronoi.png new file mode 100644 index 000000000..e61e183ef Binary files /dev/null and b/docs/img/voronoi.png differ -- cgit v1.2.3