Commit Graph

137 Commits (e98d421aff046a2d9a9b87516779603dc170b209)

Author SHA1 Message Date
MoNTE48 e98d421aff Merge remote-tracking branch 'upstream/stable-0.4' into sync 2019-04-01 20:18:54 +02:00
paramat 669b0a0a56 Mgv7: Fix undefined 'float_mount_height'
Commit cad10ce3b747b721fd63784915e05f12bc488128 altered the parameter
'float_mount_height' but was missing the necessary line in the constructor
to get the altered value from 'params'.

Fixes 3D floatland terrain generating everywhere.
2018-06-03 17:31:59 +02:00
paramat 7fcecb2b24 Mgv7: Clean up divide-by-zero fix 2018-06-03 17:31:59 +02:00
paramat 822ac11c29 Mgv7: Avoid divide-by-zero errors
Some settings of paramters can cause mgv7 variables to be -inf, nan or -nan.
This can cause massive vertical columns of water to appear above sea level.
2018-06-03 17:31:59 +02:00
Maksim Gamarnik 35770f4abb Merge Minetest 0.4.16 2017-06-06 23:03:34 +03:00
paramat e45af9e0b7 Mapgen files: Update and correct copyright credits 2017-05-26 20:46:03 +01:00
paramat b9341e3a60 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
paramat c8e1a6b079 Mgflat, Mgv7: Fix noise crash on world exit.
Fix crash caused by destructor 'delete' on noise objects that are not
created due to mapgen options.
Crash was caused by commit 57eaf62c697cec91890d9cb28d10385d293d2d3f
2017-04-22 05:37:33 +01:00
paramat 406249ebc2 Mgflat, Mgv7: Only create noise objects if needed 2017-04-22 01:24:03 +01:00
paramat 15ff84d767 Mapgen: Remove '#include treegen.h' from non-mgv6 mapgens
Only mgv6 uses the tree functions from treegen.cpp.
2017-04-05 07:30:00 +01:00
paramat ad10ebf1be 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
Maksim Gamarnik e05f7db82f Updated to Minetest ver. 0.4.15 2017-01-30 00:44:07 +02:00
sfan5 36e2e7519c Mgv7: Change default cave width to 0.09 2016-12-13 03:32:51 +00:00
paramat fce207bf28 Mgv7 floatlands: Various improvements
Floatland base terrain underside was too thin, causing excessive water
leakage through tunnels under lakes, now make it thicker.
Floatland mountain terrain had a rim 1 node thick which made it bare
stone, now make it 2 nodes thick to merge with the floatland base
terrain rim and to have a layer of biome material.
Make mountain terrain more exponentially shaped by altering the
exponent.
Remove unnecessary and potentially ugly MYMAX() applied to
n_base_height.
2016-12-01 05:08:51 +00:00
paramat c90398e1a1 Mgv7: Add optional floatlands, disabled by default 2016-11-15 23:07:06 +00:00
paramat 7830f8cb71 Mgv7: Avoid mid-air spawn on disabled mountain terrain, optimise function
'getSpawnLevelAtPoint()' did not account for disabled mountains, it
was possible to be spawned in mid-air where a mountain surface would
have been.

Avoid check for river area if rivers are disabled.
2016-09-30 18:56:39 +01:00
kwolekr 7af0dede5f Add MapSettingsManager and new mapgen setting script API functions
This commit refactors the majority of the Mapgen settings system.
- MapgenParams is now owned by MapSettingsManager, itself a part of ServerMap,
  instead of the EmergeManager.
- New Script API functions added:
    core.get_mapgen_setting
    core.get_mapgen_setting_noiseparams,
    core.set_mapgen_setting, and
    core.set_mapgen_setting_noiseparams.
- minetest.get/set_mapgen_params are deprecated by the above new functions.
- It is now possible to view and modify any arbitrary mapgen setting from a mod,
  rather than the base MapgenParams structure.
- MapgenSpecificParams has been removed.
2016-07-03 15:38:36 -04:00
paramat fc986c7adc Mgflat/fractal/v7/valleys: Denser 3D noise tunnels
Reduce spread from 96 to primes 61 and 67 (either side of 64)
Prime spreads help to keep 3D noise periodic features unaligned
'cave width' 0.2 to preserve tunnel width
Reduce octaves to 3 to improve network structure
2016-06-24 02:17:51 +01:00
kwolekr 7dc6369329 Mapgen: Optimize biomemap creation by combining with generateBiomes 2016-06-05 13:30:02 -04:00
paramat ba499eee63 Mgv7: Always carve river channels in mountain terrain
Previously, rivers were sometimes blocked by vertical walls
of mountain terrain due to river carving being disabled
when base terrain height was below water_level - 16
Remove now unused base terrain heightmap created in
generateTerrain()
2016-06-02 07:31:01 +01:00
kwolekr ad404363ec Mapgen: Combine dungeon generation code 2016-05-27 23:23:58 -04:00
kwolekr 5697e8daef Mapgen: Deduplicate common constructor code 2016-05-27 23:23:58 -04:00
kwolekr cdbcf56e65 Mapgen: Remove calculateNoise from most mapgens
This commit moves noise calculation to the functions where the noise is
actually required, increasing the separation of concerns and level of
interdependency for each mapgen method.  Valleys Mapgen is left unmodified.
2016-05-27 23:23:58 -04:00
kwolekr f4480a7ac5 Mapgen V7: Remove now-unused ridge heightmap 2016-05-27 23:23:58 -04:00
kwolekr dadff87b25 Cavegen: Move V5-style caves to CavesNoiseIntersection 2016-05-27 23:23:58 -04:00
kwolekr 67e06fbbec Fix MgStoneType and BiomeType enum names 2016-05-27 23:23:58 -04:00
kwolekr c71f77da67 Mapgen: Combine generateBiomes, dustTopNodes, and generateCaves
This commit condenses the above methods into a single implementation used by
V7, V5, Flat, Fractal, and Valleys mapgens and introduces MapgenBasic.
2016-05-27 23:23:58 -04:00
kwolekr 18c17ff1fd Move biome calculation to BiomeGen
BiomeGen defines an interface that, given a set of BiomeParams, computes biomes
for a given area using the algorithm implemented by that specific BiomeGen.
This abstracts away the old system where each mapgen supplied the noises
required for biome generation.
2016-05-27 23:23:58 -04:00
Maksim Gamarnik d5854e5cf7 Merge minetest commits / WIP!
Java part WIP, pls, use prev commits!
2016-04-29 10:11:25 +03:00
paramat 2942a16393 Mapgen: Make 3D noise tunnels' width settable
Correct parameter names mg_valleys to mgvalleys
Remove biome NoiseParams from MapgenValleysParams
Improve format of parameter code
2016-04-28 23:36:19 -04:00
Maksim Gamarnik 335296e0e6 Merge 2016-04-21 13:20:11 +03:00
paramat 40574a3bac Mgv7: Combine mountain terrain generation with base terrain generation
Previous mountain terrain generation was by necessity placing
stone in air, this was removing air from any overgenerated
structures such as tunnels, dungeons and large caves
Moving it into the base terrain generation loop ensures that
only 'ignore' is replaced

