From 0bf8b568a92c3ea5f17f673e2bdc7e418de1f011 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 10 Apr 2021 21:03:23 +0300 Subject: [PATCH] more various climate --- index.html | 4 ++-- main.js | 18 +++++++++--------- modules/ui/layers.js | 4 ++-- modules/ui/options.js | 6 +++--- modules/ui/world-configurator.js | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index a971702d..8ff720a0 100644 --- a/index.html +++ b/index.html @@ -1433,7 +1433,7 @@ Equator: °C = °F - +
@@ -1442,7 +1442,7 @@ Poles: °C = °F - +
diff --git a/main.js b/main.js index 0872ee04..1f6da981 100644 --- a/main.js +++ b/main.js @@ -754,8 +754,8 @@ function defineMapSize() { function getSizeAndLatitude() { const template = document.getElementById("templateInput").value; // heightmap template const part = grid.features.some(f => f.land && f.border); // if land goes over map borders - const max = part ? 85 : 100; // max size - const lat = part ? gauss(P(.5) ? 30 : 70, 15, 20, 80) : gauss(50, 20, 15, 85); // latiture shift + const max = part ? 80 : 100; // max size + const lat = () => gauss(P(.5) ? 40 : 60, 15, 25, 75); // latiture shift if (!part) { if (template === "Pangea") return [100, 50]; @@ -766,14 +766,14 @@ function defineMapSize() { if (template === "Low Island" && P(.1)) return [100, 50]; } - if (template === "Pangea") return [gauss(75, 20, 30, max), lat]; - if (template === "Volcano") return [gauss(30, 20, 10, max), lat]; - if (template === "Mediterranean") return [gauss(30, 30, 15, 80), lat]; - if (template === "Peninsula") return [gauss(15, 15, 5, 80), lat]; - if (template === "Isthmus") return [gauss(20, 20, 3, 80), lat]; - if (template === "Atoll") return [gauss(10, 10, 2, max), lat]; + if (template === "Pangea") return [gauss(70, 20, 30, max), lat()]; + if (template === "Volcano") return [gauss(20, 20, 10, max), lat()]; + if (template === "Mediterranean") return [gauss(25, 30, 15, 80), lat()]; + if (template === "Peninsula") return [gauss(15, 15, 5, 80), lat()]; + if (template === "Isthmus") return [gauss(15, 20, 3, 80), lat()]; + if (template === "Atoll") return [gauss(5, 10, 2, max), lat()]; - return [gauss(40, 20, 15, max), lat]; // Continents, Archipelago, High Island, Low Island + return [gauss(30, 20, 15, max), lat()]; // Continents, Archipelago, High Island, Low Island } } diff --git a/modules/ui/layers.js b/modules/ui/layers.js index 295ba04e..a17e09df 100644 --- a/modules/ui/layers.js +++ b/modules/ui/layers.js @@ -484,8 +484,8 @@ function drawIce() { const used = new Uint8Array(cells.i.length); Math.random = aleaPRNG(seed); - const shieldMin = -6; // max temp to form ice shield (glacier) - const icebergMax = 2; // max temp to form an iceberg + const shieldMin = -8; // max temp to form ice shield (glacier) + const icebergMax = 1; // max temp to form an iceberg for (const i of grid.cells.i) { const t = temp[i]; diff --git a/modules/ui/options.js b/modules/ui/options.js index 90767921..8d6df677 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -459,9 +459,9 @@ function randomizeOptions() { // 'Configure World' settings 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); + const tMax = 30, tMin = -30; // temperature extremes + if (randomize || !locked("temperatureEquator")) temperatureEquatorOutput.value = temperatureEquatorInput.value = rand(tMax - 10, tMax); + if (randomize || !locked("temperaturePole")) temperaturePoleOutput.value = temperaturePoleInput.value = rand(tMin, tMin + 30); // 'Units Editor' settings const US = navigator.language === "en-US"; diff --git a/modules/ui/world-configurator.js b/modules/ui/world-configurator.js index 8e7f255d..8cbd6a20 100644 --- a/modules/ui/world-configurator.js +++ b/modules/ui/world-configurator.js @@ -19,7 +19,7 @@ function editWorld() { const globe = d3.select("#globe"); const clr = d3.scaleSequential(d3.interpolateSpectral); - const tMax = +temperatureEquatorOutput.max, tMin = +temperatureEquatorOutput.min; // temperature extremes + const tMax = 30, tMin = -25; // temperature extremes const projection = d3.geoOrthographic().translate([100, 100]).scale(100); const path = d3.geoPath(projection);