Skip to content

Commit

Permalink
Add canyon biomes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rearth committed Jan 9, 2024
1 parent c1c4093 commit 438f6b1
Show file tree
Hide file tree
Showing 26 changed files with 756 additions and 49 deletions.
4 changes: 3 additions & 1 deletion biome-distribution/presets/rearth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ biomes:
- << biome-distribution/extrusions/add_deep_dark.yml:extrusions
provider:
type: PIPELINE
resolution: 6
resolution: 4
blend:
amplitude: 6
sampler:
Expand All @@ -27,6 +27,8 @@ biomes:
ocean: 1
land: 1
stages:
# - << biome-distribution/stages/special/canyons.yml:stages
- << biome-distribution/stages/special/canyons.yml:stages
- << biome-distribution/stages/coasts.yml:stages
- << biome-distribution/stages/fill_coasts.yml:stages
- << biome-distribution/stages/oceans.yml:stages
Expand Down
35 changes: 35 additions & 0 deletions biome-distribution/stages/special/canyons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
stages:
- type: REPLACE
sampler:
type: EXPRESSION
dimensions: 2
variables:
canyonStrength: ${customization.yml:biomeSpread.canyons.canyonAmount}
expression: |
min(max(-mask(x,z * 1.3) - canyonStrength, 0) * 18, 1) *
max((-abs(base(x,z)) + 0.3) * 2, 0) * (1 / 0.2)
samplers:
base:
dimensions: 2
type: OPEN_SIMPLEX_2S
frequency: 1 / ${customization.yml:biomeSpread.cellDistance} * 1
mask:
dimensions: 2
type: CELLULAR
frequency: 1 / ${customization.yml:biomeSpread.cellDistance} * 0.15
seed: 23456345
from: land
range:
min: ${customization.yml:biomeSpread.canyons.minY}
max: 319
to:
SELF: 16
_canyon: 7
- type: REPLACE
from: _canyon
sampler:
type: EXPRESSION
expression: temperature(x, z)
to:
ICY_INCISIONS: 3
SANDY_SPLITS: 4
42 changes: 42 additions & 0 deletions biomes/rearth/base/eq_canyon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
id: EQ_CANYON
type: BIOME
abstract: true

terrain:
sampler:
type: EXPRESSION
expression: -y + 73

variables: &variables
canyonFloor: ${customization.yml:biomeSpread.canyons.minY} + 3
canyonStrength: ${customization.yml:biomeSpread.canyons.canyonAmount}

carving:
sampler:
type: EXPRESSION
dimensions: 3
variables: *variables
expression: |
if (y < canyonFloor + base(x * 5, z * 5) * 4,
-1,
if (min(max(-mask(x,z * 1.3) - canyonStrength, 0) * 18, 1) * max((-abs(base(x,z)) + 0.3) * 2, 0) * 2 > curve(y + (40 - canyonFloor)) + walls(x,y * 2,z) * 0.15 - 0.1,
1,
-1))
functions:
curve:
arguments: [x]
expression: 5.177726 - 0.179325*x + 0.0022188*x^2 - 0.000008863763*x^3
samplers:
base:
dimensions: 2
type: OPEN_SIMPLEX_2S
frequency: 1 / ${customization.yml:biomeSpread.cellDistance} * 1
mask:
dimensions: 2
type: CELLULAR
frequency: 1 / ${customization.yml:biomeSpread.cellDistance} * 0.15
seed: 23456345
walls:
dimensions: 3
type: OPEN_SIMPLEX_2S
frequency: 0.04
2 changes: 0 additions & 2 deletions biomes/rearth/debug/variant_c.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
id: VARIANT_C
type: BIOME
extends:
- BASE
color: $biomes/colors.yml:PLAINS

vanilla: minecraft:plains
Expand Down
22 changes: 0 additions & 22 deletions biomes/rearth/debug/variant_d.yml

This file was deleted.

22 changes: 0 additions & 22 deletions biomes/rearth/debug/variant_e.yml

This file was deleted.

34 changes: 34 additions & 0 deletions biomes/rearth/variants/canyon_arid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
id: SANDY_SPLITS
type: BIOME
extends: [ EQ_CANYON, CARVING_LAND, BASE ]
vanilla: minecraft:lush_caves
color: $biomes/colors.yml:JUNGLE

colors:
sky: 0xE2D3B3
fog: 0xE2D7C3
grass: 0x70E66D
foliage: 0x70E66D
water: 0x3F76E4
water-fog: 0x50533

palette:
- TERRACOTTA_CANYON_HIGH: 319
- SAND_CANYON: ${customization.yml:biomeSpread.canyons.minY} + 5
- << meta.yml:palette-bottom

slant:
- threshold: 0.75
palette:
- TERRACOTTA_CANYON_HIGH: 319
- TERRACOTTA_CANYON: 55
- << meta.yml:palette-bottom

features:
landforms:
- GRANITE_BOULDERS_CANYON
- LARGE_LEAF_VINES_CANYON
flora:
- CACTUS_CANYON
- CAVE_GLOW_BERRIES
- CAVE_GLOW_LICHEN
41 changes: 41 additions & 0 deletions biomes/rearth/variants/canyon_frozen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id: ICY_INCISIONS
type: BIOME
extends: [ EQ_CANYON, CARVING_LAND, BASE ]
vanilla: minecraft:dripstone_caves
color: $biomes/colors.yml:FROZEN_ARCHIPELAGO

