PolyhedralDev / TerraOverworldConfig

Overworld config pack for Terra
Creative Commons Attribution 4.0 International
34 stars 36 forks source link

Aquifers #105

Open justaureus opened 2 years ago

justaureus commented 2 years ago

Once we have 3D biomes, add aquifers as a biome

justaureus commented 2 years ago

Update: Aquifers will be done has features similarly to how the deep dark sculk veins work

Astrashh commented 2 years ago

Update: Aquifers will be done has features similarly to how the deep dark sculk veins work

This can be done but needs to be profiled as sampling at full res may reduce performance a fair bit. Once the layered generator is implemented this will be implemented through that instead.

Astrashh commented 2 years ago

After doing a feature implementation - I've discovered this will cause issues with structure gen that occurs before feature stages:

image

image

Astrashh commented 2 years ago

Leaving the feature config here for future reference - I think we will wait until its either possible to place features before structure gen, or until the layered generator is implemented.

id: AQUIFERS
type: FEATURE

variables: &variables
  warpAmplitude: 30
  layerTopHeightVariation: 60
  layerHeight: 80
  layerSeparation: 40
  maxHeight: &max 64
  minHeight: &min -56 # Calculated by maxHeight - layerHeight - layerSeparation * (1 - <How many layers are stacked>)

distributor:
  type: "YES"

locator:
  type: AND
  locators:
    - type: PATTERN
      range: &range
        min: *min
        max: *max
      pattern:
        type: MATCH_AIR
        offset: 0

structures:
  distribution:
    type: EXPRESSION # Used to domain warp X and Z according to Y
    expression: sampler(x+warp(x+y,z+y)*warpAmplitude, y-maxHeight, z+warp(-z+y,x+y)*warpAmplitude)
    variables: *variables
    samplers:
      warp:
        dimensions: 2
        type: OPEN_SIMPLEX_2
        frequency: 0.01
      sampler:
        dimensions: 3
        type: EXPRESSION
        expression: |
          max(
            // Stack aquifer layers
            layer(x, y, z),
            layer(x, y+layerSeparation, z+1000)
          )
        variables: *variables
        samplers:
          layer:
            dimensions: 3
            type: EXPRESSION
            variables: *variables
            expression: |
              if(y > 0, -1,
                if(y + cell(x,z) * layerTopHeightVariation > 0, -1,
                  lerp(y, -layerTopHeightVariation, simplex(x,y/2,z), -layerHeight, -1)
                )
              )
            samplers:
              cell:
                dimensions: 2
                type: PROBABILITY
                sampler:
                  type: CELLULAR
                  return: CellValue
                  frequency: 0.01
              simplex:
                dimensions: 3
                type: OPEN_SIMPLEX_2
                frequency: 0.01

  structures:
    - blank: 30
    - BLOCK:minecraft:deepslate: 3 # Block separating aquifers from air - needs to be worked on to blend from stone to deepslate
    - BLOCK:minecraft:water: 20