New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mgv7: Combine mountain terrain generation with base terrain generation #4002
Conversation
@@ -400,7 +407,7 @@ Biome *MapgenV7::getBiomeAtPoint(v3s16 p) | |||
return bmgr->getBiome(heat, humidity, groundlevel); | |||
} | |||
|
|||
//needs to be updated | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why'd you remove this comment, seeing as how mountains now include base terrain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to ask you, what's this comment for? It's been here for years, i can't see what needs updating.
Mountains don't include base terrain, the generation has been combined but these (get)terrain(level) functions are correct as they are.
You forgot to comment out the generateRidgeTerrain prototype in mapgen_v7.h. |
generateRidgeTerrain has not been combined it's still a seperate function. |
I've seen an error, generateRidgeTerrain cannot return when node_max.Y < water_level because of the case when node_max.Y is only a few nodes below water_level, the river channel will still need excavating. Will fix. |
Sorry, meant generateBaseTerrain and generateMountainTerrain. |
I've deleted those prototypes because they're deleted of #if0'd in cpp. |
Updated: Tested with water_level = -32. Far is before, near is after: I still have to move the #if0'd code (generateMountainTerrain) to the end of the file, i'll do that before merge. |
Approval from hmmmm http://irc.minetest.ru/minetest-dev/2016-04-20#i_4587936 |
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
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
///////////////////////////////////////////////
Fixes issue #4000
Mountain generation is still optional, the flag is cached for use in the main generation loop.
Mountain noise calculation is moved back into 'calculateNoise' and enabled with the mountain flag.
Generation is simpler and slightly faster due to 2 loops being combined into 1.
If base terrain stone is placed now there is no unnecessary check to see if mountain stone should be placed, the mountain flag also disables this check.
The former 'generateTerrain' which included base terrain gen, mountain gen and ridge gen, has been removed. Now the main terrain loop and ridge gen are called directly from 'makeChunk'.
Tested.