- create FeatureMatchers from FeartureTypes

- use TerraContainer for biomes in the RegionFix wrapper
- Let extreme biomes (snowy/sandy) override others when selecting biome features
This commit is contained in:
dags- 2020-01-17 21:11:31 +00:00
parent 3e086efb2c
commit 545883b867
7 changed files with 14 additions and 20 deletions

@ -1 +1 @@
Subproject commit d7d5b154b854b7f866e3817ce6f746dd192e4350 Subproject commit 1597178d4717ad684b67fcb23b3222feae1e3ee0

View File

@ -39,7 +39,7 @@ public class SwampPools implements Decorator {
return; return;
} }
if (cell.value <= levels.water) { if (cell.value <= minY) {
return; return;
} }

View File

@ -46,7 +46,7 @@ public class Steepness implements Filter, Filter.Visitor {
} }
} }
cell.steepness = Math.min(1, totalHeightDif * scaler); cell.steepness = Math.min(1, totalHeightDif * scaler);
if (cell.tag == terrains.coast && cell.steepness < 0.2F) { if (cell.tag == terrains.coast && cell.steepness < 0.22F) {
cell.tag = terrains.beach; cell.tag = terrains.beach;
} }
} }

View File

@ -42,6 +42,10 @@ public enum BiomeType {
return color; return color;
} }
public boolean isExtreme() {
return this == TUNDRA || this == DESERT;
}
public static BiomeType get(float temperature, float moisture) { public static BiomeType get(float temperature, float moisture) {
return getCurve(temperature, moisture); return getCurve(temperature, moisture);
} }

View File

@ -12,7 +12,7 @@ public class LandForms {
private static final double PLAINS_V = 0.24; private static final double PLAINS_V = 0.24;
public static final int PLATEAU_H = 500; public static final int PLATEAU_H = 500;
public static final double PLATEAU_V = 0.45; public static final double PLATEAU_V = 0.475;
public static final int LOESS_H0 = 100; public static final int LOESS_H0 = 100;
public static final int LOESS_H1 = 200; public static final int LOESS_H1 = 200;
@ -35,7 +35,7 @@ public class LandForms {
public LandForms(Levels levels) { public LandForms(Levels levels) {
terrainHorizontalScale = 1F; terrainHorizontalScale = 1F;
terrainVerticalScale = 0.975F; terrainVerticalScale = 1F;
groundLevel = levels.ground; groundLevel = levels.ground;
seaLevel = levels.water; seaLevel = levels.water;
} }
@ -118,16 +118,6 @@ public class LandForms {
.bias(groundLevel); .bias(groundLevel);
} }
public Module badlands(Seed seed) {
Module ridge = Source.build(seed.next(), LOESS_H0, 4).ridge().scale(0.25);
Module ridge2 = Source.build(seed.next(), LOESS_H1, 3).gain(1.5).ridge().scale(0.75);
Module mask = Source.perlin(seed.next(), LOESS_H1 * 2, 2).clamp(0.2, 0.9).map(0, 1);
return ridge.add(ridge2).mult(mask)
.warp(seed.next(), 360, 3, 200)
.scale(LOESS_V * terrainVerticalScale)
.bias(groundLevel);
}
public Module hills1(Seed seed) { public Module hills1(Seed seed) {
return Source.perlin(seed.next(), 200, 3) return Source.perlin(seed.next(), 200, 3)
.mult(Source.billow(seed.next(), 400, 3).alpha(0.5)) .mult(Source.billow(seed.next(), 400, 3).alpha(0.5))
@ -159,7 +149,7 @@ public class LandForms {
Module hills = combined Module hills = combined
.pow(1.125) .pow(1.125)
.warp(seed.next(), 300, 1, 100); .warp(seed.next(), 300, 1, 100);
return hills.scale(0.225).bias(groundLevel); return hills.scale(0.24).bias(groundLevel);
} }
public Module mountains(Seed seed) { public Module mountains(Seed seed) {
@ -203,7 +193,7 @@ public class LandForms {
return terraced.scale(scale).bias(groundLevel); return terraced.scale(scale).bias(groundLevel);
} }
public Module badlands2(Seed seed) { public Module badlands(Seed seed) {
Module mask = Source.perlin(seed.next(), 800, 1).clamp(0.35, 0.65).map(0, 1); Module mask = Source.perlin(seed.next(), 800, 1).clamp(0.35, 0.65).map(0, 1);
Module hills = Source.ridge(seed.next(), 500, 4) Module hills = Source.ridge(seed.next(), 500, 4)
.warp(seed.next(), 400, 2, 100) .warp(seed.next(), 400, 2, 100)

View File

@ -42,12 +42,12 @@ public class StandardTerrainProvider implements TerrainProvider {
registerMixable(context.terrain.hills, landForms.hills1(context.seed)); registerMixable(context.terrain.hills, landForms.hills1(context.seed));
registerMixable(context.terrain.hills, landForms.hills2(context.seed)); registerMixable(context.terrain.hills, landForms.hills2(context.seed));
registerMixable(context.terrain.dales, landForms.dales(context.seed)); registerMixable(context.terrain.dales, landForms.dales(context.seed));
registerMixable(context.terrain.badlands, landForms.badlands2(context.seed)); registerMixable(context.terrain.badlands, landForms.badlands(context.seed));
registerMixable(context.terrain.plateau, landForms.plateau(context.seed)); registerMixable(context.terrain.plateau, landForms.plateau(context.seed));
registerMixable(context.terrain.torridonian, landForms.torridonian(context.seed)); registerMixable(context.terrain.torridonian, landForms.torridonian(context.seed));
registerUnMixable(new VolcanoPopulator(context.seed, config, context.levels, context.terrain)); registerUnMixable(new VolcanoPopulator(context.seed, config, context.levels, context.terrain));
registerUnMixable(context.terrain.badlands, landForms.badlands2(context.seed)); registerUnMixable(context.terrain.badlands, landForms.badlands(context.seed));
registerUnMixable(context.terrain.mountains, landForms.mountains2(context.seed)); registerUnMixable(context.terrain.mountains, landForms.mountains2(context.seed));
registerUnMixable(context.terrain.mountains, landForms.mountains3(context.seed)); registerUnMixable(context.terrain.mountains, landForms.mountains3(context.seed));
} }

@ -1 +1 @@
Subproject commit c9d54733c495fb9f26ded79f56d0b8da0af1aa4f Subproject commit b7e1b7fc5f20ac8d5e6f1675a187fbd4198075cf