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

Switch mapgen to using biomes (still with backwards compatibility) #13

Merged
merged 3 commits into from
Jun 8, 2020

Conversation

Treer
Copy link
Collaborator

@Treer Treer commented Jan 18, 2020

This moves the original mapgen code to mapgen_nobiomes.lua, and provides an MT5 biomes-based equivalent mapgen in mapgen.lua. Both mapgens use paramat's cave noise. The old mapgen is loaded in v6 worlds and versions of MT prior to 5.1

My own reason for the change is I want to add a lot to the Nether, and getting it working with biomes API, ores API etc provides a better platform to build on.

However, this PR provides many other advantages:

  • mapgen is ~20% faster ...(at least until more features get added).
  • Dungeons are preserved. It's not perfect, but the original code was converting them to netherbrick, followed shortly by overwriting entirely with netherrack and losing them.
  • Nether has both a min height and max height, to play nicely with other mods that create realms in underground y ranges. These heights are configurable in the settings.
  • Glowstone/lava scarcities are adjustable without affecting other biomes/mapgen.
  • Glowstone and netherrack stalactites
  • Other mods can add ores etc to the Nether. This is something I'd like for allowing game progression, e.g. to obtain the material for <goal> (or to build a portal to <other goal>) you must first reach and journey through the Nether. As though to underscore this, I hear that for the first time Mojang will add a substance harder than diamond, and they're placing it as an ore in the Nether. A biomes mapgen means Minetest mods have that option.
  • Unique decoration and slightly incomplete excavation of dungeons / occasional happy accidents of the excavator, gives Nether dungeons a distinct feel, different from traditional Minetest dungeons.

Things to note:

  • override_underground_biomes() will shift biomes that overlap the Nether, this includes many of the MTG biomes such as "savanna_under" which extend from -256 to -31000
  • By default, the Nether now extends from -5000 to -11000 instead of all the way to -32000. This might have been what @FaceDeer was concerned about (?) However PilzAdam's portal started searching from the top of the Nether (starting randomly between 5500 - 6500) and normally gives up after 4096, so it seems unlikely that people ever had ways of reaching very deep nether.

Tips to make evaluating the changes easier:

  • diff mapgen_nobiomes.lua against the original mapgen.lua, rather than trying to vet it as if it were new code.
  • diff mapgen.lua against mapgen_nobiomes.lua, and note that find_nether_ground_y and on_gerated are mostly the same, with on_gerated no longer needing to iterate through the overdraw regions to remove lava and water (due to node_cave_liquid = "air" in the nether_caverns biome definition). Vet normally the new code in mapgen.lua for setting up biomes and excavating dungeons.
  • mapgen_decorations and the init can be checked as you usually would.
  • Optionally confirm that Nether generated with old map is seamless with the biomes-based changes.
  • Consider if the "things to note" section above raise any concerns

Git flow?

Rather than end up with a massive PR like the Portals API, would the maintainers of this mod prefer a dev branch, and approve/merge in smaller PRs like this one into it. Then when I'm ready for the changes to go into master there's no review/testing needed?

(though I'm also quite happy to just keep adding to a branch and have a massive PR at the end)

@Treer Treer changed the title Switch mapgen to using biomes Switch mapgen to using biomes (still with backwards compatibility) Jan 25, 2020
This was referenced Jan 26, 2020
@Treer Treer force-pushed the feature/biome_mapgen branch 4 times, most recently from f8df0ca to 17b1ce2 Compare February 18, 2020 10:39
@SmallJoker
Copy link
Member

@Treer nether is now under your control. Please feel free to rebase and merge this PR if this wasn't already implemented by one of the previous massive PRs.

Treer added 2 commits June 5, 2020 19:32
Removes hard black edges appearing at emerge boundaries.
For v6 mapgen which doesn't support biomes, or MT versions prior to 5.1 which don't support the necessary biome features
@Treer Treer force-pushed the feature/biome_mapgen branch 4 times, most recently from 72ada3c to 17f3f11 Compare June 8, 2020 10:31
Prevents the c++/native mapgen from placing ores or decorations (when useBiomes is true).
The biomes-based implementation is faster, more deterministic, and keeps its dungeons, but requires MT 5.1 features to work.

Also
 * Glowstone & Netherrack stalactites
 * Include the new decorations in mapgen_nobiomes
 * Decorate dungeons - Add windows and glowstone "chandeliers" to some rooms
 * Configurable Nether floor and ceiling depths
@Treer Treer merged commit aac3ea6 into minetest-mods:master Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants