18 #include "../Noise/Noise.h"
19 #include "../VoronoiMap.h"
100 cBioGenMulticache(std::unique_ptr<cBiomeGen> a_BioGenToCache,
size_t a_SubCacheSize,
size_t a_NumSubCaches);
108 std::vector<std::unique_ptr<cBioGenCache>>
m_Caches;
217 void Distort(
int a_BlockX,
int a_BlockZ,
int & a_DistortedX,
int & a_DistortedZ);
269 void Distort(
int a_BlockX,
int a_BlockZ,
int & a_DistortedX,
int & a_DistortedZ,
int a_CellSize);
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
Wraps the chunk coords into a single structure.
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
virtual void InitializeBiomeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates biomes for the given chunk.
A simple cache that stores N most recently generated chunks' biomes; N being settable upon creation.
std::vector< size_t > m_CacheOrder
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates biomes for the given chunk.
virtual void InitializeBiomeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
std::vector< sCacheData > m_CacheData
cBiomeGen & m_BioGenToCache
cBioGenCache(cBiomeGen &a_BioGenToCache, size_t a_CacheSize)
cChunkDef::BiomeMap m_BiomeMap
sCacheData()
Default constructor: Fill in bogus coords so that the item is not used in the cache until properly ca...
std::vector< std::unique_ptr< cBioGenCache > > m_Caches
Individual sub-caches.
std::unique_ptr< cBiomeGen > m_Underlying
The underlying biome generator.
size_t m_NumSubCaches
Number of sub-caches.
cBioGenMulticache(std::unique_ptr< cBiomeGen > a_BioGenToCache, size_t a_SubCacheSize, size_t a_NumSubCaches)
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates biomes for the given chunk.
virtual void InitializeBiomeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
Base class for generators that use a list of available biomes.
std::vector< EMCSBiome > EMCSBiomes
void InitializeBiomes(const AString &a_Biomes)
Parses the INI file setting string into m_Biomes.
virtual void InitializeBiomeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates biomes for the given chunk.
cBioGenVoronoi(int a_Seed)
virtual void InitializeBiomeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates biomes for the given chunk.
EMCSBiome VoronoiBiome(int a_BlockX, int a_BlockZ)
virtual void InitializeBiomeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
void Distort(int a_BlockX, int a_BlockZ, int &a_DistortedX, int &a_DistortedZ)
Distorts the coords using a Perlin-like noise.
cVoronoiMap m_Voronoi
The underlying Voronoi map of the biomes.
cBioGenDistortedVoronoi(int a_Seed)
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates biomes for the given chunk.
int m_CellSize
Size of the Voronoi cells, also used for distortion amplitude.
cNoise m_Noise
Noise used for the distortion.
void BuildTemperatureHumidityMaps(cChunkCoords a_ChunkCoords, IntMap &a_TemperatureMap, IntMap &a_HumidityMap)
Builds two Perlin-noise maps, one for temperature, the other for humidity.
void DecideOceanLandMushroom(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)
Step 1: Decides between ocean, land and mushroom, using a DistVoronoi with special conditions and pos...
cBioGenMultiStepMap(int a_Seed)
void Distort(int a_BlockX, int a_BlockZ, int &a_DistortedX, int &a_DistortedZ, int a_CellSize)
Distorts the coords using a Perlin-like noise, with a specified cell-size.
double m_RiverWidthThreshold
virtual void InitializeBiomeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
void FreezeWaterBiomes(cChunkDef::BiomeMap &a_BiomeMap, const IntMap &a_TemperatureMap)
Flips biOcean and biRiver into biFrozenOcean and biFrozenRiver if the temperature is too low.
void DecideLandBiomes(cChunkDef::BiomeMap &a_BiomeMap, const IntMap &a_TemperatureMap, const IntMap &a_HumidityMap)
Flips all remaining "-1" biomes into land biomes using the two maps.
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates biomes for the given chunk.
void AddRivers(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)
Step 2: Add rivers to the land Flips some "-1" biomes into biRiver.
void ApplyTemperatureHumidity(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)
Step 3: Decide land biomes using a temperature / humidity map; freeze ocean / river in low temperatur...
cBioGenTwoLevel(int a_Seed)
cVoronoiMap m_VoronoiSmall
The Voronoi map that decides biomes inside individual biome groups.
EMCSBiome SelectBiome(int a_BiomeGroup, size_t a_BiomeIdx, int a_DistLevel)
Selects biome from the specified biome group, based on the specified index.
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates biomes for the given chunk.
cVoronoiMap m_VoronoiLarge
The Voronoi map that decides the groups of biomes.
virtual void InitializeBiomeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
The interface that a biome generator must implement A biome generator takes chunk coords on input and...