Commit Graph

40 Commits

Author SHA1 Message Date
Loïc Blot
9a17b65f26 VoxelManip cleanups (const ref, const move) + function removal (#6169)
* VoxelManip cleanups (const ref, const move) permitting to improve a little bit performance

* VoxelArea: precalculate extent (performance enhancement)

This permits to reduce extend high cost to zero and drop many v3s16 object creation/removal to calculate extent
It rebalance the client thread update to updateFastFaceRow instead of MapBlockMesh generation
This will also benefits to mapgen
2017-07-26 07:35:09 +02:00
paramat
2652d8db19 CavesRandomWalk: Make 'lava_depth' a mapgen parameter
As with 'large_cave_depth', lava depth was previously a fixed y value and
therefore incompatible with the ability to shift terrain vertically.

Add 'lava_depth' mapgen parameter to mgflat, mgfractal, mgv5, mgv7.
2017-06-22 03:14:56 +01:00
paramat
fd32005b0f Caverns: Remove unnecessary liquid excavation
Also disable CavesRandomWalk at a safer distance from caverns.

Excavating liquids in cavern code is unnecessary as in practice we are already
successfully disabling the generation of liquid caves that could intersect
with caverns and cause excessive amounts of spreading liquids in caverns.

However to be safer this commit now disables liquid caves at a larger distance
from caverns, to compensate for liquid caves being able to generate up to a
mapblock beyond a mapchunk border.

Not excavating liquids in cavern code also allows a feature i am working on in
experimental new core mapgens, but also allows for more flexibility in future.
2017-05-16 21:56:51 +01:00
SmallJoker
c28a843592 Cavegen: Fix non-constant array initializer error for MSVC 2017-04-07 17:59:27 +02:00
paramat
859141a0ce Cavegen/Mgv5/Mgv7: Add optional giant caverns
Add to MapgenBasic for use by multiple mapgens.
Add to mgv5 and mgv7, enabled by default.

Similar to mgvalleys caverns but half the scale.
Parameters for upper y limit, distance caverns taper to full size, and
noise threshold (full cavern size).
As with mgvalleys caverns are generated first and classic caves are
disabled in any mapchunk containing a cavern, to avoid excessive
spreading volumes of liquids.
This also avoids floating blobs of liquid where a large classic cave
has overgenerated out into a neighbouring previously-generated mapchunk.
2017-04-03 04:49:32 +01:00
paramat
9aabfd5188 Cavegen: Place correct biome surface in tunnel entrances
Previously in tunnel entrance floors only a single biome 'top' node was
placed and 'filler' nodes were missing.

Place 'top' and 'filler' nodes in tunnel entrance floors with depths
defined by the biome.
In tunnel entrances under rivers 'riverbed' nodes are placed to the
biome-defined depth.
2017-02-16 22:25:14 +00:00
paramat
2ba8ad1dfe Mgvalleys / cavegen: Place riverbed nodes under river water
When a CavesNoiseIntersection tunnel intersects a river place biome
'riverbed' nodes in tunnel entrance instead of biome 'top' nodes.
2016-07-21 05:01:18 +01:00
kwolekr
dfbdb5bcd7 Change internal type for seeds to s32
This fixes value truncation (and therefore incompatibility) on platforms
with an LP32 data model, such as VAX or MS-DOS.
2016-06-04 01:51:44 -04:00
kwolekr
c4e083f7e1 Disallow external linkage for default Cavegen NoiseParams 2016-05-27 23:23:58 -04:00
kwolekr
548d99bb45 Cavegen: Move V5-style caves to CavesNoiseIntersection 2016-05-27 23:23:58 -04:00
kwolekr
6151f7bc4b Cavegen: Minor misc. fixes
- Convert instances of numeric literal doubles to floats
- Move dswitchint to a local variable now that being a member is unnecessary
- Improve const correctness
- Indentation fixes
2016-05-27 23:23:58 -04:00
kwolekr
b1eb757e60 Fix undefined evaluation order when constructing random vectors
MSVC and GCC evaluate parameters in right-to-left order, whereas Clang
evaluates in left-to-right order, and of course, an optimization could
leave the order of evaluation completely indeterminate.

This commit fixes all instances of the error by explicitly assigning the
results of expressions that use PseudoRandom::next() or range() to their
respective vector components.

The right-to-left evaluation behavior is preserved since Clang is much less
commonly used to compile Minetest than GCC and MSVC combined, and would
therefore cause the least harm.
2016-05-27 23:23:58 -04:00
kwolekr
5b05f75a27 Cavegen: Re-add small caves to CavesRandomWalk 2016-05-27 23:23:58 -04:00
kwolekr
db1b4dc890 Cavegen: Remove CavesRandomWalk dependency on Mapgen 2016-05-27 23:23:58 -04:00
kwolekr
68b1cd8d1b Cavegen: Merge instances of repetitive surface level-finding code 2016-05-27 23:23:58 -04:00
kwolekr
a605d69092 Cavegen: Remove CavesV6 dependency on Mapgen 2016-05-27 23:23:58 -04:00
kwolekr
bf25837617 Cavegen: Rename CaveV6 to CavesV6
- Add comment explaining why it exists
- Remove unused 'flooded' variable
- Rename shadowed variable
- Fix some code style
2016-05-27 23:23:58 -04:00
kwolekr
1bb5eb1da2 Cavegen: Merge CaveV5 and CaveV7 into CavesRandomWalk 2016-05-27 23:23:58 -04:00
paramat
8fc8cb819b Mapgen: Various fixes and improvements
Lua_api.txt: Document 'minetest.registered_biomes'
Minimal: Remove 'mapgen_air' alias
Cavegen: Add fallback node for 'mapgen_ice'
Dungeongen: Add fallback node for 'mapgen_river_water_source'
Mgv5: Remove unnecessary '#include util/directiontables.h'
Add missing 'this->'s in makeChunk()
Mgv6: Edit empty line formatting
Remove leading spaces in makeChunk()
Add missing spaces after 'for' and 'if'
Mgv7: Edit empty line formatting
2016-01-11 01:32:20 +00:00
paramat
c3e179f256 Cavegen: Make mgfractal use mgv5 cavegen
Remove CaveFractal
Add a lava depth constant to CaveV5 to make it universal
2015-11-09 05:29:42 +00:00
paramat
706e7cebea Fractal mapgen: Add seabed and large pseudorandom caves 2015-10-07 06:43:46 +01:00
paramat
7a6e4dc54a Cavegen V6: Make all caves consistent with 0.4.12 stable
When tunnels entirely above ground were avoided, the
missing pseudorandom calls changed the allowed caves.
Now, above ground tunnels are not placed while
still running all previous pseudorandom calls.
2015-08-03 06:39:23 +01:00
paramat
4046f3e302 Cavegen: Mgv6: No small caves entirely above ground
Mgv5/mgv7: Remove 'should make cave hole' feature
Remove ravine code
2015-07-19 02:47:11 +01:00
paramat
c0dafa1c10 Cavegen: Cleanup code. Define constant for MGV7_LAVA_DEPTH 2015-07-01 06:21:13 +01:00
paramat
392ac41c99 Cavegen: Remove now unnecessary checks for water, lava, ice
Remove large cave checks for air
Mgv5/mgv7:Add is_ground_content checks to 3d noise tunnels
More large caves
Shorten lines
2015-04-07 04:43:24 +01:00
paramat
eb7482fd73 Cavegen, mgv5: Cleanup code
Conf.example: Update mgv5 mapgen params
Mgv7: Lava caves only below -256
2015-03-04 23:53:58 +00:00
paramat
773aa8c57b Mgv6: Add heightmap. Do not make large caves that are entirely above ground 2015-03-02 02:13:43 +00:00
paramat
38e6280552 Mgv5: Remove blobgen. Remove crumble and wetness noises
Add large pseudorandom caves below -256
De-link terrain level from water_level
Cavegen: Mgv5 large cave code
2015-02-21 01:43:25 +00:00
kwolekr
c5faa64405 Cavegen: Fix copy & paste error (solves #2020) 2014-12-28 22:35:14 -05:00
kwolekr
2fd3d52020 Add flags and lacunarity as new noise parameters
Add 'absolute value' option to noise map functions
Extend persistence modulation to 3D noise
Extend 'eased' option to noise2d_perlin* functions
Some noise.cpp formatting fixups
2014-12-07 21:59:32 -05:00
kwolekr
5062b99cb0 Rewrite generate notification mechanism
Add support for notify-on-decoration
Clean up mapgen constructors
Clean up mapgen.cpp code style somewhat
Remove trailing whitespace from some files
2014-12-06 13:53:35 -05:00
kwolekr
5a34f40d80 Huge overhaul of the entire MapgenParams system
MapgenParams is no longer a polymorphic class, eliminating the need for messy and bug-prone reallocations.
Separation between the common and mapgen-specific parameters is now strongly defined.
Mapgen parameters objects are now properly encapsulated within the proper subsystems.
2014-02-03 22:50:14 -05:00
kwolekr
c3708b456e Add map feature generation notify Lua API 2013-12-14 01:52:24 -05:00
kwolekr
f3439c40d8 Cavegen: Fix possible out-of-bounds heightmap access 2013-12-01 08:57:35 -05:00
kwolekr
747bc40840 Cavegen: Respect is_ground_content MapNode setting; fix some code formatting issues 2013-11-29 20:54:04 -05:00
kwolekr
18d7bc7fa1 Mapgen V7: Huge rewrite, also tweaks to cavegen et al. 2013-07-06 02:21:54 -04:00
kwolekr
fe4ce03d52 Cavegen: Prevent caves from occuring above ground level, and superfluous mixing of lava and water in caves 2013-07-01 21:20:03 -04:00
kwolekr
30d6d4c733 Cavegen: fix division by 0 with abnormal max tunnel diameter sizes 2013-06-23 15:16:52 -04:00
kwolekr
8767c78169 Enhance caves for mgv7, add ravines 2013-04-27 22:40:52 -04:00
kwolekr
03868ff8e1 Class-ify caves & move to cavegen.cpp, fix cave regression, add caves to Mapgen V7 2013-04-21 01:06:19 -04:00