Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
mapgen_v6.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2010-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
4// Copyright (C) 2013-2018 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
5// Copyright (C) 2014-2018 paramat
6
7#pragma once
8
9#include "mapgen.h"
10#include "noise.h"
11
12#define MGV6_AVERAGE_MUD_AMOUNT 4
13#define MGV6_DESERT_STONE_BASE -32
14#define MGV6_ICE_BASE 0
15#define MGV6_FREQ_HOT 0.4
16#define MGV6_FREQ_SNOW -0.4
17#define MGV6_FREQ_TAIGA 0.5
18#define MGV6_FREQ_JUNGLE 0.5
19
21#define MGV6_JUNGLES 0x01
22#define MGV6_BIOMEBLEND 0x02
23#define MGV6_MUDFLOW 0x04
24#define MGV6_SNOWBIOMES 0x08
25#define MGV6_FLAT 0x10
26#define MGV6_TREES 0x20
27#define MGV6_TEMPLES 0x40
28
29
31
32
41
42
68
69
70class MapgenV6 : public Mapgen {
71public:
74
80
93
95
100
114
119
120 MapgenV6(MapgenV6Params *params, EmergeParams *emerge);
121 ~MapgenV6();
122
123 virtual MapgenType getType() const { return MAPGEN_V6; }
124
125 void makeChunk(BlockMakeData *data);
128
129 float baseTerrainLevel(float terrain_base, float terrain_higher,
130 float steepness, float height_select);
131 virtual float baseTerrainLevelFromNoise(v2s16 p);
132 virtual float baseTerrainLevelFromMap(v2s16 p);
133 virtual float baseTerrainLevelFromMap(int index);
134
135 s16 find_stone_level(v2s16 p2d);
136 bool block_is_underground(u64 seed, v3s16 blockpos);
137
138 float getHumidity(v2s16 p);
139 float getTreeAmount(v2s16 p);
141 float getMudAmount(int index);
142 bool getHaveBeach(int index);
144 BiomeV6Type getBiome(int index, v2s16 p);
145
146 u32 get_blockseed(u64 seed, v3s16 p);
147
148 virtual void calculateNoise();
149 int generateGround();
150 void addMud();
151 void flowMud(s16 &mudflow_minpos, s16 &mudflow_maxpos);
152 void moveMud(u32 remove_index, u32 place_index,
153 u32 above_remove_index, v2s16 pos, v3s16 em);
154 void growGrass();
156 virtual void generateCaves(int max_stone_y);
157};
Definition emerge.h:85
Definition mapgen_v6.h:70
void addMud()
Definition mapgen_v6.cpp:697
v3s16 central_area_size
Definition mapgen_v6.h:79
float baseTerrainLevel(float terrain_base, float terrain_higher, float steepness, float height_select)
Definition mapgen_v6.cpp:259
virtual float baseTerrainLevelFromMap(v2s16 p)
Definition mapgen_v6.cpp:306
content_t c_lava_source
Definition mapgen_v6.h:106
content_t c_dirt_with_snow
Definition mapgen_v6.h:110
virtual void calculateNoise()
Definition mapgen_v6.cpp:628
void growGrass()
Definition mapgen_v6.cpp:1025
content_t c_dirt_with_grass
Definition mapgen_v6.h:103
v3s16 node_max
Definition mapgen_v6.h:76
Noise * noise_height_select
Definition mapgen_v6.h:84
content_t c_water_source
Definition mapgen_v6.h:105
content_t c_cobble
Definition mapgen_v6.h:115
content_t c_stair_desert_stone
Definition mapgen_v6.h:118
virtual MapgenType getType() const
Definition mapgen_v6.h:123
virtual void generateCaves(int max_stone_y)
Definition mapgen_v6.cpp:1076
float freq_desert
Definition mapgen_v6.h:96
content_t c_sand
Definition mapgen_v6.h:104
int ystride
Definition mapgen_v6.h:72
u32 get_blockseed(u64 seed, v3s16 p)
Definition mapgen_v6.cpp:472
s16 find_stone_level(v2s16 p2d)
Definition mapgen_v6.cpp:223
void flowMud(s16 &mudflow_minpos, s16 &mudflow_maxpos)
Definition mapgen_v6.cpp:758
content_t c_gravel
Definition mapgen_v6.h:107
u32 spflags
Definition mapgen_v6.h:73
Noise * noise_terrain_higher
Definition mapgen_v6.h:82
float freq_beach
Definition mapgen_v6.h:97
float getTreeAmount(v2s16 p)
Definition mapgen_v6.cpp:375
content_t c_ice
Definition mapgen_v6.h:113
bool getHaveBeach(int index)
Definition mapgen_v6.cpp:415
void moveMud(u32 remove_index, u32 place_index, u32 above_remove_index, v2s16 pos, v3s16 em)
Definition mapgen_v6.cpp:872
content_t c_mossycobble
Definition mapgen_v6.h:116
int getGroundLevelAtPoint(v2s16 p)
Definition mapgen_v6.cpp:328
NoiseParams * np_trees
Definition mapgen_v6.h:91
content_t c_desert_sand
Definition mapgen_v6.h:109
int generateGround()
Definition mapgen_v6.cpp:652
content_t c_dirt
Definition mapgen_v6.h:102
Noise * noise_humidity
Definition mapgen_v6.h:88
content_t c_snow
Definition mapgen_v6.h:111
bool block_is_underground(u64 seed, v3s16 blockpos)
Definition mapgen_v6.cpp:243
content_t c_stone
Definition mapgen_v6.h:101
s16 dungeon_ymin
Definition mapgen_v6.h:98
int getSpawnLevelAtPoint(v2s16 p)
Definition mapgen_v6.cpp:334
content_t c_snowblock
Definition mapgen_v6.h:112
Noise * noise_biome
Definition mapgen_v6.h:87
Noise * noise_beach
Definition mapgen_v6.h:86
virtual float baseTerrainLevelFromNoise(v2s16 p)
Definition mapgen_v6.cpp:287
Noise * noise_steepness
Definition mapgen_v6.h:83
void makeChunk(BlockMakeData *data)
Definition mapgen_v6.cpp:481
bool getHaveAppleTree(v2s16 p)
Definition mapgen_v6.cpp:390
Noise * noise_terrain_base
Definition mapgen_v6.h:81
v3s16 full_node_max
Definition mapgen_v6.h:78
void placeTreesAndJungleGrass()
Definition mapgen_v6.cpp:911
content_t c_stair_cobble
Definition mapgen_v6.h:117
BiomeV6Type getBiome(v2s16 p)
Definition mapgen_v6.cpp:348
content_t c_desert_stone
Definition mapgen_v6.h:108
NoiseParams * np_cave
Definition mapgen_v6.h:89
Noise * noise_mud
Definition mapgen_v6.h:85
MapgenV6(MapgenV6Params *params, EmergeParams *emerge)
Definition mapgen_v6.cpp:43
float getHumidity(v2s16 p)
Definition mapgen_v6.cpp:356
NoiseParams np_dungeons
Definition mapgen_v6.h:94
~MapgenV6()
Definition mapgen_v6.cpp:136
s16 dungeon_ymax
Definition mapgen_v6.h:99
float getMudAmount(int index)
Definition mapgen_v6.cpp:402
NoiseParams * np_apple_trees
Definition mapgen_v6.h:92
NoiseParams * np_humidity
Definition mapgen_v6.h:90
v3s16 node_min
Definition mapgen_v6.h:75
v3s16 full_node_min
Definition mapgen_v6.h:77
Definition mapgen.h:153
s32 seed
Definition mapgen.h:156
Definition noise.h:146
Definition settings.h:109
static const char * settings[]
Definition fontengine.cpp:27
core::vector2d< s16 > v2s16
Definition irr_v2d.h:12
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
MapgenType
Definition mapgen.h:102
@ MAPGEN_V6
Definition mapgen.h:110
BiomeV6Type
Definition mapgen_v6.h:34
@ BT_NORMAL
Definition mapgen_v6.h:35
@ BT_TUNDRA
Definition mapgen_v6.h:38
@ BT_TAIGA
Definition mapgen_v6.h:39
@ BT_JUNGLE
Definition mapgen_v6.h:37
@ BT_DESERT
Definition mapgen_v6.h:36
FlagDesc flagdesc_mapgen_v6[]
Definition mapgen_v6.cpp:28
u16 content_t
Definition mapnode.h:22
Definition emerge.h:37
Definition string.h:67
Definition mapgen.h:114
Definition mapgen_v6.h:43
void setDefaultSettings(Settings *settings)
Definition mapgen_v6.cpp:211
void writeParams(Settings *settings) const
Definition mapgen_v6.cpp:189
NoiseParams np_height_select
Definition mapgen_v6.h:52
float freq_beach
Definition mapgen_v6.h:45
MapgenV6Params()
Definition mapgen_v6.cpp:151
s16 dungeon_ymax
Definition mapgen_v6.h:47
NoiseParams np_humidity
Definition mapgen_v6.h:57
NoiseParams np_apple_trees
Definition mapgen_v6.h:59
NoiseParams np_steepness
Definition mapgen_v6.h:51
~MapgenV6Params()=default
void readParams(const Settings *settings)
Definition mapgen_v6.cpp:167
NoiseParams np_biome
Definition mapgen_v6.h:55
NoiseParams np_cave
Definition mapgen_v6.h:56
NoiseParams np_terrain_higher
Definition mapgen_v6.h:50
NoiseParams np_terrain_base
Definition mapgen_v6.h:49
float freq_desert
Definition mapgen_v6.h:44
NoiseParams np_trees
Definition mapgen_v6.h:58
NoiseParams np_beach
Definition mapgen_v6.h:54
NoiseParams np_mud
Definition mapgen_v6.h:53
s16 dungeon_ymin
Definition mapgen_v6.h:46
Definition noise.h:119
static std::string p(std::string path)
Definition test_filesys.cpp:53