Skip to content

Commit 76c9abe

Browse files
committedNov 11, 2015
Mapgen: Add flat mapgen in hidden form
1 parent f3ac251 commit 76c9abe

File tree

7 files changed

+803
-2
lines changed

7 files changed

+803
-2
lines changed
 

Diff for: ‎build/android/jni/Android.mk

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ LOCAL_SRC_FILES := \
173173
jni/src/mapblock.cpp \
174174
jni/src/mapblock_mesh.cpp \
175175
jni/src/mapgen.cpp \
176+
jni/src/mapgen_flat.cpp \
176177
jni/src/mapgen_fractal.cpp \
177178
jni/src/mapgen_singlenode.cpp \
178179
jni/src/mapgen_v5.cpp \

Diff for: ‎builtin/settingtypes.txt

+40-1
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ liquid_update (Liquid update tick) float 1.0
812812

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

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

931+
[***Mapgen flat]
932+
933+
# Map generation attributes specific to Mapgen flat.
934+
# Occasional lakes and hills added to the flat world.
935+
# Flags that are not specified in the flag string are not modified from the default.
936+
# Flags starting with "no" are used to explicitly disable them.
937+
mgflat_spflags (Mapgen flat flags) flags nolakes,nohills lakes,hills,nolakes,nohills
938+
939+
# Y of flat ground.
940+
mgflat_ground_level (Mapgen flat ground level) int 8
941+
942+
# Y of upper limit of large pseudorandom caves.
943+
mgflat_large_cave_depth (Mapgen flat large cave depth) int -33
944+
945+
# Terrain noise threshold for lakes.
946+
# Controls proportion of world area covered by lakes.
947+
# Adjust towards 0.0 for a larger proportion.
948+
mgflat_lake_threshold (Mapgen flat lake threshold) float -0.45
949+
950+
# Controls steepness/depth of lake depressions.
951+
mgflat_lake_steepness (Mapgen flat lake steepness) float 48.0
952+
953+
# Terrain noise threshold for hills.
954+
# Controls proportion of world area covered by hills.
955+
# Adjust towards 0.0 for a larger proportion.
956+
mgflat_hill_threshold (Mapgen flat hill threshold) float 0.45
957+
958+
# Controls steepness/height of hills.
959+
mgflat_hill_steepness (Mapgen flat hill steepness) float 64.0
960+
961+
# Determines terrain shape.
962+
# The 3 numbers in brackets control the scale of the
963+
# terrain, the 3 numbers should be identical.
964+
mgflat_np_terrain (Mapgen flat terrain noise parameters) noise_params 0, 1, (600, 600, 600), 7244, 5, 0.6, 2.0
965+
966+
mgflat_np_filler_depth (Mapgen flat filler depth noise parameters) noise_params 0, 1.2, (150, 150, 150), 261, 3, 0.7, 2.0
967+
mgflat_np_cave1 (Mapgen flat cave1 noise parameters) noise_params 0, 12, (128, 128, 128), 52534, 4, 0.5, 2.0
968+
mgflat_np_cave2 (Mapgen flat cave2 noise parameters) noise_params 0, 12, (128, 128, 128), 10325, 4, 0.5, 2.0
969+
931970
[***Mapgen fractal]
932971

933972
# Map generation attributes specific to Mapgen fractal.

Diff for: ‎minetest.conf.example

+53-1
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@
10001000

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

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

1182+
#### Mapgen flat
1183+
1184+
# Map generation attributes specific to Mapgen flat.
1185+
# Occasional lakes and hills added to the flat world.
1186+
# Flags that are not specified in the flag string are not modified from the default.
1187+
# Flags starting with "no" are used to explicitly disable them.
1188+
# type: flags possible values: lakes, hills, nolakes, nohills
1189+
# mgflat_spflags = nolakes,nohills
1190+
1191+
# Y of flat ground.
1192+
# type: int
1193+
# mgflat_ground_level = 8
1194+
1195+
# Y of upper limit of large pseudorandom caves.
1196+
# type: int
1197+
# mgflat_large_cave_depth = -33
1198+
1199+
# Terrain noise threshold for lakes.
1200+
# Controls proportion of world area covered by lakes.
1201+
# Adjust towards 0.0 for a larger proportion.
1202+
# type: float
1203+
# mgflat_lake_threshold = -0.45
1204+
1205+
# Controls steepness/depth of lake depressions.
1206+
# type: float
1207+
# mgflat_lake_steepness = 48.0
1208+
1209+
# Terrain noise threshold for hills.
1210+
# Controls proportion of world area covered by hills.
1211+
# Adjust towards 0.0 for a larger proportion.
1212+
# type: float
1213+
# mgflat_hill_threshold = 0.45
1214+
1215+
# Controls steepness/height of hills.
1216+
# type: float
1217+
# mgflat_hill_steepness = 64.0
1218+
1219+
# Determines terrain shape.
1220+
# The 3 numbers in brackets control the scale of the
1221+
# terrain, the 3 numbers should be identical.
1222+
# type: noise_params
1223+
# mgflat_np_terrain = 0, 1, (600, 600, 600), 7244, 5, 0.6, 2.0
1224+
1225+
# type: noise_params
1226+
# mgflat_np_filler_depth = 0, 1.2, (150, 150, 150), 261, 3, 0.7, 2.0
1227+
1228+
# type: noise_params
1229+
# mgflat_np_cave1 = 0, 12, (128, 128, 128), 52534, 4, 0.5, 2.0
1230+
1231+
# type: noise_params
1232+
# mgflat_np_cave2 = 0, 12, (128, 128, 128), 10325, 4, 0.5, 2.0
1233+
11821234
#### Mapgen fractal
11831235

11841236
# Map generation attributes specific to Mapgen fractal.

Diff for: ‎src/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ set(common_SRCS
367367
map.cpp
368368
mapblock.cpp
369369
mapgen.cpp
370+
mapgen_flat.cpp
370371
mapgen_fractal.cpp
371372
mapgen_singlenode.cpp
372373
mapgen_v5.cpp

Diff for: ‎src/emerge.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3434
#include "log.h"
3535
#include "map.h"
3636
#include "mapblock.h"
37+
#include "mapgen_flat.h"
3738
#include "mapgen_fractal.h"
3839
#include "mapgen_v5.h"
3940
#include "mapgen_v6.h"
@@ -105,6 +106,7 @@ MapgenDesc g_reg_mapgens[] = {
105106
{"v5", new MapgenFactoryV5, true},
106107
{"v6", new MapgenFactoryV6, true},
107108
{"v7", new MapgenFactoryV7, true},
109+
{"flat", new MapgenFactoryFlat, false},
108110
{"fractal", new MapgenFactoryFractal, false},
109111
{"singlenode", new MapgenFactorySinglenode, false},
110112
};

0 commit comments

Comments
 (0)
Please sign in to comment.