aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen
AgeCommit message (Collapse)Author
2018-10-03Fix Mapgen Valleys getSpawnLevelAtPoint() (#7756)Treer
2018-09-23Fix various code issues found by cppcheck (#7741)Paramat
Mapgen Singlenode: Remove 'flags' that duplicates a 'class Mapgen' member. Dungeongen: Initialise 'MMVManip *vm' to 'nullptr'. Inventorymanager: Remove assignment error 'found = '.
2018-08-20Change mapgen order to ores > dungeons > decorations (#7656)Paramat
Previously dungeons > decorations > ores. Decorations depend on the node they are placed on, and ore types are increasingly able to place large continuous volumes of nodes, such as strata. Decorations are increasingly being used underground. The new order avoids a node being changed by ore generation after a decoration has been placed on it. The new order also avoids ores appearing in the walls of a dungeon if the wall nodes match the local stone node.
2018-08-16Mgv5: Change tunnel parameters to those of other mapgens (#7641)Paramat
Make tunnels wider and use the noise parameters of most other mapgens. All other underground features are already identical to all other non-mgv6 mapgens, this final change modernises and improves the tunnels.
2018-07-26Fix build on gcc 5.0 (#7586)zeuner
2018-07-18Mgvalleys: Make river depth variation and humidity drop optional (#7532)Paramat
Add 2 new mapgen flags to make river depth variation and humidity drop with altitude independently optional, instead of both being enabled by the 'humid rivers' flag. Simplify and clarify related code by removing a low priority optimisation regarding 't_heat'. Remove unnecessary optimisation bools and use spflags directly instead. Improve and fix documentation in settingtypes.txt. A few minor code cleanups.
2018-06-26Cavegen: Fix errors when getting biome outside mapchunk (#7480)Paramat
Some cave segments are outside the mapchunk. Previously, biome was being calculated by a function that uses the noise maps. Points outside the mapchunk resulted in incorrect noise map indexes that were sometimes outside the noise map size, causing a crash. Use either noise maps or point noise calculations depending on point location.
2018-06-24Decoration API: Add lightweight ability to have complete coverage (#7456)Paramat
When the noise value or fill_ratio >= 10.0 complete coverage is enabled. This disables random placement to avoid redundant multiple placements at one position. Instead, 1 decoration per surface node is placed by looping across each division. '10' was chosen as this is the fill_ratio that previously created very near complete coverage. The complete coverage feature therefore integrates smoothly when noise is used for variable decoration density. 'fill_ratio = 10' should be used by modders who want a decoration placed on every surface node. Compared to before such a decoration placement will be 10 times faster.
2018-06-21Biome API: Fix absent water decorations and dust, in deep water (#7470)Paramat
Previously, the biomemap was 'BIOME_NONE' for a mapchunk column if a stone surface was not found in it, causing water surface decorations and water surface dust to fail. Store the biome ID of the biome calculated at a water surface and add it to the biomemap if the biomemap is 'BIOME_NONE' for the mapchunk column. The biome calculated at a stone surface still has priority for the biomemap entry, as it should. Edit an incorrect comment.
2018-06-19Biome dust: Revert fix that added dust to mod structures (#7464)Paramat
Revert commit 99143f494711034068685b6ee845ce19fa09d7d9 and commit f4ca830abe1aa22875c99b31bf2ee56e26f83f05. These commits caused biome dust to be applied even when there was no core mapgen terrain in a mapchunk column. So the dust, which overgenerates, then appeared on structures added by mods in 'on_generated', such as floatlands, asteroids or above-surface realms.
2018-06-08Mapgen flags: Add 'biomes' global mapgen flag (#7355)Paramat
Previously the only way to disable biomes was to 'clear' the registered biomes in a mod, but this method causes large amounts of unnecessary processing: 1. Calculation of 4 2D noises. 2. Looping through all nodes of a mapchunk replacing nodes with identical nodes. The new flag disables those operations.
2018-06-04Biome dust placement: Improve comments, re-order some linesParamat
2018-06-02Biomemap: Simplify code of recent commit (#7398)Paramat
2018-06-02Biomemap: Avoid empty biomemap entry to fix failing biome dust (#7393)Paramat
'generateBiomes()' constructs the biomemap as it generates biomes. The biome calculated at first stone surface encountered is added to the biomemap. Previously, if no stone surface was encountered in a mapchunk column the biomemap was left empty for that (x, z) position, causing biome dust and water surface decoration placement to fail. If at the base of a mapchunk column the biomemap is empty, add the currently active biome to the biomemap, or if biome is NULL calculate it for this position and add it to the biomemap.
2018-05-31Mgv7: Avoid rivergen removing mod-placed nodes when overgenerating (#7388)Paramat
Only allow river generation to replace c_stone. This also acts as an optimisation by being placed before canyon shape calculation.
2018-05-24Vein ore: Fix bug caused by changing perlinmap Y size (#7371)Paramat
Because vein ore uses 3D noise (all the other ores use 2D noise) the perlinmap Y size can be different in different mapchunks when close to the ore Y limits. Previously this caused bugs in the vein structure because changes in perlinmap Y size did not recreate the noise objects. Delete and recreate the noise objects with the new Y size if Y size has changed.
2018-05-24Schematic decorations: Fix placement bug when centred and rotated (#7365)Paramat
Previously, the centering caused by the 'place center x/z' flags did not take rotation into account. So schematics with unequal X and Z dimensions were incorrectly placed. The bug was hidden for schematics equal in X and Z dimensions.
2018-05-20Dungeons: Fix duplication of y limit parameters (#7359)Paramat
2018-05-14Vertical biome blend: Tune PRNG seed for finer detail (#7329)Paramat
2018-05-07Mgv7: Code cleanup (#7299)Paramat
2018-05-04Cavegen: Allow small RandomWalk caves to generate beyond mapchunk borderParamat
2018-04-29Mapgen caves: Re-order generation to fix cavern bugParamat
Previously, caverns confused tunnel generation causing biome top and filler nodes to appear in caverns. Split 'generateCaves()' into 2 functions to separate tunnel and large randomwalk cave generation. In each mapgen re-order cave generation to generate tunnels before caverns.
2018-04-26Biome-defined cave liquids: Use faster biome calculationparamat
2018-04-26Biome-defined dungeon nodes: Use faster biome calculationparamat
2018-04-25Dungeons: Mostly fix missing stair nodesParamat
2018-04-24Mgvalleys: Code cleanupParamat
Split some long lines. Edit comments. Remove unnecessary comments and unnecessary commented-out code. Use std::fmax/fmin instead of MYMAX/MYMIN. Remove scope-limiting braces. Consistently define literals as floats, except in noise parameters. Cleanup literals in noise parameters. Remove unnecessary 'near_cavern' line. Reduce max spawn y to be consistent with other mapgens.
2018-04-21Mgvalleys: Use shared tunnel / cavern code instead of internalParamat
Caverns first appeared in mgvalleys and were later added to other mapgens as shared code. Now this shared code can replace mgvalley's internal cavern code. Also use shared tunnel code instead of internal code. Changes to mapgen that will affect existing worlds (mgvalleys is not stable): Single lava and water sources not added in tunnels. Previous caverns are unchanged but an equal number of new ones are added at a distance from the previous. From y = -256 to 192 nodes below, where the caverns taper at their upper limit, they will have a slightly different shape as the taper is now linear.
2018-04-21Cave liquids: Use a more precise point for calculating biomeParamat
Use the centre point of the route being carved for a more precise match between cave liquids and biome.
2018-04-20Node resolver: Make error on fallback optional, disable for mapgen aliasesParamat
2018-04-17Cavegen: Fix variable typo that broke mgvalleys large cave distribution (#7249)Paramat
Fix elusive 5 year old bug that caused mgvalleys large caves to be flat and limited to mapchunk borders. Error was fixed 2 years ago in 'CavesV6' but not in 'CavesRandomWalk'.
2018-04-07Biome API / dungeons: Add biome-defined dungeon nodesParamat
Add new biome fields 'node_dungeon', 'node_dungeon_alt', 'node_dungeon_stair'. If 'node_dungeon' is not defined dungeons fall back to classic behaviour. Remove messy and imprecise dungeon material code from 'generateBiomes()'. Code deciding dungeon materials is now in 'generateDungeons()' and uses the biome at mapchunk centre for more precision. Remove hardcoded 'MG_STONE' types as long intended.
2018-04-06Mgcarpathian: Fix spawn level calculation (#7212)Paramat
2018-04-05Mgcarpathian: Remove insignificant 'base' noise variation (#7209)Paramat
Was only +-1 node over a scale of thousands of nodes. Replace with 'base_level' parameter value.
2018-04-05Biome API / cavegen: Add definable cave liquid for a biome (#7192)Paramat
Add 'node_cave_liquid' as a new field in biome registration. If field is absent cave liquids fall back to classic behaviour.
2018-04-03Fix various clang-tidy reported performance-type-promotion-in-math-fnLoïc Blot
2018-04-02Fix many issues reported by clang-tidy (#7189)Loïc Blot
* Fix many issues reported by clang-tidy We have many issues in code related to some performance to float <-> double. Clang-tidy reported it in performance-type-promotion-in-math-fn I fixed many of them. It's not ready for a promote to blocking Also fix some value which should be const-ref
2018-03-29Mgcarpathian: Mapgen loop optimisations. fabs() -> std::fabs()Paramat
* Mgcarpathian: ZYX -> ZXY mapgen loop optimisation. * 'pow(n, 3)' to 'n * n * n' type optimisations. * fabs() -> std::fabs().
2018-03-26Mapgen: Remove unused mgv7 code and some unused biometypesParamat
2018-03-16Biomes: Fix vertical biome blendparamat
2018-03-11Biome API: Add 'get_biome_name(biome_id)' APIparamat
Change name of default biome to a more suitable lowercase 'default'.
2018-03-09VoxelArea: add_{x,y,z,p} must be staticLoic Blot
Fix some documentations issues Use getNodeNoCheck(v3s16, ...) in some cases instead of getNodeNoCheck(x, y, z, ...)
2018-03-09Biomes: Add 'min_pos'/'max_pos' xyz biome limitsparamat
'y_min' and 'y_max' are still accepted for compatibility.
2018-03-03Generate Notifier: Clear events once after all 'on generated' functionsparamat
2018-03-03MapgenValleys: Fixed submarine valleys shapeGael-de-Sailly
2018-02-27Place schematic (on vmanip): Enable use of 'place center' flagsparamat
For 'place schematic' and 'place schematic on vmanip' APIs. Fix 'place center' code to properly centre schematics. Fix some comments.
2018-02-26SAO limits: Allow SAOs to exist outside the set 'mapgen limit'paramat
2018-02-20Vertical biome blend: Tune blend patternsparamat
2018-02-20Dungeons: Add Y limits in all mapgensparamat
Preserve the upper limit used in mgvalleys.
2018-02-13Dungeons: Avoid generation in multiple liquid nodes and 'airlike'paramat
Previously only 'mapgen water source' and 'mapgen river water source' were checked for. Games can use multiple liquid nodes defined for biomes, many of which will not be aliased to those 2 mapgen aliases, causing floating dungeons to generate in some liquids. Now we check for liquid drawtype instead, so can remove liquid nodes from dungeonparams. Also check for 'airlike' drawtype instead of 'CONTENT_AIR' to avoid generation in 'airlike' nodes in some rare situations. This will also be needed for when we add definable biome air nodes.
2018-02-10Node definition manager refactor (#7016)Dániel Juhász
* Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager