* added basic support for cmake (#127)
* renamed Winter Drop version from MC_1_21_3 to MC_1_21_WD
* updated world spawn location for 1.21.2 (cubiomes-viewer #340)
* tweaked mc version to text conversion (#128)
* removed properties field in structure config and added dimension field instead
* moved biome tree selection back to biomenoise.c as it's slightly faster and avoids globals
* added pale_garden biome with 1.21.3 (version TBA)
* added small end islands and better end surface generation (#117)
* added linked end gateway finder (#117)
* fixed inaccurate End generation at large distances from 0,0
* fixed incorrect biome in outer end rings
* fixed incorrect biome area size (#122)
* much faster surface height generation for the end dimension
* added 1.21 to versions
* added trial chambers
* renamed trail_ruin to trail_ruins to match its id string
* moved biomenoise from layers.h into its own object
* moved biome tree data into separate header files for each version
* added global for the biome tree data to make runtime providers possible
* fixed outpost not generating in cherry_grove
added stopping flag for quad-base gen
fixed seed duplication when restarting quad-base generation
fixed premature stop on parameter finder when noise has only one lacunarity
The functions perform the same instructions either way, but this makes it far clearer (to me, at least) how rad and ang relate to each other, and what the runtime complexity of findFittest is (O(n^2) instead of the O(n) it might appear to be at first glance).
(generator.c)
- getMinCacheSize():
- Replaced integer mults/divs by powers of 2 with bit shifts.
- Fixed a bug that made the cache buffer 2 SeaLevelColumnNoises too short.
I'm kind of surprised this didn't cause segfaults.
- genBiomes():
- Now copies cache values from y=0 to higher y values when sy > 1, to match
behavior of b1.8 - 1.17.
(noise.c)
- removed sampleOctave2D().
(layers.c)
- genColumnNoise(): Now uses sampleOctaveAmp() for 2D Perlin samples.
- processColumnNoise(), sampleBlocks(), sampleBetaBiomeOneBlock(),
genBetaBiomeNoiseScaled():
- Replaced integer mults/divs and modulos by powers of 2 with left/right
bit shifts and bitwise and, respectively.
(generator.c)
- getMinCacheSize(): Allocate extra cache for Beta ocean column noise buffer
(noise.c)
- samplePerlin(): Reverted previous change, as the attempted optimization had
unintended side-effects for 1.18+ generation and had no measurable
performance improvement.
(layers.h)
- Renamed two OctaveNoise members of struct SurfaceNoiseBeta
- Added new struct SeaLevelColumnNoiseBeta
- Added headers for four new functions defined in layers.c
(layers.c)
- initSurfaceNoiseBeta(): Reflect changes to names in layers.h
- sampleBiomeNoiseBeta(): When nptype == 1, returned humidity value is now
multiplied by temperature to reflect the behavior seen in biome gen
- Added new function genColumnNoise():
Generates values used to calculate terrain noise columns and places
them in a SeaLevelColumnNoiseBeta struct pointed to by the provided
pointer.
- Added new function processColumnNoise():
Generates a partial noise column for finding the block at sea level
using data pointed to by the provided SeaLevelColumnNoiseBeta pointer
- Added new function sampleBlocks():
Using adjacent noise columns, determine whether the blocks at y=64 are
solid and place results in array pointed to by provided pointer
- Added new function sampleBetaBiomeOneBlock():
Generates new noise columns for each sampled block and skips the
diagonal traversal with cache buffer, as no noise columns data can be
re-used when scale >= 8.
- genBetaBiomeNoiseScaled():
Previous "no ocean" code is now locked behind (noOcean || scale >= 8)
condition. Calls sampleBiomeNoiseBeta() when noOcean is true, and calls
sampleBetaBiomeOneBlock() otherwise.
Else, the generated region is traversed in 4x4 block sections
corresponding to terrain noise columns. Columns are saved for re-use in
future passes in order to minimize unnecessary Perlin generation, and
region traversal is done in diagonal stripes in order to minimize extra
cache size needed (on average) for the saved noise sample buffer.
My original plan for the diagonal traversal was to store SeaLevelColumnNoise
*pointers* in the extra cache space, which would be dynamically allocated
when generated, but since extra cache space will only exceed the original
cache space when the generated area is so small that memory concerns are
trivial, this plan was abandoned in favor of storing the structs directly in
the cache. This approach also eliminates the risk of memory leaks.
Currently, with oceans, this code takes about 20 seconds to generate the
biomes for a 4096 x 4096 block region. Since this approach to ocean-finding
deals in 4x4 noise columns, scales 2-4 are still quite slow for the same
scaled region -- about 13 seconds at 1:4 scale. At higher scales, the
diagonal approach is abandoned and four new noise columns are generated for
every midpoint block that is sampled.
I made a quick test build of Cubiomes Viewer, and while the ocean-finding
code works, the regions are very slow to show up in the view window, and
changing the zoom level can cause regions to reset when zooming in both
directions. Perhaps some optimizations can be made in Cubiomes Viewer in
terms of handling cache and displaying generated biomes at different scales,
but I'm not familiar enough with that project to suggest anything specific.
I tried to cut out as much unnecessary processing as possible in my
implementation of the inherently cpu-intensive ocean-finding algorithm, but
it's certainly possible optimizations can be made in the generation code
itself.