
RealisticWorld
This project adds a realistic custom world generation
Список изменений
Perfromce Update
Better world generation perfromance
Measured using the actual generator classes in a single-core sandbox, with an array-based fake implementation instead of Paper's ChunkData. Results fluctuate significantly. The range across 3 runs matters, not individual measurements.
| Dimension | Original | New | Main Cause |
|---|---|---|---|
| Overworld | 8.4–13.2 ms/chunk | 6.0–7.4 ms/chunk | Chunk sampling, cave noise |
| Nether (single run) | 6.7 ms | 3.0 ms | Biome lookups, surface generation |
| End (single run) | 2.8 ms | 1.7 ms | Biome lookups |
In the Overworld, setBlock calls per chunk decrease from 56,753 to 40,369. How much this improves performance in Paper depends on its ChunkData implementation and has not been measured.
Modified Files
All files in gen/:
Noise, TerrainSampler, RealisticChunkGenerator, SurfaceBuilder, FeaturePopulator, NetherSampler, NetherGenerator, NetherBiomeProvider, EndSampler, EndGenerator, EndBiomeProvider.
A new perf-harness/ directory was added (tests and benchmarks, not included in the Gradle build).
Specific Improvements
- Biome Blending: Gaussian weights now depend only on the offset within the 16-block cell and are stored in a lookup table. Previously, each column could trigger up to 81
exp()calls and 81ConcurrentHashMaplookups with Long boxing. Cell biomes are now retrieved only once per chunk. - Border Columns: The 1-block border of a chunk no longer performs biome classification. Only the terrain height is read there.
getBaseHeightand pond height calculations now use the same code path. - Cave Noise: Vertical 3D noise (
Noise.Vertical) eliminates redundant x/z grid calculations for each column. The second tunnel noise is only calculated if the first one is sufficiently close to the threshold. The loop now only runs up to the configured height limit, except for sinkholes. generateNoise(Overworld): Previously, stone was written first and then replaced with deepslate below Y 0. Now, each block is written only once.- Chunk Cache: Cache entries were previously removed in
generateBedrock. IfgenerateCavesran afterwards, the entire chunk had to be sampled a second time. Cache entries are now removed only after their final consumer has finished. - Nether: The biome provider now uses a per-thread cache because biomes do not depend on Y-level. Previously, the entire terrain sampler was recalculated for every vertical section.
generateNoisenow writes block runs usingsetRegion, surface generation reads through a sliding window only once instead of three times per Y-level, and one noise evaluation is skipped whendeltaW == 0. - End: Biome caching was added.
hangandRare now only calculated where needed (Ruses a proven upper bound), and shard noise now runs vertically. - Miscellaneous: Badlands band noise in
SurfaceBuilderis now calculated once per column instead of once per block. Lush Cave and Dripstone Cave weights are precomputed.
Impact on the World
None. This has been verified through hash comparisons, not merely claimed. All configuration keys remain unchanged.
