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

Aquifers #105

Open
justaureus opened this issue Jun 9, 2022 · 4 comments
Open

Aquifers #105

justaureus opened this issue Jun 9, 2022 · 4 comments
Assignees
Labels
feature minor This issue will constitute a minor version bump priority=high High priority issues requires additional functionality This issue requires additional functionality implemented by Terra

Comments

@justaureus
Copy link
Contributor

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

@justaureus justaureus added biome A new biome addition priority=high High priority issues labels Jun 9, 2022
@justaureus
Copy link
Contributor Author

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

@justaureus justaureus added feature and removed biome A new biome addition labels Jun 27, 2022
@astrsh
Copy link
Member

astrsh commented Jun 27, 2022

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.

@astrsh
Copy link
Member

astrsh commented Jun 30, 2022

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

image

image

@astrsh
Copy link
Member

astrsh commented Jun 30, 2022

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

@astrsh astrsh added requires additional functionality This issue requires additional functionality implemented by Terra minor This issue will constitute a minor version bump labels Jun 30, 2022
@astrsh astrsh self-assigned this Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature minor This issue will constitute a minor version bump priority=high High priority issues requires additional functionality This issue requires additional functionality implemented by Terra
Projects
Development

No branches or pull requests

2 participants