Skip to content

Commit

Permalink
Mapgen: Add Carpathian mapgen (#6015)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlapsley authored and nerzhul committed Jul 6, 2017
1 parent 6bedb6d commit a80ecbe
Show file tree
Hide file tree
Showing 9 changed files with 725 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/android/jni/Android.mk
Expand Up @@ -175,6 +175,7 @@ LOCAL_SRC_FILES := \
jni/src/mapblock.cpp \
jni/src/mapblock_mesh.cpp \
jni/src/mapgen.cpp \
jni/src/mapgen_carpathian.cpp \
jni/src/mapgen_flat.cpp \
jni/src/mapgen_fractal.cpp \
jni/src/mapgen_singlenode.cpp \
Expand Down
70 changes: 70 additions & 0 deletions builtin/settingtypes.txt
Expand Up @@ -1220,6 +1220,76 @@ mgv7_np_cave1 (Cave1 noise) noise_params 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0
# Second of 2 3D noises that together define tunnels.
mgv7_np_cave2 (Cave2 noise) noise_params 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0

[***Mapgen carpathian]

# Map generation attributes specific to Mapgen Carpathian.
# Flags that are not specified in the flag string are not modified from the default.
# Flags starting with 'no' are used to explicitly disable them.
mgcarpathian_spflags (Mapgen Carpathian specific flags) flags caverns caverns,nocaverns

# Controls width of tunnels, a smaller value creates wider tunnels.
mgcarpathian_cave_width (Cave width) float 0.09

# Y of upper limit of large pseudorandom caves.
mgcarpathian_large_cave_depth (Large cave depth) int -33

# Y-level of cavern upper limit.
mgcarpathian_cavern_limit (Cavern limit) int -256

# Y-distance over which caverns expand to full size.
mgcarpathian_cavern_taper (Cavern taper) int 256

# Defines full size of caverns, smaller values create larger caverns.
mgcarpathian_cavern_threshold (Cavern threshold) float 0.7

# 2D noise that defines the base ground level.
mgcarpathian_np_base (Base ground noise) noise_params 12, 1, (2557, 2557, 2557), 6538, 4, 0.8, 0.5

# Variation of biome filler depth.
mgcarpathian_np_filler_depth (Filler depth noise) noise_params 0, 1, (128, 128, 128), 261, 3, 0.7, 2.0

# First of 4 3D noises that together define hill/mountain range height.
mgcarpathian_np_height1 (Hilliness1 noise) noise_params 0, 5, (251, 251, 251), 9613, 5, 0.5, 2.0

# Second of 4 3D noises that together define hill/mountain range height.
mgcarpathian_np_height2 (Hilliness2 noise) noise_params 0, 5, (383, 383, 383), 1949, 5, 0.5, 2.0

# Third of 4 3D noises that together define hill/mountain range height.
mgcarpathian_np_height3 (Hilliness3 noise) noise_params 0, 5, (509, 509, 509), 3211, 5, 0.5, 2.0

# Fourth of 4 3D noises that together define hill/mountain range height.
mgcarpathian_np_height4 (Hilliness4 noise) noise_params 0, 5, (631, 631, 631), 1583, 5, 0.5, 2.0

# 2D noise that controls the size/occurance of rolling hills.
mgcarpathian_np_hills_terrain (Rolling hills spread noise) noise_params 1, 1, (1301, 1301, 1301), 1692, 3, 0.5, 2.0

# 2D noise that controls the size/occurance of ridged mountain ranges.
mgcarpathian_np_ridge_terrain (Ridge mountain spread noise) noise_params 1, 1, (1889, 1889, 1889), 3568, 3, 0.5, 2.0

# 2D noise that controls the size/occurance of step mountain ranges.
mgcarpathian_np_step_terrain (Step mountain spread noise) noise_params 1, 1, (1889, 1889, 1889), 4157, 3, 0.5, 2.0

# 2D noise that controls the shape/size of rolling hills.
mgcarpathian_np_hills (Rolling hill size noise) noise_params 0, 3, (257, 257, 257), 6604, 6, 0.5, 2.0

# 2D noise that controls the shape/size of ridged mountains.
mgcarpathian_np_ridge_mnt (Ridged mountain size noise) noise_params 0, 12, (743, 743, 743), 5520, 6, 0.7, 2.0

# 2D noise that controls the shape/size of step mountains.
mgcarpathian_np_step_mnt (Step mountain size noise) noise_params 0, 8, (509, 509, 509), 2590, 6, 0.6, 2.0

# 3D noise for mountain overhangs, cliffs, etc. Usually small variations.
mgcarpathian_np_mnt_var (Mountain variation noise) noise_params 0, 1, (499, 499, 499), 2490, 5, 0.6, 2.0

# First of 2 3D noises that together define tunnels.
mgcarpathian_np_cave1 (Cave1 noise) noise_params 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0

# Second of 2 3D noises that together define tunnels.
mgcarpathian_np_cave2 (Cave2 noise) noise_params 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0

# 3D noise defining giant caverns.
mgcarpathian_np_cavern (Cavern noise) noise_params 0, 1, (384, 128, 384), 723, 5, 0.63, 2.0

[***Mapgen flat]

# Map generation attributes specific to Mapgen flat.
Expand Down
92 changes: 92 additions & 0 deletions minetest.conf.example
Expand Up @@ -1484,6 +1484,98 @@
# type: noise_params
# mgv7_np_cave2 = 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0

#### Mapgen carpathian

# Map generation attributes specific to Mapgen Carpathian.
# Flags that are not specified in the flag string are not modified from the default.
# Flags starting with 'no' are used to explicitly disable them.
# type: flags possible values: caverns, nocaverns
# mgcarpathian_spflags = caverns

# Controls width of tunnels, a smaller value creates wider tunnels.
# type: float
# mgcarpathian_cave_width = 0.09

# Y of upper limit of large pseudorandom caves.
# type: int
# mgcarpathian_large_cave_depth = -33

# Y-level of cavern upper limit.
# type: int
# mgcarpathian_cavern_limit = -256

# Y-distance over which caverns expand to full size.
# type: int
# mgcarpathian_cavern_taper = 256

# Defines full size of caverns, smaller values create larger caverns.
# type: float
# mgcarpathian_cavern_threshold = 0.7

# 2D noise that defines the base ground level.
# type: noise_params
# mgcarpathian_np_base = 12, 1, (2557, 2557, 2557), 6538, 4, 0.8, 0.5

# Variation of biome filler depth.
# type: noise_params
# mgcarpathian_np_filler_depth = 0, 1, (128, 128, 128), 261, 3, 0.7, 2.0

# First of 4 3D noises that together define hill/mountain range height.
# type: noise_params
# mgcarpathian_np_height1 = 0, 5, (251, 251, 251), 9613, 5, 0.5, 2.0

# Second of 4 3D noises that together define hill/mountain range height.
# type: noise_params
# mgcarpathian_np_height2 = 0, 5, (383, 383, 383), 1949, 5, 0.5, 2.0

# Third of 4 3D noises that together definehill/mountain range height.
# type: noise_params
# mgcarpathian_np_height3 = 0, 5, (509, 509, 509), 3211, 5, 0.5, 2.0

# Fourth of 4 3D noises that together define hill/mountain range height.
# type: noise_params
# mgcarpathian_np_height4 = 0, 5, (631, 631, 631), 1583, 5, 0.5, 2.0

# 2D noise that controls the size/occurance of rolling hills.
# type: noise_params
# mgcarpathian_np_hills_terrain = 1, 1, (1301, 1301, 1301), 1692, 3, 0.5, 2.0

# 2D noise that controls the size/occurance of ridged mountain ranges.
# type: noise_params
# mgcarpathian_np_ridge_terrain = 1, 1, (1889, 1889, 1889), 3568, 3, 0.5, 2.0

# 2D noise that controls the size/occurance of step mountain ranges.
# type: noise_params
# mgcarpathian_np_step_terrain = 1, 1, (1889, 1889, 1889), 4157, 3, 0.5, 2.0

# 2D noise that controls the shape/size of rolling hills.
# type: noise_params
# mgcarpathian_np_hills = 0, 3, (257, 257, 257), 6604, 6, 0.5, 2.0

# 2D noise that controls the shape/size of ridged mountains.
# type: noise_params
# mgcarpathian_np_ridge_mnt = 0, 12, (743, 743, 743), 5520, 6, 0.7, 2.0

# 2D noise that controls the shape/size of step mountains.
# type: noise_params
# mgcarpathian_np_step_mnt = 0, 8, (509, 509, 509), 2590, 6, 0.6, 2.0

# 3D noise for mountain overhangs, cliffs, etc. Usually small variations.
# type: noise_params
# mgcarpathian_np_mnt_var = 0, 1, (499, 499, 499), 2490, 5, 0.6, 2.0

# First of 2 3D noises that together define tunnels.
# type: noise_params
# mgcarpathian_np_cave1 = 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0

# Second of 2 3D noises that together define tunnels.
# type: noise_params
# mgcarpathian_np_cave2 = 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0

# 3D noise defining giant caverns.
# type: noise_params
# mgcarpathian_np_cavern = 0, 1, (384, 128, 384), 723, 5, 0.63, 2.0

#### Mapgen flat

# Map generation attributes specific to Mapgen flat.
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Expand Up @@ -400,6 +400,7 @@ set(common_SRCS
map_settings_manager.cpp
mapblock.cpp
mapgen.cpp
mapgen_carpathian.cpp
mapgen_flat.cpp
mapgen_fractal.cpp
mapgen_singlenode.cpp
Expand Down
6 changes: 6 additions & 0 deletions src/mapgen.cpp
Expand Up @@ -40,6 +40,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/numeric.h"
#include "filesys.h"
#include "log.h"
#include "mapgen_carpathian.h"
#include "mapgen_flat.h"
#include "mapgen_fractal.h"
#include "mapgen_v5.h"
Expand Down Expand Up @@ -86,6 +87,7 @@ static MapgenDesc g_reg_mapgens[] = {
{"fractal", true},
{"valleys", true},
{"singlenode", true},
{"carpathian", true},
};

STATIC_ASSERT(
Expand Down Expand Up @@ -159,6 +161,8 @@ Mapgen *Mapgen::createMapgen(MapgenType mgtype, int mgid,
MapgenParams *params, EmergeManager *emerge)
{
switch (mgtype) {
case MAPGEN_CARPATHIAN:
return new MapgenCarpathian(mgid, (MapgenCarpathianParams *)params, emerge);
case MAPGEN_FLAT:
return new MapgenFlat(mgid, (MapgenFlatParams *)params, emerge);
case MAPGEN_FRACTAL:
Expand All @@ -182,6 +186,8 @@ Mapgen *Mapgen::createMapgen(MapgenType mgtype, int mgid,
MapgenParams *Mapgen::createMapgenParams(MapgenType mgtype)
{
switch (mgtype) {
case MAPGEN_CARPATHIAN:
return new MapgenCarpathianParams;
case MAPGEN_FLAT:
return new MapgenFlatParams;
case MAPGEN_FRACTAL:
Expand Down
1 change: 1 addition & 0 deletions src/mapgen.h
Expand Up @@ -118,6 +118,7 @@ enum MapgenType {
MAPGEN_FRACTAL,
MAPGEN_VALLEYS,
MAPGEN_SINGLENODE,
MAPGEN_CARPATHIAN,
MAPGEN_INVALID,
};

Expand Down

0 comments on commit a80ecbe

Please sign in to comment.