v1.5.76 - major river-lake redesign

This commit is contained in:
Azgaar 2021-02-28 13:32:04 +03:00
parent 8563aaf50d
commit 07f0eff52c
7 changed files with 227 additions and 194 deletions

View file

@ -238,12 +238,7 @@ function toDMS(coord, c) {
function getElevation(f, h) {
if (f.land) return getHeight(h) + " (" + h + ")"; // land: usual height
if (f.border) return "0 " + heightUnit.value; // ocean: 0
// lake: lowest coast height - 1
const lakeCells = Array.from(pack.cells.i.filter(i => pack.cells.f[i] === f.i));
const heights = lakeCells.map(i => pack.cells.c[i].map(c => pack.cells.h[c])).flat().filter(h => h > 19);
const elevation = (d3.min(heights)||20) - 1;
return getHeight(elevation) + " (" + elevation + ")";
if (f.type === "lake") return getHeight(f.height) + " (" + f.height + ")"; // lake: defined on river generation
}
// get water depth

View file

@ -185,6 +185,7 @@ function editHeightmap() {
}
}
defineLakesGroup();
defineBiomes();
rankCells();
Cultures.generate();

View file

@ -434,7 +434,7 @@ function randomizeOptions() {
if (randomize || !locked("culturesSet")) randomizeCultureSet();
// 'Configure World' settings
if (randomize || !locked("prec")) precInput.value = precOutput.value = gauss(120, 20, 5, 500);
if (randomize || !locked("prec")) precInput.value = precOutput.value = gauss(100, 40, 5, 500);
const tMax = +temperatureEquatorOutput.max, tMin = +temperatureEquatorOutput.min; // temperature extremes
if (randomize || !locked("temperatureEquator")) temperatureEquatorOutput.value = temperatureEquatorInput.value = rand(tMax-6, tMax);
if (randomize || !locked("temperaturePole")) temperaturePoleOutput.value = temperaturePoleInput.value = rand(tMin, tMin+10);

View file

@ -95,6 +95,7 @@ async function openEmblemEditor() {
function regenerateRivers() {
Rivers.generate();
defineLakesGroup();
Rivers.specify();
if (!layerIsOn("toggleRivers")) toggleRivers();
}

View file

@ -47,6 +47,7 @@ function editWorld() {
generatePrecipitation();
const heights = new Uint8Array(pack.cells.h);
Rivers.generate();
defineLakesGroup();
Rivers.specify();
pack.cells.h = new Float32Array(heights);
defineBiomes();