180 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
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
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
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
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
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
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
df68a258d3 Fixed fortress generation finding incorrect end pieces (#103) 2023-10-11 18:27:10 +02: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
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
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
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
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
Nel-S
773f647f43
Remove premature spawn return
After estimating the approximate spawn position, Cubiomes currently centers the position in the middle of the corresponding chunk and then (I'm guessing erroneously) returns the position immediately, completely skipping all of the code fine-tuning the position to the most likely block afterwards. As a result, every single spawnpoint calculated by Cubiomes (and consequently Cubiomes Viewer) is in the middle of a chunk, leading to problems such as origin spawns always returning as (8, 8) instead of (0, 0), and so on.
2023-01-28 22:10:37 -08:00
Kai Sandstrom
08b55ff7b1 Added Beta climate biome generation (no ocean gen yet)
(biome_tree.c)
- getOldBetaBiome: removed isWater argument.

(finders.c)
- getStructureConfig: now returns 0 for mineshafts and villages before B1.8.

(layers.h)
- Added SurfaceNoiseBeta struct:
      Very similar to SurfaceNoise.
      Since SurfaceNoiseBeta will only ever be used for the Overworld, the
          double values saved in SurfaceNoise will be hardcoded into the
          SurfaceNoiseBeta sampling function.
      octSurf and octDepth in surfaceNoise are replaced with new octA and octB
          OctaveNoises, used for precise terrain generation. These names are
          subject to change if I come up with more meaningful names in the
          future.
      The oct array contains six additional PerlinNoise structs compared to
          SurfaceNoise, as the 4-octave octSurf is replaced with the 10-octave
          octA.
- Added BiomeNoiseBeta struct:
      Mostly a cut-down version of BiomeNoise.
      The climate array contains three OctaveNoise structs, corresponding to
          the 4-octave temperature and humidity noise generators, as well as
          an additional 2-octave generator that I'm calling "fuzz". The fuzz
          noise is high-frequency and low-amplitude, and is used as a factor
          applied to the raw output of both the temperature and humidity
          generators before these values are used.
      The PerlinNoise array oct contains 10 octaves -- 4 for temperature, 4 for
          humidity, and 2 for fuzz.
      nptype and mc are carried over from BiomeNoise. mc currently has no
          purpose, but I've heard of a bug in some early beta versions causing
          chunk biomes to generate rotated, so storing the version may
          eventually prove useful.
- Added headers for 5 new functions in layers.c.
- Changed header for getOldBetaBiome (defined in biome_tree.c) to reflect new
      signature.

(layers.c)
- Added initSurfaceNoiseBeta function: No-op placeholder for now.
- Added setBetaBiomeSeed function: Initializes the three climate simplex noise
      generators and sets bnb->nptype to -1 by default.
- Added sampleBiomeNoiseBeta function:
      sampleBiomeNoiseBeta samples climate noise at the given x and z
          coordinates (1:1 scale) and returns a biome ID corresponding to the
          biome at the generated temperature and humidity noise values.
      The behavior of zeroing out the array np when it is passed is copied
          from sampleBiomeNoise. I'm not sure about its function, so if it's
          not applicable, this argument and associated behavior can be removed.
      If bnb->nptype is set to NP_TEMPERATURE or NP_HUMIDITY, only that noise
          value is generated and the other is ignored. The noise value is
          multiplied by 10000 and returned as a signed long to match the
          behavior of sampleBiomeNoise. Note that Beta climate values range from
          0 to 1, not -1 to 1, so the resulting ints will all be nonnegative.
      The argument nv (noise values) is a pointer to a 2-element array of
          doubles. If it is present, the noise values are placed in the array
          before the biome is determined.
- Added genBetaBiomeNoiseScaled function:
      At 1:1 scale, every block in Range r is sampled and the return value of
          sampleBiomeNoiseBeta is placed in the cache.
      At higher scales, midpoints are sampled.
      When ocean support is added, this function will likely behave
          differently when NO_BETA_OCEAN is clear in order to maximize time
          and memory efficiency.

(generator.h)
- Flags enum: Bit 1 (0x2) is now the NO_BETA_OCEAN flag.
- Generator struct: New union member for pre-B1.8: Includes BiomeNoiseBeta
      and SurfaceNoiseBeta structs now defined in layers.h

(generator.c)
- setupGenearator:
      New version so pre-B1.8 versions behave correctly.
      For mc <= MC_B1_7, setupGenerator simply sets g->bnb.mc, as all other
          setup for pre-B1.8 biome generation requires the seed to be known.
- applySeed:
      When mc <= MC_B1_7, the new setBetaBiomeSeed function defined in layers.c
          is called. If the NO_BETA_OCEAN flag is not set, initSurfaceNoiseBeta
          is also called. initSurfaceNoiseBeta is currently just a no-op
          placeholder.
- getMinCacheSize:
      New version check.
      Returns default size when mc <= MC_B1_7. Will likely be modified when
      ocean-finding functionality is added.
- genBiomes: Calls genBetaBiomeNoiseScaled when mc <= MC_B1_7

Note: Compiling libcubiomes.a will will currently cause several warnings due to
unused parameters related to not-yet-implemented ocean finding.
2023-01-23 16:51:54 -05:00
Cubitect
bdec4f5ce8 1.19.2 vs 1.19.3
1) add support for 1.19.2 along side 1.19.3
2) get approx stronghold positions in 1.19.3 without biome check
2023-01-22 14:01:56 +01:00
Cubitect
03895e6c22 Refactored some of the MC version checks paving the way for distinct minor versions. 2023-01-16 20:47:12 +01:00
Cubitect
42924426d0
Merge pull request #86 from KaiSandstrom/master
Support Beta 1.8 (Closes #67)
2023-01-16 20:27:56 +01:00
Cubitect
15434e622d Treat approximate surface height as float and include shift for slightly better accuracy 2023-01-15 19:44:14 +01:00
KaiSandstrom
c9fc194cde
Merge branch 'Cubitect:master' into master 2023-01-15 11:30:53 -05:00
Cubitect
231ee62abe Performance improvements and separate climate min/max finders 2023-01-15 14:01:57 +01:00
Kai Sandstrom
720fa2d3fb getStructureConfig now returns 0 for Fortress when MC is Beta 1.8 2023-01-09 12:00:35 -05:00
Cubitect
859c039392 Update stronghold positions for 1.19.3 2023-01-05 16:07:23 +01:00
Cubitect
47b45a33f2 Updated 1.19 biome generation to 1.19.3 2023-01-05 11:02:02 +01:00
Cubitect
a7df5c6916 Approxmate surface height + improved accuracy of getSpawn 2022-12-30 13:20:29 +01:00
Cubitect
da965eed28 Fixing 1.14 and 1.15 outposts 2022-11-14 20:29:37 +01:00
Cubitect
10e297d17d Fixed some biome checks and added 1:256 biome locator
* fixed biomeExists() for 1.19 end dimension
* fixed biome check position for village and bastion in 1.18+
* added support for 1:256 scale of biome locator in 1.17-
2022-11-13 15:43:24 +01:00
Cubitect
0bf8cb0cce Fixed uninitialized state for biome center finder 2022-10-03 13:32:09 +02:00
Cubitect
90bfe9a904 avoid overflow on small area limit 2022-10-01 20:37:15 +02:00
Cubitect
d3112ca416 avoid recursion floodfill exceeding stack limit (crashes on windows) 2022-10-01 19:39:40 +02:00
Cubitect
2dbece7363 Added biome center finder 2022-10-01 15:14:37 +02:00
Cubitect
6f2ef55b73 Fixes, performance improvements and changes
1) fixed inaccuracy in village bounding boxes (1.18+)
2) fixed 2 block voronoi offset for end dimension
3) made monument biome check significantly faster (1.18+)
4) removed structure configurations from global scope
5) renamed biome filter flags
2022-09-25 22:35:40 +02:00
Cubitect
99a2e1718e fixed variable name 2022-09-12 21:34:12 +02:00
Cubitect
d4afdbf19e Fixed nether portal variants for 1.17- + support arbitrary end biome scales 2022-09-12 21:12:49 +02:00
Cubitect
8b87d9379a Added fortress piece generator + fixed inverted terrain viability check 2022-09-11 12:30:05 +02:00
Cubitect
ff13e171c8 Fixed end city pieces generation 2022-09-05 20:46:24 +02:00
Cubitect
b9d374445b Structure variants and fixes
expanded support for structure variants
added end city pieces generation (WIP)
added outer end voids (MC-159283)
fixed several issues with the availablity of biomes for layered generation
fixed that about half of 1.18/1.19 end gateways have wrong positions
2022-09-04 22:40:19 +02:00
Cubitect
469f4d144b Do special sampling for layered biome exclusions 2022-08-21 10:59:24 +02:00