colors:
sky: 0xA5B0BD
fog: 0xD7D8E1
grass: 0x86B09B
foliage: 0x63A17E
water: 0x3F76E4
water-fog: 0x50533

palette:
- TERRACOTTA_CANYON_ICE_HIGH: 319
- FROZEN_CANYON: ${customization.yml:biomeSpread.canyons.minY} + 5
- << meta.yml:palette-bottom

slant:
- threshold: 0.75
palette:
- TERRACOTTA_CANYON_ICE_HIGH: 319
- TERRACOTTA_CANYON_ICE: 55
- << meta.yml:palette-bottom

features:
slabs:
- SNOW_LAYERS
landforms:
- GRANITE_BOULDERS_CANYON
- CEILING_ICICLES
preprocessors:
# - LARGE_LEAF_VINES_CANYON_FROZEN
trees:
- COLD_EVERGREEN_TREES_CANYON
- TREE_SNOW_CANYON
postprocessors:
- CAVE_GLOW_BERRIES
- CAVE_GLOW_LICHEN
- LARGE_LEAF_VINES_CANYON_FROZEN
4 changes: 4 additions & 0 deletions customization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ biomeSpread:

mountainFrequency: 0.004 # shared frequence of some larger mountain biomes, allows them to blend easier

canyons:
minY: 25 # how deep down the canyons will go. This is an absolute Y height. Increase to make the canyons shallower
canyonAmount: 0.93 # How rare the canyons should be. Range 0-1, with 1 disabling all canyons

# the below values are only partially used and will be removed/moved at some point in the future

global-scale: 1
Expand Down
29 changes: 29 additions & 0 deletions features/boulders/granite_boulders_canyon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
id: GRANITE_BOULDERS_CANYON
type: FEATURE

distributor:
type: AND
distributors:
- type: PADDED_GRID
width: 8
padding: 5
salt: 2315
- type: SAMPLER
sampler:
type: PROBABILITY
sampler:
type: OPEN_SIMPLEX_2
salt: 8244
frequency: 0.01
threshold: 0.2

locator:
type: SURFACE
range:
min: ${customization.yml:biomeSpread.canyons.minY}
max: 64

structures:
distribution:
type: CONSTANT
structures: granite_boulder
27 changes: 27 additions & 0 deletions features/misc/tree_snow_canyon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id: TREE_SNOW_CANYON
type: FEATURE

distributor:
type: "YES"

locator:
type: PATTERN
range:
min: ${customization.yml:biomeSpread.canyons.minY}
max: ${meta.yml:ocean-level} + 1
pattern:
type: AND
patterns:
- type: MATCH_AIR
offset: 0
- type: MATCH_SET
blocks:
- minecraft:oak_leaves
- minecraft:spruce_leaves
- minecraft:birch_leaves
offset: -1

structures:
distribution:
type: CONSTANT
structures: BLOCK:minecraft:snow
4 changes: 2 additions & 2 deletions features/rearth/sinkhole_trees.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ locator:
locators:
- type: TOP
range: &range
min: $meta.yml:bottom-y
max: -30
min: 15
max: 50
- type: PATTERN
range: *range
pattern:
Expand Down
35 changes: 35 additions & 0 deletions features/vegetation/cactus_sparse_underground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
id: CACTUS_CANYON
type: FEATURE

distributor:
type: SAMPLER
sampler:
type: POSITIVE_WHITE_NOISE
salt: 2586
threshold: 0.03

locator:
type: AND
locators:
- type: SURFACE
range: &range
min: ${customization.yml:biomeSpread.canyons.minY}
max: ${customization.yml:biomeSpread.canyons.minY} + 20
- type: PATTERN
range: *range
pattern:
type: MATCH_SET
blocks:
- minecraft:sand
offset: -1
- type: ADJACENT_PATTERN
range: *range
match-all: true
pattern:
type: MATCH_AIR
offset: 0

structures:
distribution:
type: CONSTANT
structures: cactus
44 changes: 44 additions & 0 deletions features/vegetation/trees/cold_evergreen_trees_canyon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
id: COLD_EVERGREEN_TREES_CANYON
type: FEATURE

distributor:
type: PADDED_GRID
width: 7
padding: 3
salt: 9591

locator:
type: AND
locators:
- type: TOP
range: &range
min: ${customization.yml:biomeSpread.canyons.minY}
max: ${customization.yml:biomeSpread.canyons.minY} + 25
- type: PATTERN
range: *range
pattern:
type: MATCH_SET
blocks: $features/vegetation/meta.yml:plantable-blocks
offset: -1
- type: PATTERN
range: *range
pattern:
type: MATCH_SET
blocks:
- minecraft:snow
- minecraft:air
offset: 0

structures:
distribution:
type: CELLULAR
return: CellValue
frequency: 0.03
structures:
- oak_tree_procedural: 12
- large_oak_tree_procedural: 1
- birch_tree_procedural: 4
- large_birch_tree_procedural: 1
- large_thin_birch_tree_procedural: 1
- large_oak_tree_procedural_2: 1
- spruce_tree_procedural: 10
Loading

0 comments on commit 438f6b1

Please sign in to comment.