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

Next steps for mapgen: underground biomes, dehardcodisation #2339

Closed
paramat opened this issue Mar 20, 2019 · 14 comments
Closed

Next steps for mapgen: underground biomes, dehardcodisation #2339

paramat opened this issue Mar 20, 2019 · 14 comments

Comments

@paramat
Copy link
Contributor

paramat commented Mar 20, 2019

Addresses part of #1944 and prepares for the rest of that and #1168 #2048

Now 5.0.0 is released and there are many new engine mapgen features to use, i propose some next steps that i can code if there is agreement:

  • Underground biomes. DONE
    Replace the "underground" biome with an underground layer of each primary surface biome, all extending down to world base. This will complete the 'biome columns' and enable horizontal distribution of new stone types, ores, dungeon types, cave liquids and underground decorations.
  • Dehardcodisation. DONE
    MTG will then have to use the new 'biome-defined dungeon and cave liquid nodes' features. This is desired anyway as the classic hardcoded dungeon type and cave liquid type distributions are really just a Mapgen V6 thing that is unfortunately still used for the newer mapgens.
    So i propose a complete 'dehardcodisation' of MTG's use of engine mapgen code, everything will be defined and distributed by biome.
  • Dungeon nodes defined by biome definitions. DONE
    This will happen together with my engine intention Generalise dungeon type generation minetest#8251 to enable a variety of dungeon structures for biome-defined dungeons, instead of currently where all biome-defined dungeons have the same structure.
    So, for example, sandstone dungeons will then come in a variety of structures instead of all being low and wide as currently.
  • Cave liquids defined by biome definitions. DONE
    Currently all mapgens use another yucky hardcoded distribution for the mid-sized liquid caves. Half of these caves are flooded, and 66% of those are lava, otherwise water. I propose keeping these 3 cave types but defining by biome and maybe tuning the rarity of each.
@benrob0329
Copy link
Member

Suggestion: Rather than random floods in caves, actual underground lakes (maybe even oceans with islands on them, because why not).

I am very much for this, making MTG's underground more interesting would give exploration much more value and cause the dread of having to go mining for another 3 hours become anticipation for what crazy underground terrain I'll find next.

@ghost
Copy link

ghost commented Mar 20, 2019

Underground biomes.

If I understand this correctly it would allow underground biomes depending on overworld biome. This would be one of the greatest improvements!

The rest: yes, all power to the biome definitions.

@paramat
Copy link
Contributor Author

paramat commented Mar 20, 2019

it would allow underground biomes depending on overworld biome.

Yes.

@misterskullz
Copy link

misterskullz commented Mar 28, 2019

I would suggest trying to have a bit of underground horizontal blending between biomes. There is blending at the surface which looks great and vertical blending between biome layers but if you use a different base stone in each biome you will get these perfect columns of "this is biome 0 stone, this is biome 1 stone".

Crystal clear smooth lakes as an option with an "auto expand water sources XZ by lake_size nodes" would be great.

Decoration schematic placement is troublesome because you don't have unlimited blue sky overhead and you either force place or have things chopped off. A decoration "minimum air above / below for placement" constraint would be awesome. If you wanted to get REALLY crazy you could have decorations placed on the side of nodes, not just the tops or bottoms.

Dungeons as is seem to be kind of a misfit. If you want to do anything serious with them you have to go all out with an underground structures mod. I would either remove them entirely OR abstract the room, hallway concept out to a connected graph. It would be awesome to be able to define decorations for a hallway, a small room, large room, door schematics, etc. Currently dungeons are just frustratingly hinting at what could be and seem to be the only "man made" structure in the game. Dungeons also have order and the rest of the map is organic.

Overall it feels like the underground is the forgotten side of the mapgens. A lot of the fancy things you can do on the surface don't apply or are hard to do under the surface. So we have a 2d map rendered in 3d. But you can go caving so far down that it can take you several minetest days to see daylight again, which is amazing.

For MT game I would do per surface biome undergrounds for a few hundred nodes and then start combining them:
| Surf b 0 | Surf b 1 | Surf b 2 |
| Biome 0 | Biome 1 | Biome 2 |'
| - - Biome 3 - - | - - Biome 4 - - |
| - - Biome 3 - - | - - Biome 5 - - |

Really try to get away from the 2d mindset and show of what a proper (game) underground would look like. For MT game decorations could be mushrooms, moss, slime, stalagmites, bio luminescent critters, crystals, poison gas clouds, explosive gas pools, etc.

Is there a plan do do something similar with deep oceans?

@paramat
Copy link
Contributor Author

paramat commented Mar 29, 2019

