3 Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include "content_sao.h"
29 #include "voxelalgorithms.h"
31 #include "settings.h" // For g_settings
32 #include "main.h" // For g_profiler
34 #include "dungeongen.h"
38 #include "mapgen_v7.h"
41 /////////////////// Mapgen V7 perlin noise default values
42 NoiseParams nparams_v7_def_terrain_base =
43 {4, 70, v3f(300, 300, 300), 82341, 6, 0.7};
44 NoiseParams nparams_v7_def_terrain_alt =
45 {4, 25, v3f(600, 600, 600), 5934, 5, 0.6};
46 NoiseParams nparams_v7_def_terrain_persist =
47 {0.6, 0.1, v3f(500, 500, 500), 539, 3, 0.6};
48 NoiseParams nparams_v7_def_height_select =
49 {-0.5, 1, v3f(250, 250, 250), 4213, 5, 0.69};
51 NoiseParams nparams_v7_def_filler_depth =
52 {0, 1.2, v3f(150, 150, 150), 261, 4, 0.7};
54 NoiseParams nparams_v7_def_mount_height =
55 {100, 30, v3f(500, 500, 500), 72449, 4, 0.6};
56 NoiseParams nparams_v7_def_ridge_uwater =
57 {0, 1, v3f(500, 500, 500), 85039, 4, 0.6};
58 NoiseParams nparams_v7_def_mountain =
59 {0, 1, v3f(250, 350, 250), 5333, 5, 0.68};
60 NoiseParams nparams_v7_def_ridge =
61 {0, 1, v3f(100, 100, 100), 6467, 4, 0.75};
64 ///////////////////////////////////////////////////////////////////////////////
67 MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge) {
68 this->generating = false;
70 this->emerge = emerge;
71 this->bmgr = emerge->biomedef;
73 this->seed = (int)params->seed;
74 this->water_level = params->water_level;
75 this->flags = params->flags | MGV7_MOUNTAINS | MGV7_RIDGES;
77 this->csize = v3s16(1, 1, 1) * params->chunksize * MAP_BLOCKSIZE;
79 // amount of elements to skip for the next index
80 // for noise/height/biome maps (not vmanip)
81 this->ystride = csize.X;
82 this->zstride = csize.X * csize.Y;
84 this->biomemap = new u8[csize.X * csize.Z];
85 this->heightmap = new s16[csize.X * csize.Z];
86 this->ridge_heightmap = new s16[csize.X * csize.Z];
89 noise_terrain_base = new Noise(¶ms->np_terrain_base, seed, csize.X, csize.Z);
90 noise_terrain_alt = new Noise(¶ms->np_terrain_alt, seed, csize.X, csize.Z);
91 noise_terrain_persist = new Noise(¶ms->np_terrain_persist, seed, csize.X, csize.Z);
92 noise_height_select = new Noise(¶ms->np_height_select, seed, csize.X, csize.Z);
93 noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z);
94 noise_mount_height = new Noise(¶ms->np_mount_height, seed, csize.X, csize.Z);
95 noise_ridge_uwater = new Noise(¶ms->np_ridge_uwater, seed, csize.X, csize.Z);
98 noise_mountain = new Noise(¶ms->np_mountain, seed, csize.X, csize.Y, csize.Z);
99 noise_ridge = new Noise(¶ms->np_ridge, seed, csize.X, csize.Y, csize.Z);
102 noise_heat = new Noise(bmgr->np_heat, seed, csize.X, csize.Z);
103 noise_humidity = new Noise(bmgr->np_humidity, seed, csize.X, csize.Z);
107 MapgenV7::~MapgenV7() {
108 delete noise_terrain_base;
109 delete noise_terrain_persist;
110 delete noise_height_select;
111 delete noise_terrain_alt;
112 delete noise_filler_depth;
113 delete noise_mount_height;
114 delete noise_ridge_uwater;
115 delete noise_mountain;
119 delete noise_humidity;
121 delete[] ridge_heightmap;
127 int MapgenV7::getGroundLevelAtPoint(v2s16 p) {
128 // Base terrain calculation
129 s16 y = baseTerrainLevelAtPoint(p.X, p.Y);
131 // Ridge/river terrain calculation
133 float uwatern = NoisePerlin2DNoTxfm(noise_ridge_uwater->np, p.X, p.Y, seed) * 2;
134 // actually computing the depth of the ridge is much more expensive;
135 // if inside a river, simply guess
136 if (uwatern >= -width && uwatern <= width)
137 return water_level - 10;
139 // Mountain terrain calculation
140 int iters = 128; // don't even bother iterating more than 128 times..
142 //current point would have been air
143 if (!getMountainTerrainAtPoint(p.X, y, p.Y))
153 void MapgenV7::makeChunk(BlockMakeData *data) {
154 assert(data->vmanip);
155 assert(data->nodedef);
156 assert(data->blockpos_requested.X >= data->blockpos_min.X &&
157 data->blockpos_requested.Y >= data->blockpos_min.Y &&
158 data->blockpos_requested.Z >= data->blockpos_min.Z);
159 assert(data->blockpos_requested.X <= data->blockpos_max.X &&
160 data->blockpos_requested.Y <= data->blockpos_max.Y &&
161 data->blockpos_requested.Z <= data->blockpos_max.Z);
163 this->generating = true;
164 this->vm = data->vmanip;
165 this->ndef = data->nodedef;
166 //TimeTaker t("makeChunk");
168 v3s16 blockpos_min = data->blockpos_min;
169 v3s16 blockpos_max = data->blockpos_max;
170 node_min = blockpos_min * MAP_BLOCKSIZE;
171 node_max = (blockpos_max + v3s16(1, 1, 1)) * MAP_BLOCKSIZE - v3s16(1, 1, 1);
172 full_node_min = (blockpos_min - 1) * MAP_BLOCKSIZE;
173 full_node_max = (blockpos_max + 2) * MAP_BLOCKSIZE - v3s16(1, 1, 1);
175 blockseed = emerge->getBlockSeed(full_node_min); //////use getBlockSeed2()!
177 c_stone = ndef->getId("mapgen_stone");
178 c_dirt = ndef->getId("mapgen_dirt");
179 c_dirt_with_grass = ndef->getId("mapgen_dirt_with_grass");
180 c_sand = ndef->getId("mapgen_sand");
181 c_water_source = ndef->getId("mapgen_water_source");
182 c_lava_source = ndef->getId("mapgen_lava_source");
183 c_ice = ndef->getId("default:ice");
184 if (c_ice == CONTENT_IGNORE)
190 // Generate base terrain, mountains, and ridges with initial heightmaps
191 s16 stone_surface_max_y = generateTerrain();
193 updateHeightmap(node_min, node_max);
196 BiomeNoiseInput binput;
197 binput.mapsize = v2s16(csize.X, csize.Z);
198 binput.heat_map = noise_heat->result;
199 binput.humidity_map = noise_humidity->result;
200 binput.height_map = heightmap;
201 bmgr->calcBiomes(&binput, biomemap);
203 // Actually place the biome-specific nodes and what not
206 if (flags & MG_CAVES)
207 generateCaves(stone_surface_max_y);
209 if (flags & MG_DUNGEONS) {
210 DungeonGen dgen(ndef, data->seed, water_level);
211 dgen.generate(vm, blockseed, full_node_min, full_node_max);
214 for (size_t i = 0; i != emerge->decorations.size(); i++) {
215 Decoration *deco = emerge->decorations[i];
216 deco->placeDeco(this, blockseed + i, node_min, node_max);
219 for (size_t i = 0; i != emerge->ores.size(); i++) {
220 Ore *ore = emerge->ores[i];
221 ore->placeOre(this, blockseed + i, node_min, node_max);
224 // Sprinkle some dust on top after everything else was generated
227 //printf("makeChunk: %dms\n", t.stop());
229 updateLiquid(&data->transforming_liquid, full_node_min, full_node_max);
231 if (!(flags & MG_NOLIGHT))
232 calcLighting(node_min - v3s16(1, 0, 1) * MAP_BLOCKSIZE,
233 node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE);
234 //setLighting(node_min - v3s16(1, 0, 1) * MAP_BLOCKSIZE,
235 // node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE, 0xFF);
237 this->generating = false;
241 void MapgenV7::calculateNoise() {
242 //TimeTaker t("calculateNoise", NULL, PRECISION_MICRO);
247 noise_height_select->perlinMap2D(x, z);
248 noise_height_select->transformNoiseMap();
250 noise_terrain_persist->perlinMap2D(x, z);
251 noise_terrain_persist->transformNoiseMap();
252 float *persistmap = noise_terrain_persist->result;
253 for (int i = 0; i != csize.X * csize.Z; i++)
254 persistmap[i] = rangelim(persistmap[i], 0.4, 0.9);
256 noise_terrain_base->perlinMap2DModulated(x, z, persistmap);
257 noise_terrain_base->transformNoiseMap();
259 noise_terrain_alt->perlinMap2DModulated(x, z, persistmap);
260 noise_terrain_alt->transformNoiseMap();
262 noise_filler_depth->perlinMap2D(x, z);
264 if (flags & MGV7_MOUNTAINS) {
265 noise_mountain->perlinMap3D(x, y, z);
266 noise_mount_height->perlinMap2D(x, z);
267 noise_mount_height->transformNoiseMap();
270 if (flags & MGV7_RIDGES) {
271 noise_ridge->perlinMap3D(x, y, z);
272 noise_ridge_uwater->perlinMap2D(x, z);
275 noise_heat->perlinMap2D(x, z);
276 noise_humidity->perlinMap2D(x, z);
278 //printf("calculateNoise: %dus\n", t.stop());
282 Biome *MapgenV7::getBiomeAtPoint(v3s16 p) {
283 float heat = NoisePerlin2D(bmgr->np_heat, p.X, p.Z, seed);
284 float humidity = NoisePerlin2D(bmgr->np_humidity, p.X, p.Z, seed);
285 s16 groundlevel = baseTerrainLevelAtPoint(p.X, p.Z);
287 return bmgr->getBiome(heat, humidity, groundlevel);
290 //needs to be updated
291 float MapgenV7::baseTerrainLevelAtPoint(int x, int z) {
292 float hselect = NoisePerlin2D(noise_height_select->np, x, z, seed);
293 hselect = rangelim(hselect, 0.0, 1.0);
295 float persist = NoisePerlin2D(noise_terrain_persist->np, x, z, seed);
296 persist = rangelim(persist, 0.4, 0.9);
298 noise_terrain_base->np->persist = persist;
299 float height_base = NoisePerlin2D(noise_terrain_base->np, x, z, seed);
301 noise_terrain_alt->np->persist = persist;
302 float height_alt = NoisePerlin2D(noise_terrain_alt->np, x, z, seed);
304 if (height_alt > height_base)
307 return (height_base * hselect) + (height_alt * (1.0 - hselect));
311 float MapgenV7::baseTerrainLevelFromMap(int index) {
312 float hselect = rangelim(noise_height_select->result[index], 0.0, 1.0);
313 float height_base = noise_terrain_base->result[index];
314 float height_alt = noise_terrain_alt->result[index];
316 if (height_alt > height_base)
319 return (height_base * hselect) + (height_alt * (1.0 - hselect));
323 bool MapgenV7::getMountainTerrainAtPoint(int x, int y, int z) {
324 float mnt_h_n = NoisePerlin2D(noise_mount_height->np, x, z, seed);
325 float height_modifier = -((float)y / rangelim(mnt_h_n, 80.0, 150.0));
326 float mnt_n = NoisePerlin3D(noise_mountain->np, x, y, z, seed);
328 return mnt_n + height_modifier >= 0.6;
332 bool MapgenV7::getMountainTerrainFromMap(int idx_xyz, int idx_xz, int y) {
333 float mounthn = noise_mount_height->result[idx_xz];
334 float height_modifier = -((float)y / rangelim(mounthn, 80.0, 150.0));
335 return (noise_mountain->result[idx_xyz] + height_modifier >= 0.6);
340 void MapgenV7::carveRivers() {
341 MapNode n_air(CONTENT_AIR), n_water_source(c_water_source);
342 MapNode n_stone(c_stone);
347 for (s16 z = node_min.Z; z <= node_max.Z; z++)
348 for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
349 float terrain_mod = noise_terrain_mod->result[index];
350 NoiseParams *np = noise_terrain_river->np;
351 np->persist = noise_terrain_persist->result[index];
352 float terrain_river = NoisePerlin2DNoTxfm(np, x, z, seed);
353 float height = terrain_river * (1 - abs(terrain_mod)) *
354 noise_terrain_river->np->scale;
355 height = log(height * height); //log(h^3) is pretty interesting for terrain
357 s16 y = heightmap[index];
358 if (height < 1.0 && y > river_depth &&
359 y - river_depth >= node_min.Y && y <= node_max.Y) {
361 for (s16 ry = y; ry != y - river_depth; ry--) {
362 u32 vi = vm->m_area.index(x, ry, z);
363 vm->m_data[vi] = n_air;
366 u32 vi = vm->m_area.index(x, y - river_depth, z);
367 vm->m_data[vi] = n_water_source;
374 int MapgenV7::generateTerrain() {
375 int ymax = generateBaseTerrain();
377 if (flags & MGV7_MOUNTAINS)
378 generateMountainTerrain();
380 if (flags & MGV7_RIDGES)
381 generateRidgeTerrain();
387 int MapgenV7::generateBaseTerrain() {
388 MapNode n_air(CONTENT_AIR);
389 MapNode n_stone(c_stone);
390 MapNode n_water(c_water_source);
392 int stone_surface_max_y = -MAP_GENERATION_LIMIT;
393 v3s16 em = vm->m_area.getExtent();
396 for (s16 z = node_min.Z; z <= node_max.Z; z++)
397 for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
398 float surface_height = baseTerrainLevelFromMap(index);
399 s16 surface_y = (s16)surface_height;
401 heightmap[index] = surface_y;
402 ridge_heightmap[index] = surface_y;
404 if (surface_y > stone_surface_max_y)
405 stone_surface_max_y = surface_y;
407 u32 i = vm->m_area.index(x, node_min.Y, z);
408 for (s16 y = node_min.Y; y <= node_max.Y; y++) {
409 if (vm->m_data[i].getContent() == CONTENT_IGNORE) {
411 vm->m_data[i] = n_stone;
412 else if (y <= water_level)
413 vm->m_data[i] = n_water;
415 vm->m_data[i] = n_air;
417 vm->m_area.add_y(em, i, 1);
421 return stone_surface_max_y;
425 void MapgenV7::generateMountainTerrain() {
426 if (node_max.Y <= water_level)
429 MapNode n_stone(c_stone);
432 for (s16 z = node_min.Z; z <= node_max.Z; z++)
433 for (s16 y = node_min.Y; y <= node_max.Y; y++) {
434 u32 vi = vm->m_area.index(node_min.X, y, z);
435 for (s16 x = node_min.X; x <= node_max.X; x++) {
436 int j = (z - node_min.Z) * csize.X + (x - node_min.X);
438 if (getMountainTerrainFromMap(index, j, y))
439 vm->m_data[vi] = n_stone;
448 void MapgenV7::generateRidgeTerrain() {
449 MapNode n_water(c_water_source);
450 MapNode n_air(CONTENT_AIR);
453 for (s16 z = node_min.Z; z <= node_max.Z; z++)
454 for (s16 y = node_min.Y; y <= node_max.Y; y++) {
455 u32 vi = vm->m_area.index(node_min.X, y, z);
456 for (s16 x = node_min.X; x <= node_max.X; x++, index++, vi++) {
457 int j = (z - node_min.Z) * csize.X + (x - node_min.X);
459 if (heightmap[j] < water_level - 4)
462 float widthn = (noise_terrain_persist->result[j] - 0.6) / 0.1;
463 //widthn = rangelim(widthn, -0.05, 0.5);
465 float width = 0.3; // TODO: figure out acceptable perlin noise values
466 float uwatern = noise_ridge_uwater->result[j] * 2;
467 if (uwatern < -width || uwatern > width)
470 float height_mod = (float)(y + 17) / 2.5;
471 float width_mod = (width - fabs(uwatern));
472 float nridge = noise_ridge->result[index] * (float)y / 7.0;
475 nridge = -fabs(nridge) * 3.0 * widthn * 0.3;
477 if (nridge + width_mod * height_mod < 0.6)
480 if (y < ridge_heightmap[j])
481 ridge_heightmap[j] = y - 1;
483 vm->m_data[vi] = (y > water_level) ? n_air : n_water;
489 void MapgenV7::generateBiomes() {
490 if (node_max.Y < water_level)
493 MapNode n_air(CONTENT_AIR);
494 MapNode n_stone(c_stone);
495 MapNode n_water(c_water_source);
497 v3s16 em = vm->m_area.getExtent();
500 for (s16 z = node_min.Z; z <= node_max.Z; z++)
501 for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
502 Biome *biome = bmgr->biomes[biomemap[index]];
503 s16 dfiller = biome->depth_filler + noise_filler_depth->result[index];
504 s16 y0_top = biome->depth_top;
505 s16 y0_filler = biome->depth_filler + biome->depth_top + dfiller;
508 u32 i = vm->m_area.index(x, node_max.Y, z);
510 content_t c_above = vm->m_data[i + em.X].getContent();
511 bool have_air = c_above == CONTENT_AIR;
513 for (s16 y = node_max.Y; y >= node_min.Y; y--) {
514 content_t c = vm->m_data[i].getContent();
516 // It could be the case that the elevation is equal to the chunk
517 // boundary, but the chunk above has not been generated yet
518 if (y == node_max.Y && c_above == CONTENT_IGNORE &&
519 y == heightmap[index] && c == c_stone) {
520 int j = z * zstride + y * ystride + x;
521 have_air = !getMountainTerrainFromMap(j, index, y);
524 if (c == c_stone && have_air) {
525 content_t c_below = vm->m_data[i - em.X].getContent();
527 if (c_below != CONTENT_AIR) {
528 if (nplaced < y0_top) {
529 // A hack to prevent dirt_with_grass from being
530 // placed below water. TODO: fix later
531 content_t c_place = ((y < water_level) &&
532 (biome->c_top == c_dirt_with_grass)) ?
533 c_dirt : biome->c_top;
535 vm->m_data[i] = MapNode(c_place);
537 } else if (nplaced < y0_filler && nplaced >= y0_top) {
538 vm->m_data[i] = MapNode(biome->c_filler);
545 } else if (c == c_water_source) {
548 vm->m_data[i] = MapNode(biome->c_water);
549 } else if (c == CONTENT_AIR) {
554 vm->m_area.add_y(em, i, -1);
560 void MapgenV7::dustTopNodes() {
561 v3s16 em = vm->m_area.getExtent();
564 if (water_level > node_max.Y)
567 for (s16 z = node_min.Z; z <= node_max.Z; z++)
568 for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
569 Biome *biome = bmgr->biomes[biomemap[index]];
571 if (biome->c_dust == CONTENT_IGNORE)
575 u32 vi = vm->m_area.index(x, y, z);
576 for (; y >= node_min.Y; y--) {
577 if (vm->m_data[vi].getContent() != CONTENT_AIR)
580 vm->m_area.add_y(em, vi, -1);
583 content_t c = vm->m_data[vi].getContent();
584 if (c == biome->c_water && biome->c_dust_water != CONTENT_IGNORE) {
588 vm->m_data[vi] = MapNode(biome->c_dust_water);
589 } else if (!ndef->get(c).buildable_to && c != CONTENT_IGNORE) {
593 vm->m_area.add_y(em, vi, 1);
594 vm->m_data[vi] = MapNode(biome->c_dust);
601 void MapgenV7::addTopNodes() {
602 v3s16 em = vm->m_area.getExtent();
606 for (s16 z = node_min.Z; z <= node_max.Z; z++)
607 for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
608 Biome *biome = bmgr->biomes[biomemap[index]];
610 //////////////////// First, add top nodes below the ridge
611 s16 y = ridge_heightmap[index];
613 // This cutoff is good enough, but not perfect.
614 // It will cut off potentially placed top nodes at chunk boundaries
617 if (y > node_max.Y) {
618 y = node_max.Y; // Let's see if we can still go downward anyway
619 u32 vi = vm->m_area.index(x, y, z);
620 content_t c = vm->m_data[vi].getContent();
621 if (ndef->get(c).walkable)
625 // N.B. It is necessary to search downward since ridge_heightmap[i]
626 // might not be the actual height, just the lowest part in the chunk
627 // where a ridge had been carved
628 u32 i = vm->m_area.index(x, y, z);
629 for (; y >= node_min.Y; y--) {
630 content_t c = vm->m_data[i].getContent();
631 if (ndef->get(c).walkable)
633 vm->m_area.add_y(em, i, -1);
636 if (y != node_min.Y - 1 && y >= water_level) {
637 ridge_heightmap[index] = y; //update ridgeheight
638 ntopnodes = biome->top_depth;
639 for (; y <= node_max.Y && ntopnodes; y++) {
641 vm->m_data[i] = MapNode(biome->c_top);
642 vm->m_area.add_y(em, i, 1);
644 // If dirt, grow grass on it.
645 if (y > water_level - 10 &&
646 vm->m_data[i].getContent() == CONTENT_AIR) {
647 vm->m_area.add_y(em, i, -1);
648 if (vm->m_data[i].getContent() == c_dirt)
649 vm->m_data[i] = MapNode(c_dirt_with_grass);
653 //////////////////// Now, add top nodes on top of the ridge
654 y = heightmap[index];
655 if (y > node_max.Y) {
656 y = node_max.Y; // Let's see if we can still go downward anyway
657 u32 vi = vm->m_area.index(x, y, z);
658 content_t c = vm->m_data[vi].getContent();
659 if (ndef->get(c).walkable)
663 i = vm->m_area.index(x, y, z);
664 for (; y >= node_min.Y; y--) {
665 content_t c = vm->m_data[i].getContent();
666 if (ndef->get(c).walkable)
668 vm->m_area.add_y(em, i, -1);
671 if (y != node_min.Y - 1) {
672 ntopnodes = biome->top_depth;
673 // Let's see if we've already added it...
674 if (y == ridge_heightmap[index] + ntopnodes - 1)
677 for (; y <= node_max.Y && ntopnodes; y++) {
679 vm->m_data[i] = MapNode(biome->c_top);
680 vm->m_area.add_y(em, i, 1);
682 // If dirt, grow grass on it.
683 if (y > water_level - 10 &&
684 vm->m_data[i].getContent() == CONTENT_AIR) {
685 vm->m_area.add_y(em, i, -1);
686 if (vm->m_data[i].getContent() == c_dirt)
687 vm->m_data[i] = MapNode(c_dirt_with_grass);
695 #include "mapgen_v6.h"
696 void MapgenV7::generateCaves(int max_stone_y) {
697 PseudoRandom ps(blockseed + 21343);
699 int volume_nodes = (node_max.X - node_min.X + 1) *
700 (node_max.Y - node_min.Y + 1) *
701 (node_max.Z - node_min.Z + 1);
702 float cave_amount = NoisePerlin2D(&nparams_v6_def_cave,
703 node_min.X, node_min.Y, seed);
705 u32 caves_count = MYMAX(0.0, cave_amount) * volume_nodes / 250000;
706 for (u32 i = 0; i < caves_count; i++) {
707 CaveV7 cave(this, &ps, false);
708 cave.makeCave(node_min, node_max, max_stone_y);
711 u32 bruises_count = (ps.range(1, 8) == 1) ? ps.range(0, ps.range(0, 2)) : 1;
712 for (u32 i = 0; i < bruises_count; i++) {
713 CaveV7 cave(this, &ps, true);
714 cave.makeCave(node_min, node_max, max_stone_y);