Commit Graph

37 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 8299e4b67e Biomes/decorations/ores: Make relative to 'water_level' setting
Add 'biome_zero_level' argument to 'generateBiomes()', 'deco_zero_level'
argument to 'placeAllDecos()' and 'ore_zero_level' to 'placeAllOres()'
to allow mapgens to vertically shift the registered biomes, decorations
and ores per-mapchunk.
Will also allow many realm possibilities in future mapgens.
2017-07-11 01:14:24 +01:00
Paramat 2e53801fc0 Mapgen: Remove unnecessary 'this->' from constructors (#6069) 2017-06-30 15:32:35 +02:00
paramat 9a77397fbf Mgvalleys: Use existing 'lava_max_height' value in CavesRandomWalk
Now that lava depth in large caves is variable we can use the already
present 'lava_max_height' value to set the lava depth in them.
2017-06-24 01:48:20 +01:00
Loïc Blot 8f7785771b Cpp11 initializers 2 (#5999)
* C++11 patchset 10: continue cleanup on constructors

* Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop)

* More classes cleanup

* More classes cleanup + change NULL tests to boolean tests
2017-06-17 19:11:28 +02:00
paramat 210a339dce Mapgen files: Update and correct copyright credits 2017-05-26 20:46:03 +01:00
paramat 1eca9ecf7d 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 b8a4c95971 MapgenBasic: Add lava source as commonly used content (#5512)
Future mapgens are likely to use this for magma and volcanos.
Remove the getting of lava source content id in mgvalleys.
2017-04-04 07:51:58 +02:00
paramat ec0c4d33db Map generation limit: Make per-world
The setting limits map generation but affects nothing else.
Add 'mapgen_limit' to global mapgen parameters.
Move 'blockpos_over_mapgen_limit()' to the only place it is called
from: map.cpp.
Allow teleportation to any part of the world even if over the set
mapgen limit.
Simplify the reading of this limit in mgvalleys.
Remove the 'map_generation_limit' setting.
2017-03-27 03:18:09 +01:00
paramat 326cc5df74 Mgvalleys: Fix missing decorations and incorrect function order
Fix missing decorations at horizontal chunk borders by adding
'updateHeightmap()' after terrain generation.

Swap order of 'calculateNoise' and 'calcBiomeNoise' because
'calculateNoise' modifies the heat and humidity maps created in
'calcBiomeNoise'.

Remove confusing comment, code block is not just for mods and
seems essential for correct mapgen behaviour.
2017-02-01 15:05:35 +00:00
paramat f8408398f5 Cavegen: Wider tunnels in mgflat, mgfractal, mgvalleys
As mgv7 is now the default mapgen i re-checked its tunnel width on request,
discovered they needed to be wider, and have made this change.
This commit widens the identical 3D noise tunnels in the other mapgens in
exactly the same way.
2016-12-14 06:28:45 +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 3c63c3044d 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 9997e2030c 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 d4457ef420 Mapgen: Optimize biomemap creation by combining with generateBiomes 2016-06-05 13:30:02 -04:00
paramat d24f384174 Biome API: Add per-biome riverbed material and depth
Mgvalleys: Remove riverbed sand placement from base terrain generation
Riverbed material placement moved to MapgenBasic::generateBiomes()
Document fields and add note that the biome API is still unstable
2016-06-05 16:37:02 +01:00
kwolekr fd0efb21c3 Mapgen: Combine dungeon generation code 2016-05-27 23:23:58 -04:00
kwolekr 0810901766 Mapgen: Deduplicate common constructor code 2016-05-27 23:23:58 -04:00
kwolekr 0df5c01a8c 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 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 1bb5eb1da2 Cavegen: Merge CaveV5 and CaveV7 into CavesRandomWalk 2016-05-27 23:23:58 -04:00
kwolekr 9b5c492be5 Fix MgStoneType and BiomeType enum names 2016-05-27 23:23:58 -04:00
kwolekr 87bc39dca7 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 76f4856479 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
paramat 8b1f8e99cf 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
paramat fe349d401d Mgvalleys: Don't let cavegen place biome nodes everywhere
Fix use of 'air_above' bool so that biome
nodes are only placed in tunnel floors
Minor code improvements
'Continue' when massive cave air is placed
2016-04-12 04:16:08 +01:00
paramat 465bb6f5d1 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
paramat bb2ee54d3b 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
Duane Robertson af714c7ade Mgvalleys: Correct spawn problems
Increase maximum spawn altitude to reduce spawn issues.
2016-03-04 02:39:04 +00:00
Duane Robertson 6969dd4224 Mgvalleys: Add Dry Riverbeds
Lower water table where base humidity is low.
Alter heat and humidity to compensate for river humidity and altitude
chill.
Correct misuse of surface_max_y in generateTerrain.
Remove sand trails in the water at river mouths.
Remove river water below water_level.
Correct heat/humidity calculations where noises are less than zero.
Correct heightmap errors as much as possible.
Make humidity calculations more readable.
2016-02-27 21:27:32 +00:00
paramat 4adbd69a37 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
Duane Robertson 99c905c563 Mgvalleys: fix riverbeds below sea level
Stop riverbeds from forming plateaus under sea. Minor corrections to
random lava/water placement.
2016-02-02 06:37:22 +00:00
Duane Robertson 80c7612e76 Mgvalleys: use standard caves
Replace simple caves with V5 caves, adding unpredictable water and lava
settings and massive caves based on subterrain. Remove fast terrain mode
and accompanying settings. Remove superfluous temperature/humidity
settings. Remove lava/water height setting. Fix errors in humidity
handling and remove humidity_break_point setting. Move cave noises to
generateCaves. Fix minor formatting/naming issues and use
MYMAX/MYMIN/myround.
2016-01-31 22:31:25 +00:00
Duane Robertson eb6e2c11b1 Correct overflowing rivers in Valleys mapgen. 2016-01-18 17:21:13 +00:00
Duane Robertson 752d820206 Prevent spawning in rivers with valleys mapgen. Remove unecessary whitespace. 2016-01-16 13:05:03 +00:00
Duane Robertson 3c6b2ffb10 Add Valleys mapgen. 2016-01-14 05:04:29 +00:00