We could have fewer biomes underground, but i can't see a reason why. If we use the surface biomes underground this creates more variety, and means that surface biomes become a marker for what's below. So i think it's best to stay with the 'world height biome columns' approach.

@Ezhh
Copy link
Contributor

Ezhh commented Apr 4, 2019

@paramat You already know, and have seen (via HW) a large part of my vision for how the underground should work. The only possible difference here is that you recommend a single underground layer, whereas HW has several, (but HW may over time change this, since it's possible to set decorations by height anyway). It will all come down to which content actually needs biomes in order to be controlled, and whether we eventually want differing stone types by depth.

For those who are curious about how stone types mix underground when using such an approach, this is an early HW screenshot from when we started looking at how biome edges appear:

hw_stone_mix

As far as I'm concerned, the amount of blending looks pretty good.

I do however want to add that I only consider this worthwhile if we are committed to adding new stone types and/or other biome-specific underground content. MTG has been largely stagnant in many ways, and this is something that could make a huge difference, not only to MTG but to the potential mods have to expand on MTG.

@paramat
Copy link
Contributor Author

paramat commented Apr 4, 2019

if we are committed to adding new stone types and/or other biome-specific underground content.

We are =) Dev is just slow as we're so busy keeping the engine alive.
Dungeons and cave liquids will become biome-specific very soon.

Ok i'll go ahead, at the moment i can't see a reason to have multiple underground layers of biomes, but that can change in future if needed.

@paramat
Copy link
Contributor Author

paramat commented Apr 12, 2019

Actually my intention will be like how HW is now, the 'ocean' layer will extend to y = -256 so itself is the shallow underground layer.
Like HW i propose adding "_under" to biome names to avoid the length of adding "_underground".

A potential issue with cave liquids:

If defined per biome, when underground it will not be so easy to find water and lava caves in one region, i'm not sure if this will be a problem.
One way around this would be the player knowing which biomes have which cave liquids, and digging down at the border of a 'water cave' biome and a 'lava cave' biome.

When chosing which biomes have which cave liquid, i propose to distribute them 'like a chess board', if you see what i mean, to minimise the distance to both liquid types.

@paramat
Copy link
Contributor Author

paramat commented Apr 17, 2019

newBiomes9_liq

^ Proposed distribution of lava and water caves by biome.
Red = lava, blue = water.

12 biomes, 6 of each.

I have tried to create a 'chessboard' type pattern such that both resources are always fairly close.

Assuming that lava is a slightly more precious resource than water (because water is already available at the surface), i have looked at the spawn mod biomes, made the central biome (grassland) lava, and tried to maximise the number of spawn biomes that have lava:

-- Table of suitable biomes

local biome_ids = {
	minetest.get_biome_id("taiga"),
	minetest.get_biome_id("coniferous_forest"),
	minetest.get_biome_id("deciduous_forest"),
	minetest.get_biome_id("grassland"),
	minetest.get_biome_id("savanna"),
}

Of course, we will have to inform players which biome has which cave liquid.

The lava caves will only be in the '_under' biomes so below y = -256 (as currently). The water caves can also be in the '_ocean' biomes so from y = -33 downwards (also as currently).

@sofar
Copy link
Contributor

sofar commented Apr 18, 2019

Given that lava is rare at the surface, shouldn't water be rare down below?

As in, I think it should be rare in every biome. I'm not saying we shouldn't have caves with giant dark seas (that would be cool), I'm just saying that no biome should have overwhelmingly water filled caves.

@Ezhh
Copy link
Contributor

Ezhh commented Apr 18, 2019

I think I'm fairly neutral regarding the liquids being biome specific. sofar makes a good point, but I'm not sure how we'd pull that off since we can define just one underground liquid per biome (or use the default of both being present).

@paramat
Copy link
Contributor Author

paramat commented Apr 18, 2019

The current engine-hardcoded behaviour is:
Half of the mid-size caves are flooded, randomly chosen per cave.
Of those, 66% have lava, the rest water, determined by 3D noise with spread 150 nodes.

The issue is, current behaviour is that both water and lava are available within a distance of roughly 150-300 nodes.
When deep underground, both resources are valuable, as surface water is distant. I think it's risky to make water rare underground, mods and games may be reliant on it.
Since cave liquid is defined per biome, making more biomes lava could result in underground water being 1000s of nodes away.

Ezhh is correct, a biome can only have 1 cave liquid, not a mix of both.

@paramat
Copy link
Contributor Author

paramat commented Apr 20, 2019

New approach #2358 (comment)
EDIT: Merged.

@paramat
Copy link
Contributor Author

paramat commented Jul 27, 2019

All done.

@paramat paramat closed this as completed Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants