Commit Graph

317 Commits

Author SHA1 Message Date
Cubitect
e61f90580c Renamed MC_1_21_2 to MC_1_21_3 2024-11-10 13:21:31 +01:00
Cubitect
c3bbbdf544 Added basic cmake file 2024-11-09 23:40:43 +01:00
Cubitect
9ec701d293
Merge pull request #119 from DuncanRuns/fix/undefined-overflow-behavior
Fix undefined wrapping behavior in rng.h (Zig compatibility)
2024-11-09 22:38:24 +00:00
Cubitect
89df24c3be Update spawn algorithm for 1.21.2 + cmake + more
* 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
2024-11-09 21:08:05 +01:00
Cubitect
6d1a190fe6 Tweaked pale parden color for better contrast (similar to chunkbase) 2024-10-14 21:49:56 +02:00
Cubitect
e49c8c561b Added Pale Garden biome and Small End Islands
* 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)
2024-10-07 13:20:00 +02:00
DuncanRuns
36e90bfd65 Remove pointless doubling of brackets
I did a little bit of idiot mode I guess
2024-06-13 18:15:57 -03:00
DuncanRuns
681906b983 Fix undefined overflow behavior 2024-06-13 12:21:19 -03:00
Cubitect
0af31b4e7e undo bad multiplication 2024-06-02 22:22:00 +02:00
Cubitect
d68faefd65 Support for 1.21 + trial chambers + end surface height
* 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
2024-06-02 22:12:34 +02:00
Cubitect
ae58fc4983 Made constellation lists zero terminated 2024-02-24 22:20:14 +01:00
Cubitect
1afa0325b6
Merge pull request #116 from Rabbit0w0/master
Support Visual Studio with older version of SDK
2024-02-01 21:58:42 +01:00
Cubitect
6b5e6fdb04 Fixed dimension flag for ruined portals 2024-02-01 21:56:10 +01:00
Cubitect
1163e4ec21 Smaller memory footprint of generator + small performance gain 2024-01-28 19:34:56 +01:00
CookedBunny
e8e5293e17 support old version of vs 2024-01-10 16:01:03 +00:00
CookedBunny
9546fa9e69 use manually defined pi value instead 2024-01-10 15:48:34 +00:00
Cubitect
c3ff21a1a8 Added biome proportion checker using the Monte Carlo method 2024-01-07 11:07:53 +01:00
Cubitect
6b36603d2d
Merge pull request #114 from AeroAstroid/shipwreck-region
Correct shipwreck spacing/separation in pre-1.16
2023-11-05 12:44:31 +01:00
Cubitect
8619ba07d7 Refactored color definitions 2023-11-05 12:41:54 +01:00
AeroAstroid
1098f0d11d Correct shipwreck spacing/separation in pre-1.16 2023-11-02 13:56:28 -03:00
Cubitect
31f1892230 Fixed faulty floor division causing incorrect structure check (#105) 2023-10-17 21:31:41 +02:00
Cubitect
58515533de Biome noise refactoring and fix for outposts
* 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
2023-10-16 22:26:37 +02:00
Cubitect
d55548952c Include stddef for NULL 2023-10-11 19:01:08 +02:00
Cubitect
34986d1e07
Merge pull request #101 from Camelpilot33/patch-1
Readme.md: Grammar and Spelling changes
2023-10-11 18:30:30 +02:00
Cubitect
c5f75369da
Merge pull request #107 from Rabbit0w0/master
Add build support for visual studio
2023-10-11 18:29:25 +02:00
Cubitect
df68a258d3 Fixed fortress generation finding incorrect end pieces (#103) 2023-10-11 18:27:10 +02:00
Rabbit
186c3111a8
Add build support for visual studio 2023-08-24 15:12:45 +08:00
Cubitect
4c8b36ea43 Update end city terrain check for 1.19+ 2023-06-29 23:17:29 +02:00
Cubitect
d278fafd12 Fixes for quad-base generation and parameter range finder
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
2023-06-29 21:17:28 +02:00
Cubitect
f81c2e4fde Added struct2str 2023-06-25 21:33:52 +02:00
Samuel Sastry
1fbfe049ef
Readme.md: Grammar and Spelling changes 2023-06-05 02:12:12 -07:00
Cubitect
f2c96306c7 support checking for igloos with basement 2023-05-21 14:48:07 +02:00
Cubitect
960d5d64b6 reduce undefined behaviour for builds without fwrapv 2023-05-20 15:57:06 +02:00
Cubitect
ea33a28a57 fixed strongholds for 1.6- + yield the position of the starting staircase 2023-05-19 22:01:00 +02:00
Cubitect
730b45d9b0 update secondary getSpawn pass for 1.18+ (#97) 2023-05-19 20:11:50 +02:00
Cubitect
5aa7e86bb6 wells, geodes and trails
1) added support for desert wells
2) added support for amethyst geodes
3) added support for trail ruins
4) temples can now generate rotated in 1.20
2023-05-19 13:25:54 +02:00
Cubitect
119f3e7d76 some fixes + 1.20 snapshot
* added 1.20 biome generation
* added nptree scripts to docu
* fixed stronghold biomes for pre-1.13 (#92)
* fixed wrong ID for non-generating biome in 1.9 - 1.10 (MC-98995)
* fixed incorrect buffer requirements for non-overworld voronoi
* slightly improved accuracy of scaled biomes for beta 1.7
* renamed enums for spline noise parameters (#95)
* removed redundant enum for 1.19.3 for now (use MC_1_19 instead)
2023-02-18 11:27:49 +01:00
Cubitect
1585006467
Merge pull request #94 from Nel-S/patch-1
Refactor findFittest as nested for loop
2023-02-17 18:45:23 +01:00
Nel-S
f19aafa88c
Refactor findFittest as nested for loop
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).
2023-02-15 18:59:14 -08:00
Cubitect
ddd19a14f6 Performance improvements to beta 1.7 biome gen. 2023-02-07 22:02:46 +01:00
Cubitect
b03c559c86 Fixed error in substitution of biomes ids 2023-02-05 19:49:49 +01:00
Cubitect
a666727069
Merge pull request #90 from KaiSandstrom/master
Beta 1.7 fixes and tweaks
2023-02-05 19:02:09 +01:00
Kai Sandstrom
e59c0d09e2 Beta 1.7 fixes and tweaks
(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.
2023-02-05 12:38:24 -05:00
Cubitect
c504c9aced Disable strogholds for beta 1.7 2023-02-05 17:47:16 +01:00
Cubitect
df2b40f3ac Make biomes finders work with beta 1.7 + fix getSpawn for <=1.0 2023-02-05 17:26:52 +01:00
Cubitect
01653265ff Remap biome IDs for beta 1.7 + color tweak 2023-02-05 01:27:43 +01:00
Cubitect
7496e316a0 Octave specific biome noise initialization + use new IDs for beta + removed VLA 2023-02-04 18:09:05 +01:00
Cubitect
19f13a9a22
Merge pull request #87 from KaiSandstrom/master
Add support for Alpha 1.2 - Beta 1.7 biome system
2023-02-04 14:14:50 +01:00
Kai Sandstrom
a42d97197c Added ocean detection for Beta 1.7
(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.
2023-02-01 19:00:03 -05:00
Cubitect
2e9cfee110
Merge pull request #89 from Nel-S/patch-2
Remove premature spawn return
2023-01-29 13:02:29 +01:00