Commit Graph

140 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 bbff80a0e2 Mgv7p development (#94) 2018-07-19 12:09:50 +02:00
paramat dd47cac6e6 Generate Notifier: Clear events once after all 'on generated' functions 2018-06-03 17:32:00 +02:00
paramat 63276e2a8b SAO limits: Allow SAOs to exist outside the set 'mapgen limit' 2018-06-03 17:32:00 +02:00
paramat 32b46d21c3 (Re)spawn players within 'mapgen_limit'
Previously, findSpawnPos() did not take the 'mapgen_limit' setting into account,
a small limit often resulted in a spawn out in the void.
Use the recently added 'calcMapgenEdges()' to get max spawn range through a new
mapgenParams function 'getSpawnRangeMax()'.

Previously, when a player respawned into a world, 'objectpos_over_limit()' was
used as a check, which was inaccurate.
Use the recently added 'saoPosOverLimit()' to get exact mapgen edges.

Also fix default value of 'm_sao_limit_min'.
2018-06-03 17:31:59 +02:00
Maksim Gamarnik 35770f4abb Merge Minetest 0.4.16 2017-06-06 23:03:34 +03:00
Loïc Blot 7365f2ec60 Properly remove SAO when worldedges are overtaken (#5889)
* LuaEntitySAO: Remove beyond outermost mapchunk edges

Based on a commit by, and with help from, nerzhul.
Add 2 functions to class Mapgen:
A function to calculate actual mapgen edges, called from the Mapgen constructor.
A function called indirectly from content_sao.cpp per entity step to check SAO
position is within mapgen edges.

* Calculate borders from params not mapgen, which is not available everytime
2017-06-03 19:57:02 +02:00
paramat e45af9e0b7 Mapgen files: Update and correct copyright credits 2017-05-26 20:46:03 +01:00
Paramat fac156a907 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 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
paramat 1bb70a78a9 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 a43960dec3 Dungeons: Use 'block' instead of 'brick' for nodebox stairs
Affects only sandstone dungeons. Nodebox stairs made from
'sandstone_block' look better because every step is undivided.
2017-03-05 09:47:03 +00:00
Maksim Gamarnik e05f7db82f Updated to Minetest ver. 0.4.15 2017-01-30 00:44:07 +02:00
paramat b33af56302 Dungeons: Add nodebox stairs to desert and sandstone dungeons
Desert and sandstone dungeons have 2 node wide corridors. Previously,
nodebox stairs were disabled because dungeon generation code did not
support nodebox stairs wider than 1 node, now it does.

Add 'stair desert stone' content id to MappgenBasic.

Requires 'mapgen stair desert stone' to be added to Minetest Game.
2017-01-26 20:18:54 +00:00
paramat 5ff0d76aaa Mapgen: Make mgv7 the default mapgen 2016-12-12 07:19:05 +00:00
paramat 0fb1cf3779 Mapgen: Remove unused 'flat' and 'trees' flags from mg_flags
When the 'flat' and 'trees' flags were moved into mgv6_spflags they
were left in mg_flags in an attempt to support old mgv6 worlds. However
their appearence in mg_flags causes confusion, also, later, old-world
support was found to be broken for mgv6 worlds with 'notrees'.

This commit cleans up the mess and comes a month after a thread warning
of the change, and explaining the required action, was posted in the
news subforum. Only old mgv6 worlds with 'flat' or 'notrees' are
affected, a small minority of worlds, the required action being
correctly setting these flags in mgv6_spflags.

Disable a section of the 'map settings manager' unit test which is to
be changed as it is causing problems for pull requests.
2016-08-04 06:58:42 +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
kwolekr 55913a1218 Mapgen: Refactor mapgen creation and management
- Move mapgen creation logic out of EmergeManager and into Mapgen
- Internally represent mapgen type as an enum value, instead of a string
- Remove the need for a MapgenFactory per mapgen
2016-07-03 14:04:11 -04:00
MillersMan 871a98ce3d Mapgen: Performance improvement and fixes for updateLiquid (#4065)
- Adds only ~100 nodes per chunk to trans_liquid with similar processing time
- Adds liquid nodes themselves instead of potential solid nodes below them
- CONTENT_IGNORE nodes are interpreted as if they continue their neighborhood
- This allows liquid columns to span multiple chunks without being interrupted
- NOTE: Expects an one-node border in generation chunk without liquid changes
2016-06-04 19:32:54 -04:00
kwolekr 8ee3cb1f4a Biomes: Define and use biome_t for biome IDs 2016-06-04 03:00:45 -04:00
kwolekr 72809172eb 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 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 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 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 ba2e36fd37 Merge 2015-12-09 12:56:21 +02:00
paramat 26728947bc Mapgen: Add propagate_shadow bool to calcLighting
To terminate unwanted shadows from floatlands or realms above
Also add to LuaVoxelManip calc_lighting for use in mapgen mods
Remove the 2 argument calcLighting, mapgens now use the 5
argument form to specify the volumes for propagateSunlight and
spreadLight
In mgsinglenode replace calcLighting with setLighting and
clean-up use of tabs and spaces
2015-12-07 03:18:24 +00:00
Maksim Gamarnik b3726345ff Merge last minetest commits 2015-11-27 12:57:52 +02:00
paramat 9a49529472 Mapgen: Add global 'decorations' flag
Flag is set by default in MapgenParams
The global 'trees' flag remains but is now
undocumented and unset by default in MapgenParams
Add mgv6_spflag 'trees' set by default in
defaultsettings.cpp to affect new worlds only
This is automatically backwards
compatible for existing worlds
2015-11-21 00:10:08 +00:00
Maksim Gamarnik 919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
kwolekr e0e2bb3117 Add DISABLE_CLASS_COPY macro (and use it)
Use this macro to disallow copying of an object using the assignment
operator or copy constructor.  This catches otherwise silent-but-deadly
mistakes such as "ServerMap map = env->getMap();" at compile time.

If so desired, it is still possible to copy a class, but it now requires
an explicit call to memcpy or std::copy.
2015-10-27 22:05:08 -04:00
paramat ae975d7c91 Decoration API: Add flag for placement on liquid surface
Add findLiquidSurface() function to mapgen.cpp
Update lua_api.txt
2015-10-23 21:30:20 +01:00
paramat 7dc363b3d2 Mgv5/mgv7 biomes: Reduce heat and humidity noise spreads to former value of 750 2015-09-07 02:56:20 +01:00
onkrot d06a5db736 Remove unused functions. 2015-08-16 14:29:33 +02:00
Maksim Gamarnik 9247f32e0e LGPL 2.1 to 3.0 on all files 2015-08-14 01:26:28 +03:00
paramat 8dac0b8485 Biome API: Increase heat and humidity noise spreads to 1000 2015-06-30 07:04:18 +01:00
paramat 063ca7aa52 Mapgen objects: Enable heatmap and humidmap for all biome api mapgens 2015-06-20 04:16:17 +01:00
paramat d80262c640 Biome API: Add noise defined biome blend 2015-06-18 07:05:22 +01:00
paramat af5a0f05e3 Biome API, mgv7: Increase heat/humidity spreads. Improve mgv7 noise parameters 2015-05-31 23:21:32 +10:00
kwolekr 8c560dc2d0 Split ObjDef/ObjDefManager out to objdef.cpp 2015-05-31 23:21:12 +10:00
paramat ef897083ad Mapgen v5/v7: Detect sandstone, enable sandstone brick dungeons 2015-05-31 23:20:47 +10:00
paramat 4794436910 Biome API, mgv7: Increase heat/humidity spreads. Improve mgv7 noise parameters 2015-05-24 04:33:09 +01:00
kwolekr 7e10e81669 Split ObjDef/ObjDefManager out to objdef.cpp 2015-05-18 22:30:25 -04:00
paramat 53dda619f0 Mapgen v5/v7: Detect sandstone, enable sandstone brick dungeons 2015-05-17 06:07:39 +01:00
kwolekr 256b196879 ObjDefManager: Set replacement object's handle info after calling set()
Make gamedef optional when constructing an ObjDefManager
Add note about object ownership
2015-05-04 16:52:07 +10:00
kwolekr 75cfe8651e ObjDefManager: Set replacement object's handle info after calling set()
Make gamedef optional when constructing an ObjDefManager
Add note about object ownership
2015-05-03 22:19:35 -04:00