mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
more various climate
This commit is contained in:
parent
6fd8862d7a
commit
0bf8b568a9
5 changed files with 17 additions and 17 deletions
|
|
@ -1433,7 +1433,7 @@
|
||||||
<i>Equator:</i>
|
<i>Equator:</i>
|
||||||
<input id="temperatureEquatorInput" data-stored="temperatureEquator" type="number" min="-50" max="50">°C =
|
<input id="temperatureEquatorInput" data-stored="temperatureEquator" type="number" min="-50" max="50">°C =
|
||||||
<span id="temperatureEquatorF"></span>°F
|
<span id="temperatureEquatorF"></span>°F
|
||||||
<input id="temperatureEquatorOutput" data-stored="temperatureEquator" type="range" min="-30" max="30"/>
|
<input id="temperatureEquatorOutput" data-stored="temperatureEquator" type="range" min="-50" max="50"/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -1442,7 +1442,7 @@
|
||||||
<i>Poles:</i>
|
<i>Poles:</i>
|
||||||
<input id="temperaturePoleInput" data-stored="temperaturePole" type="number" min="-50" max="50">°C =
|
<input id="temperaturePoleInput" data-stored="temperaturePole" type="number" min="-50" max="50">°C =
|
||||||
<span id="temperaturePoleF"></span>°F
|
<span id="temperaturePoleF"></span>°F
|
||||||
<input id="temperaturePoleOutput" data-stored="temperaturePole" type="range" min="-30" max="30"/>
|
<input id="temperaturePoleOutput" data-stored="temperaturePole" type="range" min="-50" max="50"/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
18
main.js
18
main.js
|
|
@ -754,8 +754,8 @@ function defineMapSize() {
|
||||||
function getSizeAndLatitude() {
|
function getSizeAndLatitude() {
|
||||||
const template = document.getElementById("templateInput").value; // heightmap template
|
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 part = grid.features.some(f => f.land && f.border); // if land goes over map borders
|
||||||
const max = part ? 85 : 100; // max size
|
const max = part ? 80 : 100; // max size
|
||||||
const lat = part ? gauss(P(.5) ? 30 : 70, 15, 20, 80) : gauss(50, 20, 15, 85); // latiture shift
|
const lat = () => gauss(P(.5) ? 40 : 60, 15, 25, 75); // latiture shift
|
||||||
|
|
||||||
if (!part) {
|
if (!part) {
|
||||||
if (template === "Pangea") return [100, 50];
|
if (template === "Pangea") return [100, 50];
|
||||||
|
|
@ -766,14 +766,14 @@ function defineMapSize() {
|
||||||
if (template === "Low Island" && P(.1)) return [100, 50];
|
if (template === "Low Island" && P(.1)) return [100, 50];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (template === "Pangea") return [gauss(75, 20, 30, max), lat];
|
if (template === "Pangea") return [gauss(70, 20, 30, max), lat()];
|
||||||
if (template === "Volcano") return [gauss(30, 20, 10, max), lat];
|
if (template === "Volcano") return [gauss(20, 20, 10, max), lat()];
|
||||||
if (template === "Mediterranean") return [gauss(30, 30, 15, 80), lat];
|
if (template === "Mediterranean") return [gauss(25, 30, 15, 80), lat()];
|
||||||
if (template === "Peninsula") return [gauss(15, 15, 5, 80), lat];
|
if (template === "Peninsula") return [gauss(15, 15, 5, 80), lat()];
|
||||||
if (template === "Isthmus") return [gauss(20, 20, 3, 80), lat];
|
if (template === "Isthmus") return [gauss(15, 20, 3, 80), lat()];
|
||||||
if (template === "Atoll") return [gauss(10, 10, 2, max), 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -484,8 +484,8 @@ function drawIce() {
|
||||||
const used = new Uint8Array(cells.i.length);
|
const used = new Uint8Array(cells.i.length);
|
||||||
Math.random = aleaPRNG(seed);
|
Math.random = aleaPRNG(seed);
|
||||||
|
|
||||||
const shieldMin = -6; // max temp to form ice shield (glacier)
|
const shieldMin = -8; // max temp to form ice shield (glacier)
|
||||||
const icebergMax = 2; // max temp to form an iceberg
|
const icebergMax = 1; // max temp to form an iceberg
|
||||||
|
|
||||||
for (const i of grid.cells.i) {
|
for (const i of grid.cells.i) {
|
||||||
const t = temp[i];
|
const t = temp[i];
|
||||||
|
|
|
||||||
|
|
@ -459,9 +459,9 @@ function randomizeOptions() {
|
||||||
|
|
||||||
// 'Configure World' settings
|
// 'Configure World' settings
|
||||||
if (randomize || !locked("prec")) precInput.value = precOutput.value = gauss(100, 40, 5, 500);
|
if (randomize || !locked("prec")) precInput.value = precOutput.value = gauss(100, 40, 5, 500);
|
||||||
const tMax = +temperatureEquatorOutput.max, tMin = +temperatureEquatorOutput.min; // temperature extremes
|
const tMax = 30, tMin = -30; // temperature extremes
|
||||||
if (randomize || !locked("temperatureEquator")) temperatureEquatorOutput.value = temperatureEquatorInput.value = rand(tMax-6, tMax);
|
if (randomize || !locked("temperatureEquator")) temperatureEquatorOutput.value = temperatureEquatorInput.value = rand(tMax - 10, tMax);
|
||||||
if (randomize || !locked("temperaturePole")) temperaturePoleOutput.value = temperaturePoleInput.value = rand(tMin, tMin+10);
|
if (randomize || !locked("temperaturePole")) temperaturePoleOutput.value = temperaturePoleInput.value = rand(tMin, tMin + 30);
|
||||||
|
|
||||||
// 'Units Editor' settings
|
// 'Units Editor' settings
|
||||||
const US = navigator.language === "en-US";
|
const US = navigator.language === "en-US";
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ function editWorld() {
|
||||||
|
|
||||||
const globe = d3.select("#globe");
|
const globe = d3.select("#globe");
|
||||||
const clr = d3.scaleSequential(d3.interpolateSpectral);
|
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 projection = d3.geoOrthographic().translate([100, 100]).scale(100);
|
||||||
const path = d3.geoPath(projection);
|
const path = d3.geoPath(projection);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue