mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
feat: move biomes code to a separate module, reduce deserts amount
This commit is contained in:
parent
71cc739b4d
commit
1bb90251cd
9 changed files with 185 additions and 135 deletions
|
|
@ -239,7 +239,7 @@ function editHeightmap(options) {
|
|||
|
||||
drawRivers();
|
||||
Lakes.defineGroup();
|
||||
defineBiomes();
|
||||
Biomes.define();
|
||||
rankCells();
|
||||
|
||||
Cultures.generate();
|
||||
|
|
@ -373,10 +373,6 @@ function editHeightmap(options) {
|
|||
const g = pack.cells.g[i];
|
||||
const isLand = pack.cells.h[i] >= 20;
|
||||
|
||||
// check biome
|
||||
pack.cells.biome[i] =
|
||||
isLand && biome[g] ? biome[g] : getBiomeId(grid.cells.prec[g], grid.cells.temp[g], pack.cells.h[i]);
|
||||
|
||||
// rivers data
|
||||
if (!erosionAllowed) {
|
||||
pack.cells.r[i] = r[g];
|
||||
|
|
@ -384,6 +380,12 @@ function editHeightmap(options) {
|
|||
pack.cells.fl[i] = fl[g];
|
||||
}
|
||||
|
||||
// check biome
|
||||
pack.cells.biome[i] =
|
||||
isLand && biome[g]
|
||||
? biome[g]
|
||||
: Biomes.getId(grid.cells.prec[g], grid.cells.temp[g], pack.cells.h[i], Boolean(pack.cells.r[i]));
|
||||
|
||||
if (!isLand) continue;
|
||||
pack.cells.culture[i] = culture[g];
|
||||
pack.cells.pop[i] = pop[g];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue