Skip to content

Commit

Permalink
Mapgen: Add flat mapgen in hidden form
Browse files Browse the repository at this point in the history
  • Loading branch information
paramat committed Nov 11, 2015
1 parent f3ac251 commit 76c9abe
Show file tree
Hide file tree
Showing 7 changed files with 803 additions and 2 deletions.
1 change: 1 addition & 0 deletions build/android/jni/Android.mk
Expand Up @@ -173,6 +173,7 @@ LOCAL_SRC_FILES := \
jni/src/mapblock.cpp \
jni/src/mapblock_mesh.cpp \
jni/src/mapgen.cpp \
jni/src/mapgen_flat.cpp \
jni/src/mapgen_fractal.cpp \
jni/src/mapgen_singlenode.cpp \
jni/src/mapgen_v5.cpp \
Expand Down
41 changes: 40 additions & 1 deletion builtin/settingtypes.txt
Expand Up @@ -812,7 +812,7 @@ liquid_update (Liquid update tick) float 1.0

# Name of map generator to be used when creating a new world.
# Creating a world in the main menu will override this.
mg_name (Mapgen name) enum v6 v5,v6,v7,fractal,singlenode
mg_name (Mapgen name) enum v6 v5,v6,v7,flat,fractal,singlenode

# Water surface level of the world.
water_level (Water level) int 1
Expand Down Expand Up @@ -928,6 +928,45 @@ mgv7_np_ridge (Mapgen v7 ridge noise parameters) noise_params 0, 1, (100, 100, 1
mgv7_np_cave1 (Mapgen v7 cave1 noise parameters) noise_params 0, 12, (100, 100, 100), 52534, 4, 0.5, 2.0
mgv7_np_cave2 (Mapgen v7 cave2 noise parameters) noise_params 0, 12, (100, 100, 100), 10325, 4, 0.5, 2.0

[***Mapgen flat]

# Map generation attributes specific to Mapgen flat.
# Occasional lakes and hills added to the flat world.
# 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.
mgflat_spflags (Mapgen flat flags) flags nolakes,nohills lakes,hills,nolakes,nohills

# Y of flat ground.
mgflat_ground_level (Mapgen flat ground level) int 8

# Y of upper limit of large pseudorandom caves.
mgflat_large_cave_depth (Mapgen flat large cave depth) int -33

# Terrain noise threshold for lakes.
# Controls proportion of world area covered by lakes.
# Adjust towards 0.0 for a larger proportion.
mgflat_lake_threshold (Mapgen flat lake threshold) float -0.45

# Controls steepness/depth of lake depressions.
mgflat_lake_steepness (Mapgen flat lake steepness) float 48.0

# Terrain noise threshold for hills.
# Controls proportion of world area covered by hills.
# Adjust towards 0.0 for a larger proportion.
mgflat_hill_threshold (Mapgen flat hill threshold) float 0.45

# Controls steepness/height of hills.
mgflat_hill_steepness (Mapgen flat hill steepness) float 64.0

# Determines terrain shape.
# The 3 numbers in brackets control the scale of the
# terrain, the 3 numbers should be identical.
mgflat_np_terrain (Mapgen flat terrain noise parameters) noise_params 0, 1, (600, 600, 600), 7244, 5, 0.6, 2.0

mgflat_np_filler_depth (Mapgen flat filler depth noise parameters) noise_params 0, 1.2, (150, 150, 150), 261, 3, 0.7, 2.0
mgflat_np_cave1 (Mapgen flat cave1 noise parameters) noise_params 0, 12, (128, 128, 128), 52534, 4, 0.5, 2.0
mgflat_np_cave2 (Mapgen flat cave2 noise parameters) noise_params 0, 12, (128, 128, 128), 10325, 4, 0.5, 2.0

[***Mapgen fractal]

# Map generation attributes specific to Mapgen fractal.
Expand Down
54 changes: 53 additions & 1 deletion minetest.conf.example
Expand Up @@ -1000,7 +1000,7 @@

# Name of map generator to be used when creating a new world.
# Creating a world in the main menu will override this.
# type: enum values: v5, v6, v7, fractal, singlenode
# type: enum values: v5, v6, v7, flat, fractal, singlenode
# mg_name = v6

# Water surface level of the world.
Expand Down Expand Up @@ -1179,6 +1179,58 @@
# type: noise_params
# mgv7_np_cave2 = 0, 12, (100, 100, 100), 10325, 4, 0.5, 2.0

#### Mapgen flat

# Map generation attributes specific to Mapgen flat.
# Occasional lakes and hills added to the flat world.
# 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: lakes, hills, nolakes, nohills
# mgflat_spflags = nolakes,nohills

# Y of flat ground.
# type: int
# mgflat_ground_level = 8

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

# Terrain noise threshold for lakes.
# Controls proportion of world area covered by lakes.
# Adjust towards 0.0 for a larger proportion.
# type: float
# mgflat_lake_threshold = -0.45

# Controls steepness/depth of lake depressions.
# type: float
# mgflat_lake_steepness = 48.0

# Terrain noise threshold for hills.
# Controls proportion of world area covered by hills.
# Adjust towards 0.0 for a larger proportion.
# type: float
# mgflat_hill_threshold = 0.45

# Controls steepness/height of hills.
# type: float
# mgflat_hill_steepness = 64.0

# Determines terrain shape.
# The 3 numbers in brackets control the scale of the
# terrain, the 3 numbers should be identical.
# type: noise_params
# mgflat_np_terrain = 0, 1, (600, 600, 600), 7244, 5, 0.6, 2.0

# type: noise_params
# mgflat_np_filler_depth = 0, 1.2, (150, 150, 150), 261, 3, 0.7, 2.0

# type: noise_params
# mgflat_np_cave1 = 0, 12, (128, 128, 128), 52534, 4, 0.5, 2.0

# type: noise_params
# mgflat_np_cave2 = 0, 12, (128, 128, 128), 10325, 4, 0.5, 2.0

#### Mapgen fractal

# Map generation attributes specific to Mapgen fractal.
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Expand Up @@ -367,6 +367,7 @@ set(common_SRCS
map.cpp
mapblock.cpp
mapgen.cpp
mapgen_flat.cpp
mapgen_fractal.cpp
mapgen_singlenode.cpp
mapgen_v5.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/emerge.cpp
Expand Up @@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "map.h"
#include "mapblock.h"
#include "mapgen_flat.h"
#include "mapgen_fractal.h"
#include "mapgen_v5.h"
#include "mapgen_v6.h"
Expand Down Expand Up @@ -105,6 +106,7 @@ MapgenDesc g_reg_mapgens[] = {
{"v5", new MapgenFactoryV5, true},
{"v6", new MapgenFactoryV6, true},
{"v7", new MapgenFactoryV7, true},
{"flat", new MapgenFactoryFlat, false},
{"fractal", new MapgenFactoryFractal, false},
{"singlenode", new MapgenFactorySinglenode, false},
};
Expand Down

0 comments on commit 76c9abe

Please sign in to comment.