Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
mapgen_valleys.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2016-2019 Duane Robertson <duane@duanerobertson.com>
4Copyright (C) 2016-2019 paramat
5
6Based on Valleys Mapgen by Gael de Sailly
7(https://forum.minetest.net/viewtopic.php?f=9&t=11430)
8and mapgen_v7, mapgen_flat by kwolekr and paramat.
9
10Licensing changed by permission of Gael de Sailly.
11
12This program is free software; you can redistribute it and/or modify
13it under the terms of the GNU Lesser General Public License as published by
14the Free Software Foundation; either version 2.1 of the License, or
15(at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU Lesser General Public License for more details.
21
22You should have received a copy of the GNU Lesser General Public License along
23with this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25*/
26
27
28#pragma once
29
30#include "mapgen.h"
31
32#define MGVALLEYS_ALT_CHILL 0x01
33#define MGVALLEYS_HUMID_RIVERS 0x02
34#define MGVALLEYS_VARY_RIVER_DEPTH 0x04
35#define MGVALLEYS_ALT_DRY 0x08
36
37class BiomeManager;
39
41
42
45 u16 river_depth = 4;
46 u16 river_size = 5;
47
48 float cave_width = 0.09f;
54 float large_cave_flooded = 0.5f;
55 s16 cavern_limit = -256;
56 s16 cavern_taper = 192;
57 float cavern_threshold = 0.6f;
58 s16 dungeon_ymin = -31000;
59 s16 dungeon_ymax = 63;
60
68
73
76
77 void readParams(const Settings *settings);
78 void writeParams(Settings *settings) const;
79 void setDefaultSettings(Settings *settings);
80};
81
82
83class MapgenValleys : public MapgenBasic {
84public:
85
87 EmergeParams *emerge);
89
90 virtual MapgenType getType() const { return MAPGEN_VALLEYS; }
91
92 virtual void makeChunk(BlockMakeData *data);
94
95private:
97
101
108
109 virtual int generateTerrain();
110};
Definition: mg_biome.h:170
Definition: mg_biome.h:211
Definition: emerge.h:98
Definition: mapgen.h:294
Definition: mapgen_valleys.h:83
virtual void makeChunk(BlockMakeData *data)
Definition: mapgen_valleys.cpp:209
int getSpawnLevelAtPoint(v2s16 p)
Definition: mapgen_valleys.cpp:293
Noise * noise_inter_valley_fill
Definition: mapgen_valleys.h:102
virtual int generateTerrain()
Definition: mapgen_valleys.cpp:345
BiomeGenOriginal * m_bgen
Definition: mapgen_valleys.h:96
Noise * noise_valley_profile
Definition: mapgen_valleys.h:107
float river_depth_bed
Definition: mapgen_valleys.h:99
float altitude_chill
Definition: mapgen_valleys.h:98
virtual MapgenType getType() const
Definition: mapgen_valleys.h:90
Noise * noise_inter_valley_slope
Definition: mapgen_valleys.h:103
~MapgenValleys()
Definition: mapgen_valleys.cpp:102
Noise * noise_valley_depth
Definition: mapgen_valleys.h:106
Noise * noise_rivers
Definition: mapgen_valleys.h:104
Noise * noise_terrain_height
Definition: mapgen_valleys.h:105
float river_size_factor
Definition: mapgen_valleys.h:100
Definition: noise.h:146
Definition: settings.h:124
core::vector2d< s16 > v2s16
Definition: irr_v2d.h:27
static LightingParams params
Definition: light.cpp:40
MapgenType
Definition: mapgen.h:117
@ MAPGEN_VALLEYS
Definition: mapgen.h:119
FlagDesc flagdesc_mapgen_valleys[]
Definition: mapgen_valleys.cpp:48
Definition: emerge.h:51
Definition: string.h:80
Definition: mapgen.h:129
Definition: mapgen_valleys.h:43
NoiseParams np_cave1
Definition: mapgen_valleys.h:69
float cavern_threshold
Definition: mapgen_valleys.h:57
NoiseParams np_inter_valley_slope
Definition: mapgen_valleys.h:63
s16 dungeon_ymin
Definition: mapgen_valleys.h:58
NoiseParams np_inter_valley_fill
Definition: mapgen_valleys.h:62
MapgenValleysParams()
Definition: mapgen_valleys.cpp:114
s16 dungeon_ymax
Definition: mapgen_valleys.h:59
u16 river_depth
Definition: mapgen_valleys.h:45
s16 cavern_taper
Definition: mapgen_valleys.h:56
float cave_width
Definition: mapgen_valleys.h:48
void writeParams(Settings *settings) const
Definition: mapgen_valleys.cpp:164
void setDefaultSettings(Settings *settings)
Definition: mapgen_valleys.cpp:198
u16 large_cave_num_min
Definition: mapgen_valleys.h:52
u16 small_cave_num_min
Definition: mapgen_valleys.h:50
u16 altitude_chill
Definition: mapgen_valleys.h:44
NoiseParams np_cavern
Definition: mapgen_valleys.h:71
~MapgenValleysParams()=default
NoiseParams np_rivers
Definition: mapgen_valleys.h:64
s16 cavern_limit
Definition: mapgen_valleys.h:55
u16 large_cave_num_max
Definition: mapgen_valleys.h:53
void readParams(const Settings *settings)
Definition: mapgen_valleys.cpp:130
NoiseParams np_dungeons
Definition: mapgen_valleys.h:72
NoiseParams np_cave2
Definition: mapgen_valleys.h:70
u16 small_cave_num_max
Definition: mapgen_valleys.h:51
NoiseParams np_valley_depth
Definition: mapgen_valleys.h:66
float large_cave_flooded
Definition: mapgen_valleys.h:54
u16 river_size
Definition: mapgen_valleys.h:46
NoiseParams np_filler_depth
Definition: mapgen_valleys.h:61
NoiseParams np_terrain_height
Definition: mapgen_valleys.h:65
s16 large_cave_depth
Definition: mapgen_valleys.h:49
NoiseParams np_valley_profile
Definition: mapgen_valleys.h:67
Definition: noise.h:119
static std::string p(std::string path)
Definition: test_filesys.cpp:64