Cubitect / cubiomes

C library that mimics the Minecraft biome generation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Finder for Caves in 1.19+

nathanowen42 opened this issue · comments

I am marking this as a feature request, however I am currently working on reversing the relevant code and adding support myself. Will submit a pull request once I have something that seems to be working. Just wanted to put a bookmark of sorts here in case anyone else is working on this and would like to collaborate instead of working in parallel on the same feature.

As of 1.19 caves are a significant feature that might be useful to locate. For example one might want to locate a stronghold inside of a large cave, a village near a cave entrance, etc.

Feature Summary:
Locate 1.19+ style caves. Initial idea would be to replicate the detection that https://www.chunkbase.com/apps/seed-map has when displaying the "cave" feature.

Desired:
Filter caves by size (e.g. small, medium, large) and by type (e.g. cheese, spaghetti).

When 1.18 came out, I tried to figure out how aquifers generate, but got stuck at some point. Not entirely sure if this directly related, but I'll be interested what you find for caves.

This would possibly improve the surface height approximation as well (which is a limiting factor for the accuracy for desert pyramids, atm., among others).

The initial reversing took less time than I expected. I think I have a fairly good understanding for how caves are generated in MC 1.19+.

Basically there are eight types of caves.

The first four are from earlier versions and consist of "cave", "ravine/canyon", "nether cave", and something called "cave_extra_underground" at least out of my deobf (not really sure what that last one is). None of those really matter for the feature I am proposing but are easy enough to detect if desired. These are made by the world carver following initial terrain generation.

The new caves are of type "spaghetti", "noodle", "cheese", and "sloped_cheese". These are sometimes referred to as "noise caves" as they are governed by the density function as defined in the noise_settings JSON config files. Some documentation already exists for this here https://misode.github.io/guides/density-functions. Detection should be fairly trivial from there.

My inclination is to add new files for the noise/density functions as they seem fairly specific to later versions and seem fairly distinct from the existing cubiomes code.