mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v1.22.18
This commit is contained in:
parent
bf8d18937a
commit
e2e7f2e076
2 changed files with 3 additions and 3 deletions
4
main.js
4
main.js
|
|
@ -1139,13 +1139,13 @@ function rankCells() {
|
|||
cells.s = new Int16Array(cells.i.length); // cell suitability array
|
||||
cells.pop = new Float32Array(cells.i.length); // cell population array
|
||||
|
||||
const flMean = d3.median(cells.fl.filter(f => f)), flMax = d3.max(cells.fl) + d3.max(cells.conf); // to normalize flux
|
||||
const flMean = d3.median(cells.fl.filter(f => f)) || 0, flMax = d3.max(cells.fl) + d3.max(cells.conf); // to normalize flux
|
||||
const areaMean = d3.mean(cells.area); // to adjust population by cell area
|
||||
|
||||
for (const i of cells.i) {
|
||||
let s = +biomesData.habitability[cells.biome[i]]; // base suitability derived from biome habitability
|
||||
if (!s) continue; // uninhabitable biomes has 0 suitability
|
||||
s += normalize(cells.fl[i] + cells.conf[i], flMean, flMax) * 250; // big rivers and confluences are valued
|
||||
if (flMean) s += normalize(cells.fl[i] + cells.conf[i], flMean, flMax) * 250; // big rivers and confluences are valued
|
||||
s -= (cells.h[i] - 50) / 5; // low elevation is valued, high is not;
|
||||
|
||||
if (cells.t[i] === 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue