Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Mgv7: Combine mountain terrain generation with base terrain generation #4002

wants to merge 1 commit into from

Conversation

paramat
Copy link
Contributor

@paramat paramat commented Apr 17, 2016

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.

@@ -400,7 +407,7 @@ Biome *MapgenV7::getBiomeAtPoint(v3s16 p)
return bmgr->getBiome(heat, humidity, groundlevel);
}

//needs to be updated

Copy link
Contributor

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?

Copy link
Contributor Author

@paramat paramat Apr 19, 2016

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.

@kwolekr
Copy link
Contributor

kwolekr commented Apr 19, 2016

You forgot to comment out the generateRidgeTerrain prototype in mapgen_v7.h.

@paramat
Copy link
Contributor Author

paramat commented Apr 19, 2016

generateRidgeTerrain has not been combined it's still a seperate function.

@paramat
Copy link
Contributor Author

paramat commented Apr 19, 2016

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.

@kwolekr
Copy link
Contributor

kwolekr commented Apr 19, 2016

Sorry, meant generateBaseTerrain and generateMountainTerrain.

@paramat
Copy link
Contributor Author

paramat commented Apr 20, 2016

I've deleted those prototypes because they're deleted of #if0'd in cpp.

@paramat
Copy link
Contributor Author

paramat commented Apr 20, 2016

Updated:
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

Tested with water_level = -32. Far is before, near is after:

screenshot_20160420_052040

I still have to move the #if0'd code (generateMountainTerrain) to the end of the file, i'll do that before merge.

@paramat
Copy link
Contributor Author

paramat commented Apr 20, 2016

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
@paramat
Copy link
Contributor Author

paramat commented Apr 20, 2016

fed5dd3

@paramat paramat closed this Apr 20, 2016
@paramat paramat deleted the mgv7mountgen branch April 21, 2016 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants