Terrain feel: biome regions ~10x larger (Voronoi cell size 96->960); terrain height now eases across biome borders via a Voronoi distance blend (smooth, and ~25x cheaper than the old 169-sample box blur); mountains capped to ~2/3 world height and gentled (ridged amplitude/frequency lowered), snow line lowered to match. Centralization: ~27 world-gen/render tuning constants (biome amplitudes & frequencies, climate-noise frequencies/octaves, biome-selection thresholds, blend width, cell size, filler depth, snow line, camera near plane, spawn offset, overlay scale) hoisted from scattered literals into a region-organized, fully-commented Configuration. Configuration is threaded into NoiseSource, the biomes, BiomeRegistry, BiomeMap (+Classify), TerrainSampler, WorldGenerator (+BlockAt filler depth), and Camera via Player. Defaults equal the prior values, so generation is unchanged; worldgen tests updated for the new constructor signatures.
22 lines
641 B
C#
22 lines
641 B
C#
using VoxelEngine.Core;
|
|
using VoxelEngine.World.Blocks;
|
|
using VoxelEngine.World.WorldGen.Biomes;
|
|
|
|
namespace VoxelEngine.World.WorldGen;
|
|
|
|
public sealed class BiomeRegistry
|
|
{
|
|
public IBiome Plains { get; }
|
|
public IBiome Desert { get; }
|
|
public IBiome Mountains { get; }
|
|
public IBiome Forest { get; }
|
|
|
|
public BiomeRegistry(int seed, BlockRegistry blocks, Configuration cfg)
|
|
{
|
|
this.Plains = new PlainsBiome(seed, blocks, cfg);
|
|
this.Desert = new DesertBiome(seed, blocks, cfg);
|
|
this.Mountains = new MountainsBiome(seed, blocks, cfg);
|
|
this.Forest = new ForestBiome(seed, blocks, cfg);
|
|
}
|
|
}
|