aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen_carpathian.cpp
blob: b3a0bd270778e6cf07276bac45d0c97c2ceffc0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
/*
Minetest
Copyright (C) 2017-2019 vlapsley, Vaughan Lapsley <vlapsley@gmail.com>
Copyright (C) 2017-2019 paramat

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/


#include <cmath>
#include "mapgen.h"
#include "voxel.h"
#include "noise.h"
#include "mapblock.h"
#include "mapnode.h"
#include "map.h"
#include "nodedef.h"
#include "voxelalgorithms.h"
//#include "profiler.h" // For TimeTaker
#include "settings.h" // For g_settings
#include "emerge.h"
#include "dungeongen.h"
#include "cavegen.h"
#include "mg_biome.h"
#include "mg_ore.h"
#include "mg_decoration.h"
#include "mapgen_carpathian.h"


FlagDesc flagdesc_mapgen_carpathian[] = {
	{"caverns", MGCARPATHIAN_CAVERNS},
	{"rivers",  MGCARPATHIAN_RIVERS},
	{NULL,      0}
};


///////////////////////////////////////////////////////////////////////////////


MapgenCarpathian::MapgenCarpathian(MapgenCarpathianParams *params, EmergeParams *emerge)
	: MapgenBasic(MAPGEN_CARPATHIAN, params, emerge)
{
	base_level       = params->base_level;
	river_width      = params->river_width;
	river_depth      = params->river_depth;
	valley_width     = params->valley_width;

	spflags            = params->spflags;
	cave_width         = params->cave_width;
	large_cave_depth   = params->large_cave_depth;
	small_cave_num_min = params->small_cave_num_min;
	small_cave_num_max = params->small_cave_num_max;
	large_cave_num_min = params->large_cave_num_min;
	large_cave_num_max = params->large_cave_num_max;
	large_cave_flooded = params->large_cave_flooded;
	cavern_limit       = params->cavern_limit;
	cavern_taper       = params->cavern_taper;
	cavern_threshold   = params->cavern_threshold;
	dungeon_ymin       = params->dungeon_ymin;
	dungeon_ymax       = params->dungeon_ymax;

	grad_wl = 1 - water_level;

	//// 2D Terrain noise
	noise_filler_depth  = new Noise(&params->np_filler_depth,  seed, csize.X, csize.Z);
	noise_height1       = new Noise(&params->np_height1,       seed, csize.X, csize.Z);
	noise_height2       = new Noise(&params->np_height2,       seed, csize.X, csize.Z);
	noise_height3       = new Noise(&params->np_height3,       seed, csize.X, csize.Z);
	noise_height4       = new Noise(&params->np_height4,       seed, csize.X, csize.Z);
	noise_hills_terrain = new Noise(&params->np_hills_terrain, seed, csize.X, csize.Z);
	noise_ridge_terrain = new Noise(&params->np_ridge_terrain, seed, csize.X, csize.Z);
	noise_step_terrain  = new Noise(&params->np_step_terrain,  seed, csize.X, csize.Z);
	noise_hills         = new Noise(&params->np_hills,         seed, csize.X, csize.Z);
	noise_ridge_mnt     = new Noise(&params->np_ridge_mnt,     seed, csize.X, csize.Z);
	noise_step_mnt      = new Noise(&params->np_step_mnt,      seed, csize.X, csize.Z);
	if (spflags & MGCARPATHIAN_RIVERS)
		noise_rivers    = new Noise(&params->np_rivers,        seed, csize.X, csize.Z);

	//// 3D terrain noise
	// 1 up 1 down overgeneration
	noise_mnt_var = new Noise(&params->np_mnt_var, seed, csize.X, csize.Y + 2, csize.Z);

	//// Cave noise
	MapgenBasic::np_cave1  = params->np_cave1;
	MapgenBasic::np_cave2  = params->np_cave2;
	MapgenBasic::np_cavern = params->np_cavern;
	MapgenBasic::np_dungeons = params->np_dungeons;
}


MapgenCarpathian::~MapgenCarpathian()
{
	delete noise_filler_depth;
	delete noise_height1;
	delete noise_height2;
	delete noise_height3;
	delete noise_height4;
	delete noise_hills_terrain;
	delete noise_ridge_terrain;
	delete noise_step_terrain;
	delete noise_hills;
	delete noise_ridge_mnt;
	delete noise_step_mnt;
	if (spflags & MGCARPATHIAN_RIVERS)
		delete noise_rivers;

	delete noise_mnt_var;
}


MapgenCarpathianParams::MapgenCarpathianParams():
	np_filler_depth  (0,   1,   v3f(128,  128,  128),  261,   3, 0.7,  2.0),
	np_height1       (0,   5,   v3f(251,  251,  251),  9613,  5, 0.5,  2.0),
	np_height2       (0,   5,   v3f(383,  383,  383),  1949,  5, 0.5,  2.0),
	np_height3       (0,   5,   v3f(509,  509,  509),  3211,  5, 0.5,  2.0),
	np_height4       (0,   5,   v3f(631,  631,  631),  1583,  5, 0.5,  2.0),
	np_hills_terrain (1,   1,   v3f(1301, 1301, 1301), 1692,  5, 0.5,  2.0),
	np_ridge_terrain (1,   1,   v3f(1889, 1889, 1889), 3568,  5, 0.5,  2.0),
	np_step_terrain  (1,   1,   v3f(1889, 1889, 1889), 4157,  5, 0.5,  2.0),
	np_hills         (0,   3,   v3f(257,  257,  257),  6604,  6, 0.5,  2.0),
	np_ridge_mnt     (0,   12,  v3f(743,  743,  743),  5520,  6, 0.7,  2.0),
	np_step_mnt      (0,   8,   v3f(509,  509,  509),  2590,  6, 0.6,  2.0),
	np_rivers        (0,   1,   v3f(1000, 1000, 1000), 85039, 5, 0.6,  2.0),
	np_mnt_var       (0,   1,   v3f(499,  499,  499),  2490,  5, 0.55, 2.0),
	np_cave1         (0,   12,  v3f(61,   61,   61),   52534, 3, 0.5,  2.0),
	np_cave2         (0,   12,  v3f(67,   67,   67),   10325, 3, 0.5,  2.0),
	np_cavern        (0,   1,   v3f(384,  128,  384),  723,   5, 0.63, 2.0),
	np_dungeons      (0.9, 0.5, v3f(500,  500,  500),  0,     2, 0.8,  2.0)
{
}


void MapgenCarpathianParams::readParams(const Settings *settings)
{
	settings->getFlagStrNoEx("mgcarpathian_spflags", spflags, flagdesc_mapgen_carpathian);

	settings->getFloatNoEx("mgcarpathian_base_level",   base_level);
	settings->getFloatNoEx("mgcarpathian_river_width",  river_width);
	settings->getFloatNoEx("mgcarpathian_river_depth",  river_depth);
	settings->getFloatNoEx("mgcarpathian_valley_width", valley_width);

	settings->getFloatNoEx("mgcarpathian_cave_width",         cave_width);
	settings->getS16NoEx("mgcarpathian_large_cave_depth",     large_cave_depth);
	settings->getU16NoEx("mgcarpathian_small_cave_num_min",   small_cave_num_min);
	settings->getU16NoEx("mgcarpathian_small_cave_num_max",   small_cave_num_max);
	settings->getU16NoEx("mgcarpathian_large_cave_num_min",   large_cave_num_min);
	settings->getU16NoEx("mgcarpathian_large_cave_num_max",   large_cave_num_max);
	settings->getFloatNoEx("mgcarpathian_large_cave_flooded", large_cave_flooded);
	settings->getS16NoEx("mgcarpathian_cavern_limit",         cavern_limit);
	settings->getS16NoEx("mgcarpathian_cavern_taper",         cavern_taper);
	settings->getFloatNoEx("mgcarpathian_cavern_threshold",   cavern_threshold);
	settings->getS16NoEx("mgcarpathian_dungeon_ymin",         dungeon_ymin);
	settings->getS16NoEx("mgcarpathian_dungeon_ymax",         dungeon_ymax);

	settings->getNoiseParams("mgcarpathian_np_filler_depth",  np_filler_depth);
	settings->getNoiseParams("mgcarpathian_np_height1",       np_height1);
	settings->getNoiseParams("mgcarpathian_np_height2",       np_height2);
	settings->getNoiseParams("mgcarpathian_np_height3",       np_height3);
	settings->getNoiseParams("mgcarpathian_np_height4",       np_height4);
	settings->getNoiseParams("mgcarpathian_np_hills_terrain", np_hills_terrain);
	settings->getNoiseParams("mgcarpathian_np_ridge_terrain", np_ridge_terrain);
	settings->getNoiseParams("mgcarpathian_np_step_terrain",  np_step_terrain);
	settings->getNoiseParams("mgcarpathian_np_hills",         np_hills);
	settings->getNoiseParams("mgcarpathian_np_ridge_mnt",     np_ridge_mnt);
	settings->getNoiseParams("mgcarpathian_np_step_mnt",      np_step_mnt);
	settings->getNoiseParams("mgcarpathian_np_rivers",        np_rivers);
	settings->getNoiseParams("mgcarpathian_np_mnt_var",       np_mnt_var);
	settings->getNoiseParams("mgcarpathian_np_cave1",         np_cave1);
	settings->getNoiseParams("mgcarpathian_np_cave2",         np_cave2);
	settings->getNoiseParams("mgcarpathian_np_cavern",        np_cavern);
	settings->getNoiseParams("mgcarpathian_np_dungeons",      np_dungeons);
}


void MapgenCarpathianParams::writeParams(Settings *settings) const
{
	settings->setFlagStr("mgcarpathian_spflags", spflags, flagdesc_mapgen_carpathian);

	settings->setFloat("mgcarpathian_base_level",   base_level);
	settings->setFloat("mgcarpathian_river_width",  river_width);
	settings->setFloat("mgcarpathian_river_depth",  river_depth);
	settings->setFloat("mgcarpathian_valley_width", valley_width);

	settings->setFloat("mgcarpathian_cave_width",         cave_width);
	settings->setS16("mgcarpathian_large_cave_depth",     large_cave_depth);
	settings->setU16("mgcarpathian_small_cave_num_min",   small_cave_num_min);
	settings->setU16("mgcarpathian_small_cave_num_max",   small_cave_num_max);
	settings->setU16("mgcarpathian_large_cave_num_min",   large_cave_num_min);
	settings->setU16("mgcarpathian_large_cave_num_max",   large_cave_num_max);
	settings->setFloat("mgcarpathian_large_cave_flooded", large_cave_flooded);
	settings->setS16("mgcarpathian_cavern_limit",         cavern_limit);
	settings->setS16("mgcarpathian_cavern_taper",         cavern_taper);
	settings->setFloat("mgcarpathian_cavern_threshold",   cavern_threshold);
	settings->setS16("mgcarpathian_dungeon_ymin",         dungeon_ymin);
	settings->setS16("mgcarpathian_dungeon_ymax",         dungeon_ymax);

	settings->setNoiseParams("mgcarpathian_np_filler_depth",  np_filler_depth);
	settings->setNoiseParams("mgcarpathian_np_height1",       np_height1);
	settings->setNoiseParams("mgcarpathian_np_height2",       np_height2);
	settings->setNoiseParams("mgcarpathian_np_height3",       np_height3);
	settings->setNoiseParams("mgcarpathian_np_height4",       np_height4);
	settings->setNoiseParams("mgcarpathian_np_hills_terrain", np_hills_terrain);
	settings->setNoiseParams("mgcarpathian_np_ridge_terrain", np_ridge_terrain);
	settings->setNoiseParams("mgcarpathian_np_step_terrain",  np_step_terrain);
	settings->setNoiseParams("mgcarpathian_np_hills",         np_hills);
	settings->setNoiseParams("mgcarpathian_np_ridge_mnt",     np_ridge_mnt);
	settings->setNoiseParams("mgcarpathian_np_step_mnt",      np_step_mnt);
	settings->setNoiseParams("mgcarpathian_np_rivers",        np_rivers);
	settings->setNoiseParams("mgcarpathian_np_mnt_var",       np_mnt_var);
	settings->setNoiseParams("mgcarpathian_np_cave1",         np_cave1);
	settings->setNoiseParams("mgcarpathian_np_cave2",         np_cave2);
	settings->setNoiseParams("mgcarpathian_np_cavern",        np_cavern);
	settings->setNoiseParams("mgcarpathian_np_dungeons",      np_dungeons);
}


void MapgenCarpathianParams::setDefaultSettings(Settings *settings)
{
	settings->setDefault("mgcarpathian_spflags", flagdesc_mapgen_carpathian,
		MGCARPATHIAN_CAVERNS);
}

////////////////////////////////////////////////////////////////////////////////


// Lerp function
inline float MapgenCarpathian::getLerp(float noise1, float noise2, float mod)
{
	return noise1 + mod * (noise2 - noise1);
}

// Steps function
float MapgenCarpathian::getSteps(float noise)
{
	float w = 0.5f;
	float k = std::floor(noise / w);
	float f = (noise - k * w) / w;
	float s = std::fmin(2.f * f, 1.f);
	return (k + s) * w;
}


////////////////////////////////////////////////////////////////////////////////


void MapgenCarpathian::makeChunk(BlockMakeData *data)
{
	// Pre-conditions
	assert(data->vmanip);
	assert(data->nodedef);

	this->generating = true;
	this->vm = data->vmanip;
	this->ndef = data->nodedef;

	v3s16 blockpos_min = data->blockpos_min;
	v3s16 blockpos_max = data->blockpos_max;
	node_min = blockpos_min * MAP_BLOCKSIZE;
	node_max = (blockpos_max + v3s16(1, 1, 1)) * MAP_BLOCKSIZE - v3s16(1, 1, 1);
	full_node_min = (blockpos_min - 1) * MAP_BLOCKSIZE;
	full_node_max = (blockpos_max + 2) * MAP_BLOCKSIZE - v3s16(1, 1, 1);

	// Create a block-specific seed
	blockseed = getBlockSeed2(full_node_min, seed);

	// Generate terrain
	s16 stone_surface_max_y = generateTerrain();

	// Create heightmap
	updateHeightmap(node_min, node_max);

	// Init biome generator, place biome-specific nodes, and build biomemap
	if (flags & MG_BIOMES) {
		biomegen->calcBiomeNoise(node_min);
		generateBiomes();
	}

	// Generate tunnels, caverns and large randomwalk caves
	if (flags & MG_CAVES) {
		// Generate tunnels first as caverns confuse them
		generateCavesNoiseIntersection(stone_surface_max_y);

		// Generate caverns
		bool near_cavern = false;
		if (spflags & MGCARPATHIAN_CAVERNS)
			near_cavern = generateCavernsNoise(stone_surface_max_y);

		// Generate large randomwalk caves
		if (near_cavern)
			// Disable large randomwalk caves in this mapchunk by setting
			// 'large cave depth' to world base. Avoids excessive liquid in
			// large caverns and floating blobs of overgenerated liquid.
			generateCavesRandomWalk(stone_surface_max_y,
				-MAX_MAP_GENERATION_LIMIT);
		else
			generateCavesRandomWalk(stone_surface_max_y, large_cave_depth);
	}

	// Generate the registered ores
	if (flags & MG_ORES)
		m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);

	// Generate dungeons
	if (flags & MG_DUNGEONS)
		generateDungeons(stone_surface_max_y);

	// Generate the registered decorations
	if (flags & MG_DECORATIONS)
		m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);

	// Sprinkle some dust on top after everything else was generated
	if (flags & MG_BIOMES)
		dustTopNodes();

	// Update liquids
	updateLiquid(&data->transforming_liquid, full_node_min, full_node_max);

	// Calculate lighting
	if (flags & MG_LIGHT) {
		calcLighting(node_min - v3s16(0, 1, 0), node_max + v3s16(0, 1, 0),
				full_node_min, full_node_max);
	}

	this->generating = false;
}


////////////////////////////////////////////////////////////////////////////////


int MapgenCarpathian::getSpawnLevelAtPoint(v2s16 p)
{
	// If rivers are enabled, first check if in a river channel
	if (spflags & MGCARPATHIAN_RIVERS) {
		float river = std::fabs(NoisePerlin2D(&noise_rivers->np, p.X, p.Y, seed)) -
			river_width;
		if (river < 0.0f)
			return MAX_MAP_GENERATION_LIMIT; // Unsuitable spawn point
	}

	float height1 = NoisePerlin2D(&noise_height1->np, p.X, p.Y, seed);
	float height2 = NoisePerlin2D(&noise_height2->np, p.X, p.Y, seed);
	float height3 = NoisePerlin2D(&noise_height3->np, p.X, p.Y, seed);
	float height4 = NoisePerlin2D(&noise_height4->np, p.X, p.Y, seed);

	float hterabs = std::fabs(NoisePerlin2D(&noise_hills_terrain->np, p.X, p.Y, seed));
	float n_hills = NoisePerlin2D(&noise_hills->np, p.X, p.Y, seed);
	float hill_mnt = hterabs * hterabs * hterabs * n_hills * n_hills;

	float rterabs = std::fabs(NoisePerlin2D(&noise_ridge_terrain->np, p.X, p.Y, seed));
	float n_ridge_mnt = NoisePerlin2D(&noise_ridge_mnt->np, p.X, p.Y, seed);
	float ridge_mnt = rterabs * rterabs * rterabs * (1.0f - std::fabs(n_ridge_mnt));

	float sterabs = std::fabs(NoisePerlin2D(&noise_step_terrain->np, p.X, p.Y, seed));
	float n_step_mnt = NoisePerlin2D(&noise_step_mnt->np, p.X, p.Y, seed);
	float step_mnt = sterabs * sterabs * sterabs * getSteps(n_step_mnt);

	float valley = 1.0f;
	float river = 0.0f;

	if ((spflags & MGCARPATHIAN_RIVERS) && node_max.Y >= water_level - 16) {
		river = std::fabs(NoisePerlin2D(&noise_rivers->np, p.X, p.Y, seed)) - river_width;
		if (river <= valley_width) {
			// Within river valley
			if (river < 0.0f) {
				// River channel
				valley = river;
			} else {
				// Valley slopes.
				// 0 at river edge, 1 at valley edge.
				float riversc = river / valley_width;
				// Smoothstep
				valley = riversc * riversc * (3.0f - 2.0f * riversc);
			}
		}
	}

	bool solid_below = false;
	u8 cons_non_solid = 0; // consecutive non-solid nodes

	for (s16 y = water_level; y <= water_level + 32; y++) {
		float mnt_var = NoisePerlin3D(&noise_mnt_var->np, p.X, y, p.Y, seed);
		float hill1 = getLerp(height1, height2, mnt_var);
		float hill2 = getLerp(height3, height4, mnt_var);
		float hill3 = getLerp(height3, height2, mnt_var);
		float hill4 = getLerp(height1, height4, mnt_var);

		float hilliness = std::fmax(std::fmin(hill1, hill2), std::fmin(hill3, hill4));
		float hills = hill_mnt * hilliness;
		float ridged_mountains = ridge_mnt * hilliness;
		float step_mountains = step_mnt * hilliness;

		s32 grad = 1 - y;

		float mountains = hills + ridged_mountains + step_mountains;
		float surface_level = base_level + mountains + grad;

		if ((spflags & MGCARPATHIAN_RIVERS) && river <= valley_width) {
			if (valley < 0.0f) {
				// River channel
				surface_level = std::fmin(surface_level,
					water_level - std::sqrt(-valley) * river_depth);
			} else if (surface_level > water_level) {
				// Valley slopes
				surface_level = water_level + (surface_level - water_level) * valley;
			}
		}

		if (y < surface_level) { //TODO '<=' fix from generateTerrain()
			// solid node
			solid_below = true;
			cons_non_solid = 0;
		} else {
			// non-solid node
			cons_non_solid++;
			if (cons_non_solid == 3 && solid_below)
				return y - 1;
		}
	}

	return MAX_MAP_GENERATION_LIMIT; // No suitable spawn point found
}


////////////////////////////////////////////////////////////////////////////////


int MapgenCarpathian::generateTerrain()
{
	MapNode mn_air(CONTENT_AIR);
	MapNode mn_stone(c_stone);
	MapNode mn_water(c_water_source);

	// Calculate noise for terrain generation
	noise_height1->perlinMap2D(node_min.X, node_min.Z);
	noise_height2->perlinMap2D(node_min.X, node_min.Z);
	noise_height3->perlinMap2D(node_min.X, node_min.Z);
	noise_height4->perlinMap2D(node_min.X, node_min.Z);
	noise_hills_terrain->perlinMap2D(node_min.X, node_min.Z);
	noise_ridge_terrain->perlinMap2D(node_min.X, node_min.Z);
	noise_step_terrain->perlinMap2D(node_min.X, node_min.Z);
	noise_hills->perlinMap2D(node_min.X, node_min.Z);
	noise_ridge_mnt->perlinMap2D(node_min.X, node_min.Z);
	noise_step_mnt->perlinMap2D(node_min.X, node_min.Z);
	noise_mnt_var->perlinMap3D(node_min.X, node_min.Y - 1, node_min.Z);

	if (spflags & MGCARPATHIAN_RIVERS)
		noise_rivers->perlinMap2D(node_min.X, node_min.Z);

	//// Place nodes
	const v3s16 &em = vm->m_area.getExtent();
	s16 stone_surface_max_y = -MAX_MAP_GENERATION_LIMIT;
	u32 index2d = 0;

	for (s16 z = node_min.Z; z <= node_max.Z; z++)
	for (s16 x = node_min.X; x <= node_max.X; x++, index2d++) {
		// Hill/Mountain height (hilliness)
		float height1 = noise_height1->result[index2d];
		float height2 = noise_height2->result[index2d];
		float height3 = noise_height3->result[index2d];
		float height4 = noise_height4->result[index2d];

		// Rolling hills
		float hterabs = std::fabs(noise_hills_terrain->result[index2d]);
		float n_hills = noise_hills->result[index2d];
		float hill_mnt = hterabs * hterabs * hterabs * n_hills * n_hills;

		// Ridged mountains
		float rterabs = std::fabs(noise_ridge_terrain->result[index2d]);
		float n_ridge_mnt = noise_ridge_mnt->result[index2d];
		float ridge_mnt = rterabs * rterabs * rterabs *
			(1.0f - std::fabs(n_ridge_mnt));

		// Step (terraced) mountains
		float sterabs = std::fabs(noise_step_terrain->result[index2d]);
		float n_step_mnt = noise_step_mnt->result[index2d];
		float step_mnt = sterabs * sterabs * sterabs * getSteps(n_step_mnt);

		// Rivers
		float valley = 1.0f;
		float river = 0.0f;

		if ((spflags & MGCARPATHIAN_RIVERS) && node_max.Y >= water_level - 16) {
			river = std::fabs(noise_rivers->result[index2d]) - river_width;
			if (river <= valley_width) {
				// Within river valley
				if (river < 0.0f) {
					// River channel
					valley = river;
				} else {
					// Valley slopes.
					// 0 at river edge, 1 at valley edge.
					float riversc = river / valley_width;
					// Smoothstep
					valley = riversc * riversc * (3.0f - 2.0f * riversc);
				}
			}
		}

		// Initialise 3D noise index and voxelmanip index to column base
		u32 index3d = (z - node_min.Z) * zstride_1u1d + (x - node_min.X);
		u32 vi = vm->m_area.index(x, node_min.Y - 1, z);

		for (s16 y = node_min.Y - 1; y <= node_max.Y + 1;
				y++,
				index3d += ystride,
				VoxelArea::add_y(em, vi, 1)) {
			if (vm->m_data[vi].getContent() != CONTENT_IGNORE)
				continue;

			// Combine height noises and apply 3D variation
			float mnt_var = noise_mnt_var->result[index3d];
			float hill1 = getLerp(height1, height2, mnt_var);
			float hill2 = getLerp(height3, height4, mnt_var);
			float hill3 = getLerp(height3, height2, mnt_var);
			float hill4 = getLerp(height1, height4, mnt_var);

			// 'hilliness' determines whether hills/mountains are
			// small or large
			float hilliness =
				std::fmax(std::fmin(hill1, hill2), std::fmin(hill3, hill4));
			float hills = hill_mnt * hilliness;
			float ridged_mountains = ridge_mnt * hilliness;
			float step_mountains = step_mnt * hilliness;

			// Gradient & shallow seabed
			s32 grad = (y < water_level) ? grad_wl + (water_level - y) * 3 :
				1 - y;

			// Final terrain level
			float mountains = hills + ridged_mountains + step_mountains;
			float surface_level = base_level + mountains + grad;

			// Rivers
			if ((spflags & MGCARPATHIAN_RIVERS) && node_max.Y >= water_level - 16 &&
					river <= valley_width) {
				if (valley < 0.0f) {
					// River channel
					surface_level = std::fmin(surface_level,
						water_level - std::sqrt(-valley) * river_depth);
				} else if (surface_level > water_level) {
					// Valley slopes
					surface_level = water_level + (surface_level - water_level) * valley;
				}
			}

			if (y < surface_level) { //TODO '<='
				vm->m_data[vi] = mn_stone; // Stone
				if (y > stone_surface_max_y)
					stone_surface_max_y = y;
			} else if (y <= water_level) {
				vm->m_data[vi] = mn_water; // Sea water
			} else {
				vm->m_data[vi] = mn_air; // Air
			}
		}
	}

	return stone_surface_max_y;
}
loat 2.0 # Maximum number of packets sent per send step, if you have a slow connection # try reducing it, but don't reduce it to a number below double of targeted # client number. max_packets_per_iteration (Max. packets per iteration) int 1024 [*Game] # Default game when creating a new world. # This will be overridden when creating a world from the main menu. default_game (Default game) string minetest # Message of the day displayed to players connecting. motd (Message of the day) string # Maximum number of players that can be connected simultaneously. max_users (Maximum users) int 15 # World directory (everything in the world is stored here). # Not needed if starting from the main menu. map-dir (Map directory) path # Time in seconds for item entity (dropped items) to live. # Setting it to -1 disables the feature. item_entity_ttl (Item entity TTL) int 900 # Enable players getting damage and dying. enable_damage (Damage) bool false # Enable creative mode for new created maps. creative_mode (Creative) bool false # A chosen map seed for a new map, leave empty for random. # Will be overridden when creating a new world in the main menu. fixed_map_seed (Fixed map seed) string # New users need to input this password. default_password (Default password) string # The privileges that new users automatically get. # See /privs in game for a full list on your server and mod configuration. default_privs (Default privileges) string interact, shout # Privileges that players with basic_privs can grant basic_privs (Basic privileges) string interact, shout # Whether players are shown to clients without any range limit. # Deprecated, use the setting player_transfer_distance instead. unlimited_player_transfer_distance (Unlimited player transfer distance) bool true # Defines the maximal player transfer distance in blocks (0 = unlimited). player_transfer_distance (Player transfer distance) int 0 # Whether to allow players to damage and kill each other. enable_pvp (Player versus player) bool true # Enable mod channels support. enable_mod_channels (Mod channels) bool false # If this is set, players will always (re)spawn at the given position. static_spawnpoint (Static spawnpoint) string # If enabled, new players cannot join with an empty password. disallow_empty_password (Disallow empty passwords) bool false # If enabled, disable cheat prevention in multiplayer. disable_anticheat (Disable anticheat) bool false # If enabled, actions are recorded for rollback. # This option is only read when server starts. enable_rollback_recording (Rollback recording) bool false # Format of player chat messages. The following strings are valid placeholders: # @name, @message, @timestamp (optional) chat_message_format (Chat message format) string <@name> @message # A message to be displayed to all clients when the server shuts down. kick_msg_shutdown (Shutdown message) string Server shutting down. # A message to be displayed to all clients when the server crashes. kick_msg_crash (Crash message) string This server has experienced an internal error. You will now be disconnected. # Whether to ask clients to reconnect after a (Lua) crash. # Set this to true if your server is set up to restart automatically. ask_reconnect_on_crash (Ask to reconnect after crash) bool false # From how far clients know about objects, stated in mapblocks (16 nodes). # # Setting this larger than active_block_range will also cause the server # to maintain active objects up to this distance in the direction the # player is looking. (This can avoid mobs suddenly disappearing from view) active_object_send_range_blocks (Active object send range) int 4 # The radius of the volume of blocks around every player that is subject to the # active block stuff, stated in mapblocks (16 nodes). # In active blocks objects are loaded and ABMs run. # This is also the minimum range in which active objects (mobs) are maintained. # This should be configured together with active_object_range. active_block_range (Active block range) int 3 # From how far blocks are sent to clients, stated in mapblocks (16 nodes). max_block_send_distance (Max block send distance) int 10 # Maximum number of forceloaded mapblocks. max_forceloaded_blocks (Maximum forceloaded blocks) int 16 # Interval of sending time of day to clients. time_send_interval (Time send interval) int 5 # Controls length of day/night cycle. # Examples: # 72 = 20min, 360 = 4min, 1 = 24hour, 0 = day/night/whatever stays unchanged. time_speed (Time speed) int 72 # Time of day when a new world is started, in millihours (0-23999). world_start_time (World start time) int 6125 0 23999 # Interval of saving important changes in the world, stated in seconds. server_map_save_interval (Map save interval) float 5.3 # Set the maximum character length of a chat message sent by clients. chat_message_max_size (Chat message max length) int 500 # Amount of messages a player may send per 10 seconds. chat_message_limit_per_10sec (Chat message count limit) float 10.0 # Kick players who sent more than X messages per 10 seconds. chat_message_limit_trigger_kick (Chat message kick threshold) int 50 [**Physics] # Horizontal and vertical acceleration on ground or when climbing, # in nodes per second per second. movement_acceleration_default (Default acceleration) float 3 # Horizontal acceleration in air when jumping or falling, # in nodes per second per second. movement_acceleration_air (Acceleration in air) float 2 # Horizontal and vertical acceleration in fast mode, # in nodes per second per second. movement_acceleration_fast (Fast mode acceleration) float 10 # Walking and flying speed, in nodes per second. movement_speed_walk (Walking speed) float 4 # Sneaking speed, in nodes per second. movement_speed_crouch (Sneaking speed) float 1.35 # Walking, flying and climbing speed in fast mode, in nodes per second. movement_speed_fast (Fast mode speed) float 20 # Vertical climbing speed, in nodes per second. movement_speed_climb (Climbing speed) float 3 # Initial vertical speed when jumping, in nodes per second. movement_speed_jump (Jumping speed) float 6.5 # Decrease this to increase liquid resistence to movement. movement_liquid_fluidity (Liquid fluidity) float 1 # Maximum liquid resistence. Controls deceleration when entering liquid at # high speed. movement_liquid_fluidity_smooth (Liquid fluidity smoothing) float 0.5 # Controls sinking speed in liquid. movement_liquid_sink (Liquid sinking) float 10 # Acceleration of gravity, in nodes per second per second. movement_gravity (Gravity) float 9.81 [**Advanced] # Handling for deprecated lua api calls: # - legacy: (try to) mimic old behaviour (default for release). # - log: mimic and log backtrace of deprecated call (default for debug). # - error: abort on usage of deprecated call (suggested for mod developers). deprecated_lua_api_handling (Deprecated Lua API handling) enum legacy legacy,log,error # Number of extra blocks that can be loaded by /clearobjects at once. # This is a trade-off between sqlite transaction overhead and # memory consumption (4096=100MB, as a rule of thumb). max_clearobjects_extra_loaded_blocks (Max. clearobjects extra blocks) int 4096 # How much the server will wait before unloading unused mapblocks. # Higher value is smoother, but will use more RAM. server_unload_unused_data_timeout (Unload unused server data) int 29 # Maximum number of statically stored objects in a block. max_objects_per_block (Maximum objects per block) int 64 # See https://www.sqlite.org/pragma.html#pragma_synchronous sqlite_synchronous (Synchronous SQLite) enum 2 0,1,2 # Length of a server tick and the interval at which objects are generally updated over # network. dedicated_server_step (Dedicated server step) float 0.09 # Length of time between active block management cycles active_block_mgmt_interval (Active block management interval) float 2.0 # Length of time between Active Block Modifier (ABM) execution cycles abm_interval (ABM interval) float 1.0 # Length of time between NodeTimer execution cycles nodetimer_interval (NodeTimer interval) float 0.2 # If enabled, invalid world data won't cause the server to shut down. # Only enable this if you know what you are doing. ignore_world_load_errors (Ignore world errors) bool false # Max liquids processed per step. liquid_loop_max (Liquid loop max) int 100000 # The time (in seconds) that the liquids queue may grow beyond processing # capacity until an attempt is made to decrease its size by dumping old queue # items. A value of 0 disables the functionality. liquid_queue_purge_time (Liquid queue purge time) int 0 # Liquid update interval in seconds. liquid_update (Liquid update tick) float 1.0 # At this distance the server will aggressively optimize which blocks are sent to # clients. # Small values potentially improve performance a lot, at the expense of visible # rendering glitches (some blocks will not be rendered under water and in caves, # as well as sometimes on land). # Setting this to a value greater than max_block_send_distance disables this # optimization. # Stated in mapblocks (16 nodes). block_send_optimize_distance (Block send optimize distance) int 4 2 # If enabled the server will perform map block occlusion culling based on # on the eye position of the player. This can reduce the number of blocks # sent to the client 50-80%. The client will not longer receive most invisible # so that the utility of noclip mode is reduced. server_side_occlusion_culling (Server side occlusion culling) bool true # Restricts the access of certain client-side functions on servers. # Combine the byteflags below to restrict client-side features, or set to 0 # for no restrictions: # LOAD_CLIENT_MODS: 1 (disable loading client-provided mods) # CHAT_MESSAGES: 2 (disable send_chat_message call client-side) # READ_ITEMDEFS: 4 (disable get_item_def call client-side) # READ_NODEDEFS: 8 (disable get_node_def call client-side) # LOOKUP_NODES_LIMIT: 16 (limits get_node call client-side to # csm_restriction_noderange) # READ_PLAYERINFO: 32 (disable get_player_names call client-side) csm_restriction_flags (Client side modding restrictions) int 62 # If the CSM restriction for node range is enabled, get_node calls are limited # to this distance from the player to the node. csm_restriction_noderange (Client side node lookup range restriction) int 0 [*Security] # Prevent mods from doing insecure things like running shell commands. secure.enable_security (Enable mod security) bool true # Comma-separated list of trusted mods that are allowed to access insecure # functions even when mod security is on (via request_insecure_environment()). secure.trusted_mods (Trusted mods) string # Comma-separated list of mods that are allowed to access HTTP APIs, which # allow them to upload and download data to/from the internet. secure.http_mods (HTTP mods) string [*Advanced] [**Profiling] # Load the game profiler to collect game profiling data. # Provides a /profiler command to access the compiled profile. # Useful for mod developers and server operators. profiler.load (Load the game profiler) bool false # The default format in which profiles are being saved, # when calling `/profiler save [format]` without format. profiler.default_report_format (Default report format) enum txt txt,csv,lua,json,json_pretty # The file path relative to your worldpath in which profiles will be saved to. profiler.report_path (Report path) string "" [***Instrumentation] # Instrument the methods of entities on registration. instrument.entity (Entity methods) bool true # Instrument the action function of Active Block Modifiers on registration. instrument.abm (Active Block Modifiers) bool true # Instrument the action function of Loading Block Modifiers on registration. instrument.lbm (Loading Block Modifiers) bool true # Instrument chatcommands on registration. instrument.chatcommand (Chatcommands) bool true # Instrument global callback functions on registration. # (anything you pass to a minetest.register_*() function) instrument.global_callback (Global callbacks) bool true [****Advanced] # Instrument builtin. # This is usually only needed by core/builtin contributors instrument.builtin (Builtin) bool false # Have the profiler instrument itself: # * Instrument an empty function. # This estimates the overhead, that instrumentation is adding (+1 function call). # * Instrument the sampler being used to update the statistics. instrument.profiler (Profiler) bool false [Client and Server] # Name of the player. # When running a server, clients connecting with this name are admins. # When starting from the main menu, this is overridden. name (Player name) string # Set the language. Leave empty to use the system language. # A restart is required after changing this. language (Language) enum ,be,ca,cs,da,de,dv,en,eo,es,et,fr,he,hu,id,it,ja,jbo,ko,ky,lt,ms,nb,nl,pl,pt,pt_BR,ro,ru,sl,sr_Cyrl,sv,sw,tr,uk,zh_CN,zh_TW # Level of logging to be written to debug.txt: # - <nothing> (no logging) # - none (messages with no level) # - error # - warning # - action # - info # - verbose debug_log_level (Debug log level) enum action ,none,error,warning,action,info,verbose # If the file size of debug.txt exceeds the number of megabytes specified in # this setting when it is opened, the file is moved to debug.txt.1, # deleting an older debug.txt.1 if it exists. # debug.txt is only moved if this setting is positive. debug_log_size_max (Debug log file size threshold) int 50 # IPv6 support. enable_ipv6 (IPv6) bool true [*Advanced] # Default timeout for cURL, stated in milliseconds. # Only has an effect if compiled with cURL. curl_timeout (cURL timeout) int 5000 # Limits number of parallel HTTP requests. Affects: # - Media fetch if server uses remote_media setting. # - Serverlist download and server announcement. # - Downloads performed by main menu (e.g. mod manager). # Only has an effect if compiled with cURL. curl_parallel_limit (cURL parallel limit) int 8 # Maximum time in ms a file download (e.g. a mod download) may take. curl_file_download_timeout (cURL file download timeout) int 300000 # Makes DirectX work with LuaJIT. Disable if it causes troubles. high_precision_fpu (High-precision FPU) bool true # Changes the main menu UI: # - Full: Multiple singleplayer worlds, game choice, texture pack chooser, etc. # - Simple: One singleplayer world, no game or texture pack choosers. May be # necessary for smaller screens. main_menu_style (Main menu style) enum full full,simple # Replaces the default main menu with a custom one. main_menu_script (Main menu script) string # Print the engine's profiling data in regular intervals (in seconds). # 0 = disable. Useful for developers. profiler_print_interval (Engine profiling data print interval) int 0 [Mapgen] # Name of map generator to be used when creating a new world. # Creating a world in the main menu will override this. # Current mapgens in a highly unstable state: # - The optional floatlands of v7 (disabled by default). mg_name (Mapgen name) enum v7 v7,valleys,carpathian,v5,flat,fractal,singlenode,v6 # Water surface level of the world. water_level (Water level) int 1 # From how far blocks are generated for clients, stated in mapblocks (16 nodes). max_block_generate_distance (Max block generate distance) int 8 # Limit of map generation, in nodes, in all 6 directions from (0, 0, 0). # Only mapchunks completely within the mapgen limit are generated. # Value is stored per-world. mapgen_limit (Map generation limit) int 31000 0 31000 # Global map generation attributes. # In Mapgen v6 the 'decorations' flag controls all decorations except trees # and junglegrass, in all other mapgens this flag controls all decorations. mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes caves,dungeons,light,decorations,biomes,nocaves,nodungeons,nolight,nodecorations,nobiomes [*Biome API temperature and humidity noise parameters] # Temperature variation for biomes. mg_biome_np_heat (Heat noise) noise_params_2d 50, 50, (1000, 1000, 1000), 5349, 3, 0.5, 2.0, eased # Small-scale temperature variation for blending biomes on borders. mg_biome_np_heat_blend (Heat blend noise) noise_params_2d 0, 1.5, (8, 8, 8), 13, 2, 1.0, 2.0, eased # Humidity variation for biomes. mg_biome_np_humidity (Humidity noise) noise_params_2d 50, 50, (1000, 1000, 1000), 842, 3, 0.5, 2.0, eased # Small-scale humidity variation for blending biomes on borders. mg_biome_np_humidity_blend (Humidity blend noise) noise_params_2d 0, 1.5, (8, 8, 8), 90003, 2, 1.0, 2.0, eased [*Mapgen V5] # Map generation attributes specific to Mapgen v5. mgv5_spflags (Mapgen V5 specific flags) flags caverns caverns,nocaverns # Controls width of tunnels, a smaller value creates wider tunnels. mgv5_cave_width (Cave width) float 0.09 # Y of upper limit of large caves. mgv5_large_cave_depth (Large cave depth) int -256 # Deprecated, define and locate cave liquids using biome definitions instead. # Y of upper limit of lava in large caves. mgv5_lava_depth (Lava depth) int -256 # Y-level of cavern upper limit. mgv5_cavern_limit (Cavern limit) int -256 # Y-distance over which caverns expand to full size. mgv5_cavern_taper (Cavern taper) int 256 # Defines full size of caverns, smaller values create larger caverns. mgv5_cavern_threshold (Cavern threshold) float 0.7 # Lower Y limit of dungeons. mgv5_dungeon_ymin (Dungeon minimum Y) int -31000 # Upper Y limit of dungeons. mgv5_dungeon_ymax (Dungeon maximum Y) int 31000 [**Noises] # Variation of biome filler depth. mgv5_np_filler_depth (Filler depth noise) noise_params_2d 0, 1, (150, 150, 150), 261, 4, 0.7, 2.0, eased # Variation of terrain vertical scale. # When noise is < -0.55 terrain is near-flat. mgv5_np_factor (Factor noise) noise_params_2d 0, 1, (250, 250, 250), 920381, 3, 0.45, 2.0, eased # Y-level of average terrain surface. mgv5_np_height (Height noise) noise_params_2d 0, 10, (250, 250, 250), 84174, 4, 0.5, 2.0, eased # First of two 3D noises that together define tunnels. mgv5_np_cave1 (Cave1 noise) noise_params_3d 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0 # Second of two 3D noises that together define tunnels. mgv5_np_cave2 (Cave2 noise) noise_params_3d 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0 # 3D noise defining giant caverns. mgv5_np_cavern (Cavern noise) noise_params_3d 0, 1, (384, 128, 384), 723, 5, 0.63, 2.0 # 3D noise defining terrain. mgv5_np_ground (Ground noise) noise_params_3d 0, 40, (80, 80, 80), 983240, 4, 0.55, 2.0, eased # 3D noise that determines number of dungeons per mapchunk. mgv5_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2, 0.8, 2.0 [*Mapgen V6] # Map generation attributes specific to Mapgen v6. # The 'snowbiomes' flag enables the new 5 biome system. # When the 'snowbiomes' flag is enabled jungles are automatically enabled and # the 'jungles' flag is ignored. mgv6_spflags (Mapgen V6 specific flags) flags jungles,biomeblend,mudflow,snowbiomes,noflat,trees jungles,biomeblend,mudflow,snowbiomes,flat,trees,nojungles,nobiomeblend,nomudflow,nosnowbiomes,noflat,notrees # Deserts occur when np_biome exceeds this value. # When the 'snowbiomes' flag is enabled, this is ignored. mgv6_freq_desert (Desert noise threshold) float 0.45 # Sandy beaches occur when np_beach exceeds this value. mgv6_freq_beach (Beach noise threshold) float 0.15 # Lower Y limit of dungeons. mgv6_dungeon_ymin (Dungeon minimum Y) int -31000 # Upper Y limit of dungeons. mgv6_dungeon_ymax (Dungeon maximum Y) int 31000 [**Noises] # Y-level of lower terrain and seabed. mgv6_np_terrain_base (Terrain base noise) noise_params_2d -4, 20, (250, 250, 250), 82341, 5, 0.6, 2.0, eased # Y-level of higher terrain that creates cliffs. mgv6_np_terrain_higher (Terrain higher noise) noise_params_2d 20, 16, (500, 500, 500), 85039, 5, 0.6, 2.0, eased # Varies steepness of cliffs. mgv6_np_steepness (Steepness noise) noise_params_2d 0.85, 0.5, (125, 125, 125), -932, 5, 0.7, 2.0, eased # Defines distribution of higher terrain. mgv6_np_height_select (Height select noise) noise_params_2d 0.5, 1, (250, 250, 250), 4213, 5, 0.69, 2.0, eased # Varies depth of biome surface nodes. mgv6_np_mud (Mud noise) noise_params_2d 4, 2, (200, 200, 200), 91013, 3, 0.55, 2.0, eased # Defines areas with sandy beaches. mgv6_np_beach (Beach noise) noise_params_2d 0, 1, (250, 250, 250), 59420, 3, 0.50, 2.0, eased # Temperature variation for biomes. mgv6_np_biome (Biome noise) noise_params_2d 0, 1, (500, 500, 500), 9130, 3, 0.50, 2.0, eased # Variation of number of caves. mgv6_np_cave (Cave noise) noise_params_2d 6, 6, (250, 250, 250), 34329, 3, 0.50, 2.0, eased # Humidity variation for biomes. mgv6_np_humidity (Humidity noise) noise_params_2d 0.5, 0.5, (500, 500, 500), 72384, 3, 0.50, 2.0, eased # Defines tree areas and tree density. mgv6_np_trees (Trees noise) noise_params_2d 0, 1, (125, 125, 125), 2, 4, 0.66, 2.0, eased # Defines areas where trees have apples. mgv6_np_apple_trees (Apple trees noise) noise_params_2d 0, 1, (100, 100, 100), 342902, 3, 0.45, 2.0, eased [*Mapgen V7] # Map generation attributes specific to Mapgen v7. # 'ridges' enables the rivers. mgv7_spflags (Mapgen V7 specific flags) flags mountains,ridges,nofloatlands,caverns mountains,ridges,floatlands,caverns,nomountains,noridges,nofloatlands,nocaverns # Y of mountain density gradient zero level. Used to shift mountains vertically. mgv7_mount_zero_level (Mountain zero level) int 0 # Controls width of tunnels, a smaller value creates wider tunnels. mgv7_cave_width (Cave width) float 0.09 # Y of upper limit of large caves. mgv7_large_cave_depth (Large cave depth) int -33 # Deprecated, define and locate cave liquids using biome definitions instead. # Y of upper limit of lava in large caves. mgv7_lava_depth (Lava depth) int -256 # Controls the density of mountain-type floatlands. # Is a noise offset added to the 'mgv7_np_mountain' noise value. mgv7_float_mount_density (Floatland mountain density) float 0.6 # Typical maximum height, above and below midpoint, of floatland mountains. mgv7_float_mount_height (Floatland mountain height) float 128.0 # Alters how mountain-type floatlands taper above and below midpoint. mgv7_float_mount_exponent (Floatland mountain exponent) float 0.75 # Y-level of floatland midpoint and lake surface. mgv7_floatland_level (Floatland level) int 1280 # Y-level to which floatland shadows extend. mgv7_shadow_limit (Shadow limit) int 1024 # Y-level of cavern upper limit. mgv7_cavern_limit (Cavern limit) int -256 # Y-distance over which caverns expand to full size. mgv7_cavern_taper (Cavern taper) int 256 # Defines full size of caverns, smaller values create larger caverns. mgv7_cavern_threshold (Cavern threshold) float 0.7 # Lower Y limit of dungeons. mgv7_dungeon_ymin (Dungeon minimum Y) int -31000 # Upper Y limit of dungeons. mgv7_dungeon_ymax (Dungeon maximum Y) int 31000 [**Noises] # Y-level of higher terrain that creates cliffs. mgv7_np_terrain_base (Terrain base noise) noise_params_2d 4, 70, (600, 600, 600), 82341, 5, 0.6, 2.0, eased # Y-level of lower terrain and seabed. mgv7_np_terrain_alt (Terrain alternative noise) noise_params_2d 4, 25, (600, 600, 600), 5934, 5, 0.6, 2.0, eased # Varies roughness of terrain. # Defines the 'persistence' value for terrain_base and terrain_alt noises. mgv7_np_terrain_persist (Terrain persistence noise) noise_params_2d 0.6, 0.1, (2000, 2000, 2000), 539, 3, 0.6, 2.0, eased # Defines distribution of higher terrain and steepness of cliffs. mgv7_np_height_select (Height select noise) noise_params_2d -8, 16, (500, 500, 500), 4213, 6, 0.7, 2.0, eased # Variation of biome filler depth. mgv7_np_filler_depth (Filler depth noise) noise_params_2d 0, 1.2, (150, 150, 150), 261, 3, 0.7, 2.0, eased # Variation of maximum mountain height (in nodes). mgv7_np_mount_height (Mountain height noise) noise_params_2d 256, 112, (1000, 1000, 1000), 72449, 3, 0.6, 2.0, eased # Defines large-scale river channel structure. mgv7_np_ridge_uwater (Ridge underwater noise) noise_params_2d 0, 1, (1000, 1000, 1000), 85039, 5, 0.6, 2.0, eased # Defines areas of floatland smooth terrain. # Smooth floatlands occur when noise > 0. mgv7_np_floatland_base (Floatland base noise) noise_params_2d -0.6, 1.5, (600, 600, 600), 114, 5, 0.6, 2.0, eased # Variation of hill height and lake depth on floatland smooth terrain. mgv7_np_float_base_height (Floatland base height noise) noise_params_2d 48, 24, (300, 300, 300), 907, 4, 0.7, 2.0, eased # 3D noise defining mountain structure and height. # Also defines structure of floatland mountain terrain. mgv7_np_mountain (Mountain noise) noise_params_3d -0.6, 1, (250, 350, 250), 5333, 5, 0.63, 2.0 # 3D noise defining structure of river canyon walls. mgv7_np_ridge (Ridge noise) noise_params_3d 0, 1, (100, 100, 100), 6467, 4, 0.75, 2.0 # 3D noise defining giant caverns. mgv7_np_cavern (Cavern noise) noise_params_3d 0, 1, (384, 128, 384), 723, 5, 0.63, 2.0 # First of two 3D noises that together define tunnels. mgv7_np_cave1 (Cave1 noise) noise_params_3d 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0 # Second of two 3D noises that together define tunnels. mgv7_np_cave2 (Cave2 noise) noise_params_3d 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0 # 3D noise that determines number of dungeons per mapchunk. mgv7_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2, 0.8, 2.0 [*Mapgen Carpathian] # Map generation attributes specific to Mapgen Carpathian. mgcarpathian_spflags (Mapgen Carpathian specific flags) flags caverns,norivers caverns,nocaverns,rivers,norivers # Defines the base ground level. mgcarpathian_base_level (Base ground level) float 12.0 # Defines the width of the river channel. mgcarpathian_river_width (River channel width) float 0.05 # Defines the depth of the river channel. mgcarpathian_river_depth (River channel depth) float 24.0 # Defines the width of the river valley. mgcarpathian_valley_width (River valley width) float 0.25 # Controls width of tunnels, a smaller value creates wider tunnels. mgcarpathian_cave_width (Cave width) float 0.09 # Y of upper limit of large caves. mgcarpathian_large_cave_depth (Large cave depth) int -33 # Deprecated, define and locate cave liquids using biome definitions instead. # Y of upper limit of lava in large caves. mgcarpathian_lava_depth (Lava depth) int -256 # 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 # Lower Y limit of dungeons. mgcarpathian_dungeon_ymin (Dungeon minimum Y) int -31000 # Upper Y limit of dungeons. mgcarpathian_dungeon_ymax (Dungeon maximum Y) int 31000 [**Noises] # Variation of biome filler depth. mgcarpathian_np_filler_depth (Filler depth noise) noise_params_2d 0, 1, (128, 128, 128), 261, 3, 0.7, 2.0, eased # First of 4 2D noises that together define hill/mountain range height. mgcarpathian_np_height1 (Hilliness1 noise) noise_params_2d 0, 5, (251, 251, 251), 9613, 5, 0.5, 2.0, eased # Second of 4 2D noises that together define hill/mountain range height. mgcarpathian_np_height2 (Hilliness2 noise) noise_params_2d 0, 5, (383, 383, 383), 1949, 5, 0.5, 2.0, eased # Third of 4 2D noises that together define hill/mountain range height. mgcarpathian_np_height3 (Hilliness3 noise) noise_params_2d 0, 5, (509, 509, 509), 3211, 5, 0.5, 2.0, eased # Fourth of 4 2D noises that together define hill/mountain range height. mgcarpathian_np_height4 (Hilliness4 noise) noise_params_2d 0, 5, (631, 631, 631), 1583, 5, 0.5, 2.0, eased # 2D noise that controls the size/occurrence of rolling hills. mgcarpathian_np_hills_terrain (Rolling hills spread noise) noise_params_2d 1, 1, (1301, 1301, 1301), 1692, 3, 0.5, 2.0, eased # 2D noise that controls the size/occurrence of ridged mountain ranges. mgcarpathian_np_ridge_terrain (Ridge mountain spread noise) noise_params_2d 1, 1, (1889, 1889, 1889), 3568, 3, 0.5, 2.0, eased # 2D noise that controls the size/occurrence of step mountain ranges. mgcarpathian_np_step_terrain (Step mountain spread noise) noise_params_2d 1, 1, (1889, 1889, 1889), 4157, 3, 0.5, 2.0, eased # 2D noise that controls the shape/size of rolling hills. mgcarpathian_np_hills (Rolling hill size noise) noise_params_2d 0, 3, (257, 257, 257), 6604, 6, 0.5, 2.0, eased # 2D noise that controls the shape/size of ridged mountains. mgcarpathian_np_ridge_mnt (Ridged mountain size noise) noise_params_2d 0, 12, (743, 743, 743), 5520, 6, 0.7, 2.0, eased # 2D noise that controls the shape/size of step mountains. mgcarpathian_np_step_mnt (Step mountain size noise) noise_params_2d 0, 8, (509, 509, 509), 2590, 6, 0.6, 2.0, eased # 2D noise that locates the river valleys and channels. mgcarpathian_np_rivers (River noise) noise_params_2d 0, 1, (1000, 1000, 1000), 85039, 5, 0.6, 2.0, eased # 3D noise for mountain overhangs, cliffs, etc. Usually small variations. mgcarpathian_np_mnt_var (Mountain variation noise) noise_params_3d 0, 1, (499, 499, 499), 2490, 5, 0.55, 2.0 # First of two 3D noises that together define tunnels. mgcarpathian_np_cave1 (Cave1 noise) noise_params_3d 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0 # Second of two 3D noises that together define tunnels. mgcarpathian_np_cave2 (Cave2 noise) noise_params_3d 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0 # 3D noise defining giant caverns. mgcarpathian_np_cavern (Cavern noise) noise_params_3d 0, 1, (384, 128, 384), 723, 5, 0.63, 2.0 # 3D noise that determines number of dungeons per mapchunk. mgcarpathian_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2, 0.8, 2.0 [*Mapgen Flat] # Map generation attributes specific to Mapgen flat. # Occasional lakes and hills can be added to the flat world. mgflat_spflags (Mapgen Flat specific flags) flags nolakes,nohills lakes,hills,nolakes,nohills # Y of flat ground. mgflat_ground_level (Ground level) int 8 # Y of upper limit of large caves. mgflat_large_cave_depth (Large cave depth) int -33 # Deprecated, define and locate cave liquids using biome definitions instead. # Y of upper limit of lava in large caves. mgflat_lava_depth (Lava depth) int -256 # Controls width of tunnels, a smaller value creates wider tunnels. mgflat_cave_width (Cave width) float 0.09 # Terrain noise threshold for lakes. # Controls proportion of world area covered by lakes. # Adjust towards 0.0 for a larger proportion. mgflat_lake_threshold (Lake threshold) float -0.45 # Controls steepness/depth of lake depressions. mgflat_lake_steepness (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 (Hill threshold) float 0.45 # Controls steepness/height of hills. mgflat_hill_steepness (Hill steepness) float 64.0 # Lower Y limit of dungeons. mgflat_dungeon_ymin (Dungeon minimum Y) int -31000 # Upper Y limit of dungeons. mgflat_dungeon_ymax (Dungeon maximum Y) int 31000 [**Noises] # Defines location and terrain of optional hills and lakes. mgflat_np_terrain (Terrain noise) noise_params_2d 0, 1, (600, 600, 600), 7244, 5, 0.6, 2.0, eased # Variation of biome filler depth. mgflat_np_filler_depth (Filler depth noise) noise_params_2d 0, 1.2, (150, 150, 150), 261, 3, 0.7, 2.0, eased # First of two 3D noises that together define tunnels. mgflat_np_cave1 (Cave1 noise) noise_params_3d 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0 # Second of two 3D noises that together define tunnels. mgflat_np_cave2 (Cave2 noise) noise_params_3d 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0 # 3D noise that determines number of dungeons per mapchunk. mgflat_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2, 0.8, 2.0 [*Mapgen Fractal] # Map generation attributes specific to Mapgen flat. # 'terrain' enables the generation of non-fractal terrain: # ocean, islands and underground. mgfractal_spflags (Mapgen Fractal specific flags) flags terrain terrain,noterrain # Controls width of tunnels, a smaller value creates wider tunnels. mgfractal_cave_width (Cave width) float 0.09 # Y of upper limit of large caves. mgfractal_large_cave_depth (Large cave depth) int -33 # Deprecated, define and locate cave liquids using biome definitions instead. # Y of upper limit of lava in large caves. mgfractal_lava_depth (Lava depth) int -256 # Lower Y limit of dungeons. mgfractal_dungeon_ymin (Dungeon minimum Y) int -31000 # Upper Y limit of dungeons. mgfractal_dungeon_ymax (Dungeon maximum Y) int 31000 # Selects one of 18 fractal types. # 1 = 4D "Roundy" mandelbrot set. # 2 = 4D "Roundy" julia set. # 3 = 4D "Squarry" mandelbrot set. # 4 = 4D "Squarry" julia set. # 5 = 4D "Mandy Cousin" mandelbrot set. # 6 = 4D "Mandy Cousin" julia set. # 7 = 4D "Variation" mandelbrot set. # 8 = 4D "Variation" julia set. # 9 = 3D "Mandelbrot/Mandelbar" mandelbrot set. # 10 = 3D "Mandelbrot/Mandelbar" julia set. # 11 = 3D "Christmas Tree" mandelbrot set. # 12 = 3D "Christmas Tree" julia set. # 13 = 3D "Mandelbulb" mandelbrot set. # 14 = 3D "Mandelbulb" julia set. # 15 = 3D "Cosine Mandelbulb" mandelbrot set. # 16 = 3D "Cosine Mandelbulb" julia set. # 17 = 4D "Mandelbulb" mandelbrot set. # 18 = 4D "Mandelbulb" julia set. mgfractal_fractal (Fractal type) int 1 1 18 # Iterations of the recursive function. # Increasing this increases the amount of fine detail, but also # increases processing load. # At iterations = 20 this mapgen has a similar load to mapgen V7. mgfractal_iterations (Iterations) int 11 # (X,Y,Z) scale of fractal in nodes. # Actual fractal size will be 2 to 3 times larger. # These numbers can be made very large, the fractal does # not have to fit inside the world. # Increase these to 'zoom' into the detail of the fractal. # Default is for a vertically-squashed shape suitable for # an island, set all 3 numbers equal for the raw shape. mgfractal_scale (Scale) v3f (4096.0, 1024.0, 4096.0) # (X,Y,Z) offset of fractal from world center in units of 'scale'. # Can be used to move a desired point to (0, 0) to create a # suitable spawn point, or to allow 'zooming in' on a desired # point by increasing 'scale'. # The default is tuned for a suitable spawn point for mandelbrot # sets with default parameters, it may need altering in other # situations. # Range roughly -2 to 2. Multiply by 'scale' for offset in nodes. mgfractal_offset (Offset) v3f (1.79, 0.0, 0.0) # W coordinate of the generated 3D slice of a 4D fractal. # Determines which 3D slice of the 4D shape is generated. # Alters the shape of the fractal. # Has no effect on 3D fractals. # Range roughly -2 to 2. mgfractal_slice_w (Slice w) float 0.0 # Julia set only. # X component of hypercomplex constant. # Alters the shape of the fractal. # Range roughly -2 to 2. mgfractal_julia_x (Julia x) float 0.33 # Julia set only. # Y component of hypercomplex constant. # Alters the shape of the fractal. # Range roughly -2 to 2. mgfractal_julia_y (Julia y) float 0.33 # Julia set only. # Z component of hypercomplex constant. # Alters the shape of the fractal. # Range roughly -2 to 2. mgfractal_julia_z (Julia z) float 0.33 # Julia set only. # W component of hypercomplex constant. # Alters the shape of the fractal. # Has no effect on 3D fractals. # Range roughly -2 to 2. mgfractal_julia_w (Julia w) float 0.33 [**Noises] # Y-level of seabed. mgfractal_np_seabed (Seabed noise) noise_params_2d -14, 9, (600, 600, 600), 41900, 5, 0.6, 2.0, eased # Variation of biome filler depth. mgfractal_np_filler_depth (Filler depth noise) noise_params_2d 0, 1.2, (150, 150, 150), 261, 3, 0.7, 2.0, eased # First of two 3D noises that together define tunnels. mgfractal_np_cave1 (Cave1 noise) noise_params_3d 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0 # Second of two 3D noises that together define tunnels. mgfractal_np_cave2 (Cave2 noise) noise_params_3d 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0 # 3D noise that determines number of dungeons per mapchunk. mgfractal_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2, 0.8, 2.0 [*Mapgen Valleys] # Map generation attributes specific to Mapgen Valleys. # 'altitude_chill': Reduces heat with altitude. # 'humid_rivers': Increases humidity around rivers. # 'vary_river_depth': If enabled, low humidity and high heat causes rivers # to become shallower and occasionally dry. # 'altitude_dry': Reduces humidity with altitude. mgvalleys_spflags (Mapgen Valleys specific flags) flags altitude_chill,humid_rivers,vary_river_depth,altitude_dry altitude_chill,humid_rivers,vary_river_depth,altitude_dry,noaltitude_chill,nohumid_rivers,novary_river_depth,noaltitude_dry # The vertical distance over which heat drops by 20 if 'altitude_chill' is # enabled. Also the vertical distance over which humidity drops by 10 if # 'altitude_dry' is enabled. mgvalleys_altitude_chill (Altitude chill) int 90 # Depth below which you'll find large caves. mgvalleys_large_cave_depth (Large cave depth) int -33 # Deprecated, define and locate cave liquids using biome definitions instead. # Y of upper limit of lava in large caves. mgvalleys_lava_depth (Lava depth) int 1 # Depth below which you'll find giant caverns. mgvalleys_cavern_limit (Cavern upper limit) int -256 # Y-distance over which caverns expand to full size. mgvalleys_cavern_taper (Cavern taper) int 192 # Defines full size of caverns, smaller values create larger caverns. mgvalleys_cavern_threshold (Cavern threshold) float 0.6 # How deep to make rivers. mgvalleys_river_depth (River depth) int 4 # How wide to make rivers. mgvalleys_river_size (River size) int 5 # Controls width of tunnels, a smaller value creates wider tunnels. mgvalleys_cave_width (Cave width) float 0.09 # Lower Y limit of dungeons. mgvalleys_dungeon_ymin (Dungeon minimum Y) int -31000 # Upper Y limit of dungeons. mgvalleys_dungeon_ymax (Dungeon maximum Y) int 63 [**Noises] # First of two 3D noises that together define tunnels. mgvalleys_np_cave1 (Cave noise #1) noise_params_3d 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0 # Second of two 3D noises that together define tunnels. mgvalleys_np_cave2 (Cave noise #2) noise_params_3d 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0 # The depth of dirt or other biome filler node. mgvalleys_np_filler_depth (Filler depth) noise_params_2d 0, 1.2, (256, 256, 256), 1605, 3, 0.5, 2.0, eased # 3D noise defining giant caverns. mgvalleys_np_cavern (Cavern noise) noise_params_3d 0, 1, (768, 256, 768), 59033, 6, 0.63, 2.0 # Defines large-scale river channel structure. mgvalleys_np_rivers (River noise) noise_params_2d 0, 1, (256, 256, 256), -6050, 5, 0.6, 2.0, eased # Base terrain height. mgvalleys_np_terrain_height (Terrain height) noise_params_2d -10, 50, (1024, 1024, 1024), 5202, 6, 0.4, 2.0, eased # Raises terrain to make valleys around the rivers. mgvalleys_np_valley_depth (Valley depth) noise_params_2d 5, 4, (512, 512, 512), -1914, 1, 1.0, 2.0, eased # Slope and fill work together to modify the heights. mgvalleys_np_inter_valley_fill (Valley fill) noise_params_3d 0, 1, (256, 512, 256), 1993, 6, 0.8, 2.0 # Amplifies the valleys. mgvalleys_np_valley_profile (Valley profile) noise_params_2d 0.6, 0.5, (512, 512, 512), 777, 1, 1.0, 2.0, eased # Slope and fill work together to modify the heights. mgvalleys_np_inter_valley_slope (Valley slope) noise_params_2d 0.5, 0.5, (128, 128, 128), 746, 1, 1.0, 2.0, eased # 3D noise that determines number of dungeons per mapchunk. mgvalleys_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2, 0.8, 2.0 [*Advanced] # Size of mapchunks generated by mapgen, stated in mapblocks (16 nodes). # WARNING!: There is no benefit, and there are several dangers, in # increasing this value above 5. # Reducing this value increases cave and dungeon density. # Altering this value is for special usage, leaving it unchanged is # recommended. chunksize (Chunk size) int 5 # Dump the mapgen debug information. enable_mapgen_debug_info (Mapgen debug) bool false # Maximum number of blocks that can be queued for loading. emergequeue_limit_total (Absolute limit of emerge queues) int 512 # Maximum number of blocks to be queued that are to be loaded from file. # Set to blank for an appropriate amount to be chosen automatically. emergequeue_limit_diskonly (Limit of emerge queues on disk) int 64 # Maximum number of blocks to be queued that are to be generated. # Set to blank for an appropriate amount to be chosen automatically. emergequeue_limit_generate (Limit of emerge queues to generate) int 64 # Number of emerge threads to use. # WARNING: Currently there are multiple bugs that may cause crashes when # 'num_emerge_threads' is larger than 1. Until this warning is removed it is # strongly recommended this value is set to the default '1'. # Value 0: # - Automatic selection. The number of emerge threads will be # - 'number of processors - 2', with a lower limit of 1. # Any other value: # - Specifies the number of emerge threads, with a lower limit of 1. # WARNING: Increasing the number of emerge threads increases engine mapgen # speed, but this may harm game performance by interfering with other # processes, especially in singleplayer and/or when running Lua code in # 'on_generated'. For many users the optimum setting may be '1'. num_emerge_threads (Number of emerge threads) int 1 [Online Content Repository] # The URL for the content repository contentdb_url (ContentDB URL) string https://content.minetest.net # Comma-separated list of flags to hide in the content repository. # "nonfree" can be used to hide packages which do not qualify as 'free software', # as defined by the Free Software Foundation. # You can also specify content ratings. # These flags are independent from Minetest versions, # so see a full list at https://content.minetest.net/help/content_flags/ contentdb_flag_blacklist (ContentDB Flag Blacklist) string nonfree, desktop_default