Parse aquifer and ore-vein noise routers
The overworld noise_router ships fourteen keys; we read six. The eight left on the floor are exactly the ones the aquifer, the ore veins and the preliminary surface estimate need, so every one of those subsystems has been impossible to write. Wire the rest of the router into OverworldDensity: barrier, fluid_level_floodedness, fluid_level_spread and lava for the aquifer, vein_toggle/vein_ridged/vein_gap for the veins, and preliminary_surface_level for both. Two node types were missing and are added with them -- minecraft:invert (the reciprocal, not negation: Mapped.Type ordinal 5 is 1.0/input) and minecraft:find_top_surface, which walks down from an upper bound in cell_height steps looking for positive density. PreliminarySurfaceLevelAt wraps that node the way NoiseChunk does: quart-align the column, then memoise. The cache is per generator rather than per chunk because the aquifer samples columns up to three chunks away, so neighbours overlap heavily -- with a shared cache a chunk costs a few dozen evaluations instead of a few thousand. Also lifts sea_level, min_y, height and the aquifers/ore-veins flags out of the settings file, and adds PositionalRandomFactory.At for the aquifer cell centres (Mth.getSeed hashed into the low half of the factory seed). No generator output changes yet: nothing reads the new keys.
This commit is contained in:
parent
90e9380ae7
commit
ed045ee09d
6 changed files with 378 additions and 21 deletions
|
|
@ -126,6 +126,12 @@ func QuarterNegative(a DensityFunction) DensityFunction {
|
|||
return x * 0.25
|
||||
}}
|
||||
}
|
||||
// Invert is the reciprocal transform (DensityFunctions.Mapped.Type.INVERT):
|
||||
// 1/x, not negation. The overworld's preliminary_surface_level upper bound is
|
||||
// the only place it appears.
|
||||
func Invert(a DensityFunction) DensityFunction {
|
||||
return unaryOp{a, func(x float64) float64 { return 1.0 / x }}
|
||||
}
|
||||
func Squeeze(a DensityFunction) DensityFunction {
|
||||
return unaryOp{a, func(x float64) float64 {
|
||||
d := clamp(x, -1, 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue