A new mapgen in C++ featuring a flat base terrain with three types of terrain variation - rolling hills, ridged and step (terraced) mountains.
The aim was to create a mapgen with a flat base, somewhere where you can build a village, even a city. But to differentiate it from the flat mapgen, the flat areas are surrounded by hills and various mountain ranges.
Features:
- Vast plains, average y-level between 5-10
- Rolling hills - small hills.
- Ridged mountains - mountains of a similar height will connect with a ridge.
- Step (terrace) mountains - mountains, sometimes a stair like effect.
- Fjords - particularly where the larger mountains meet the sea. Rare.
- Really big mountains - where two or even three mountain noise meet, spectacular and unpredictable peaks form.
Code: Select all
np_base = NoiseParams(12, 1, v3f(2557, 2557, 2557), 6538, 4, 0.8, 0.5);
// Creates the base terrain. The high spread and low lacunarity creates a very flat terrain. For where this is no hill/mountain noise, this is the ground you are walking on. I added an offset of 12 to create a base terrain that averages y-level between 5 and 10.
Code: Select all
np_filler_depth = NoiseParams(0, 1, v3f(128, 128, 128), 261, 3, 0.7, 2.0);
// Copied from MGV7. For biome filler - dirt, sandstone, etc.
Code: Select all
np_height1 = NoiseParams(0, 5, v3f(251, 251, 251), 9613, 5, 0.5, 2.0);
np_height2 = NoiseParams(0, 5, v3f(383, 383, 383), 1949, 5, 0.5, 2.0);
np_height3 = NoiseParams(0, 5, v3f(509, 509, 509), 3211, 5, 0.5, 2.0);
np_height4 = NoiseParams(0, 5, v3f(631, 631, 631), 1583, 5, 0.5, 2.0);
// The four height noises above are the primary noise in calculating hill/mountain height. There is some complex functions that create a weighted average height with the 3D np_mnt_var noise being the weight. Then getting minimum/maximum values from these combinations to create a "hilliness" variable. This essentially determines whether the hills/mountains are small (rolling) or large (mountains). Changing the scale (2nd value) will drastically change the height of mountains, and produce more hills/mountains and less flat terrain.
Code: Select all
np_hills_terrain = NoiseParams(1, 1, v3f(1301, 1301, 1301), 1692, 5, 0.5, 2.0);
np_ridge_terrain = NoiseParams(1, 1, v3f(1889, 1889, 1889), 3568, 5, 0.5, 2.0);
np_step_terrain = NoiseParams(1, 1, v3f(1889, 1889, 1889), 4157, 5, 0.5, 2.0);
// The magic that creates mountain ranges whilst leaving flat plains in the map. Adding to the offset and scale with create more and larger mountains. Lowering the spread will reduce the distance between mountain ranges and reduce the size of the flat plains.
Code: Select all
np_hills = NoiseParams(0, 3, v3f(257, 257, 257), 6604, 6, 0.5, 2.0);
np_ridge_mnt = NoiseParams(0, 12, v3f(743, 743, 743), 5520, 6, 0.7, 2.0);
np_step_mnt = NoiseParams(0, 8, v3f(509, 509, 509), 2590, 6, 0.6, 2.0);
// The spread determines the frequency of mountains. Usually a lower spread creates skinny mountains and a larger spread, wider mountains. But this is not always the case, as the height and terrain noises above play a big factor in the size also. If you want larger mountains of a certain type, add to the scale and increase the spread.
Code: Select all
np_mnt_var = NoiseParams(0, 1, v3f(499, 499, 499), 2490, 5, 0.6, 2.0);
// The only 3D noise I've added. Adds a small variation to mountains to create small overhangs, ridges/cliffs, etc. Can have a large influence when 2 or more mountain ranges meet, where the 3D noise will overlap as well, effectively doubled. This is where you can get some floating land, large overhangs or other strange rock formations. Decrease the scale and spread to minimize the influence.
Code: Select all
np_cave1 = NoiseParams(0, 12, v3f(61, 61, 61), 52534, 3, 0.5, 2.0);
np_cave2 = NoiseParams(0, 12, v3f(67, 67, 67), 10325, 3, 0.5, 2.0);
np_cavern = NoiseParams(0, 1, v3f(384, 128, 384), 723, 5, 0.63, 2.0);
// Copied from MGV7. 3 x 3D noises for caves/tunnels/caverns.
Screenshots:
Spoiler

Spoiler

Spoiler

Spoiler

Spoiler

Spoiler

Spoiler

Spoiler

Spoiler