generateRidgeTerrain: only return if node_max.Y < water_level - 16
Previously, if water level was set a few nodes above a mapchunk
border the river channel was only partially excavated
2016-04-20 06:51:20 +01:00
Maksim Gamarnik 6d3bdc5a7d Merge 2016-04-12 21:28:50 +03:00
paramat 362430e603 Mgv7, mgflat, mgfractal: Tunnel generation code optimisation 2016-04-12 06:58:04 +01:00
paramat 78b1913538 Mapgen: Optimise cave noises and tunnel excavation
Instead of doing nothing at node_max.Y + 1 use 1-down
overgeneration for tunnel generation and noisemaps
Move some old unused code in mgv7 to end of file
2016-04-08 03:14:36 +01:00
Maksim Gamarnik 0b19e56113 Merge remote-tracking branch 'upstream1/master' 2016-04-01 00:33:55 +03:00
paramat 2e858f2b1b Mgv7: Decrease cliff steepness 2016-03-30 01:53:14 +01:00
paramat 77f6a1b898 Mgv7/flat/fractal: Stop tunnel-floor biome nodes being placed everywhere
A bool for 'in or under tunnel' was missing
1-node-deep stone ledges were being
replaced with biome surface material
2016-03-21 17:42:13 +00:00
Maksim Gamarnik f56e578960 Merge remote-tracking branch 'upstream1/master' 2016-03-21 01:45:56 +02:00
paramat 58aeb0691e Mgv7: Limit pseudorandom caves to surface mapchunk or below
To avoid bright caves at mapchunk borders when generating mapchunks upwards
2016-03-19 17:56:35 +00:00
Maksim Gamarnik 8f6ddcc57c Merge branch 'upstream/master' 2016-03-14 11:44:17 +02:00
paramat 191dd5cdbc Mapgen: Fix light in tunnels at mapchunk borders
Don't excavate the overgenerated stone at node_max.Y + 1,
this creates a 'roof' over the tunnel, preventing light in
tunnels at mapchunk borders when generating mapchunks upwards.
2016-03-14 08:45:01 +00:00
Maksim Gamarnik d7c0fad71f Merge Minetest commits 2016-02-11 22:35:23 +02:00
paramat 2a92bccd00 FindSpawnPos: Let mapgens decide what spawn altitude is suitable
To avoid spawn search failing in new specialised mapgens
Increase spawn search range to 4000 nodes
Add getSpawnLevelAtPoint() functions to EmergeManager, class Mapgen
and all mapgens
Remove getGroundLevelAtPoint() functions from all mapgens except mgv6
(possibly to be re-added later in the correct form to return actual
ground level)
Make mgvalleys flag names consistent with other mapgens
Remove now unused 'vertical spawn range' setting
2016-02-09 07:14:45 +00:00
Maksim Gamarnik 50c3a3a51a Merge remote-tracking branch 'upstream/master' 2016-02-07 04:07:20 +02:00
paramat 2ca1a56fc1 Mgv5/v7/flat/fractal: Move tunnel noise calculation into generateCaves
Tunnel 3D noises are only calculated when solid terrain is present
in mapchunk, avoiding large amounts of unnecessary calculations
Change 'int' to 's16' in calculateNoise
Change 'i' to 'vi' for voxelmanip indexes for consistency
Keep 'u32 index3d' local to a smaller part of tunnel code
Mgv7: Don't call CaveV7 if no solid terrain in mapchunk
Give 'open' bool a more descriptive name
2016-02-02 06:37:01 +00:00
Maksim Gamarnik 2520ca3ed1 Merge branch 'master' of https://github.com/minetest/minetest 2016-01-31 20:57:03 +02:00
paramat 44001bb716 Mgv7/flat/fractal: Place biome top node on tunnel entrance floor 2016-01-14 04:43:50 +00:00
paramat a50cbcb7f6 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
Maksim Gamarnik 1797862bf9 Merge 2015-12-06 15:00:12 +02:00