mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
Merge branch 'master' of https://github.com/Azgaar/Fantasy-Map-Generator into burg-groups
This commit is contained in:
commit
4472ead06b
5 changed files with 96 additions and 70 deletions
23
index.html
23
index.html
|
|
@ -140,7 +140,12 @@
|
||||||
|
|
||||||
<link rel="preload" href="index.css?v=1.106.3" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
<link rel="preload" href="index.css?v=1.106.3" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
||||||
<link rel="preload" href="icons.css" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
<link rel="preload" href="icons.css" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
||||||
<link rel="preload" href="libs/jquery-ui.css" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
<link
|
||||||
|
rel="preload"
|
||||||
|
href="libs/jquery-ui.css?v=1.106.5"
|
||||||
|
as="style"
|
||||||
|
onload="this.onload=null; this.rel='stylesheet'"
|
||||||
|
/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<svg
|
<svg
|
||||||
|
|
@ -3404,16 +3409,20 @@
|
||||||
<input id="burgPopulation" type="number" min="0" step="1" style="width: 9em" />
|
<input id="burgPopulation" type="number" min="0" step="1" style="width: 9em" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-tip="Burg mean annual temperature and real-world city for comparison">
|
<div data-tip="Burg average yearly temperature" style="display: flex; justify-content: space-between">
|
||||||
|
<div>
|
||||||
<div class="label">Temperature:</div>
|
<div class="label">Temperature:</div>
|
||||||
<span id="burgTemperature"></span>, like in
|
<span id="burgTemperature"></span>
|
||||||
<span id="burgTemperatureLikeIn"></span>
|
</div>
|
||||||
|
<div style="display: flex; gap: 0.5em">
|
||||||
|
<i class="icon-info-circled" id="burgTemperatureLikeIn"></i>
|
||||||
<i
|
<i
|
||||||
id="burgTemperatureGraph"
|
id="burgTemperatureGraph"
|
||||||
data-tip="Show temperature graph for the burg"
|
data-tip="Show temperature graph for the burg"
|
||||||
class="icon-chart-area pointer"
|
class="icon-chart-area pointer"
|
||||||
></i>
|
></i>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div data-tip="Burg height above mean sea level">
|
<div data-tip="Burg height above mean sea level">
|
||||||
<div class="label">Elevation:</div>
|
<div class="label">Elevation:</div>
|
||||||
|
|
@ -8103,7 +8112,7 @@
|
||||||
<script src="modules/heightmap-generator.js?v=1.99.00"></script>
|
<script src="modules/heightmap-generator.js?v=1.99.00"></script>
|
||||||
<script src="modules/features.js?v=1.104.0"></script>
|
<script src="modules/features.js?v=1.104.0"></script>
|
||||||
<script src="modules/ocean-layers.js?v=1.104.8"></script>
|
<script src="modules/ocean-layers.js?v=1.104.8"></script>
|
||||||
<script src="modules/river-generator.js?v=1.106.0"></script>
|
<script src="modules/river-generator.js?v=1.106.7"></script>
|
||||||
<script src="modules/lakes.js?v=1.99.00"></script>
|
<script src="modules/lakes.js?v=1.99.00"></script>
|
||||||
<script src="modules/biomes.js?v=1.99.00"></script>
|
<script src="modules/biomes.js?v=1.99.00"></script>
|
||||||
<script src="modules/names-generator.js?v=1.106.0"></script>
|
<script src="modules/names-generator.js?v=1.106.0"></script>
|
||||||
|
|
@ -8140,7 +8149,7 @@
|
||||||
<script defer src="modules/ui/biomes-editor.js?v=1.99.05"></script>
|
<script defer src="modules/ui/biomes-editor.js?v=1.99.05"></script>
|
||||||
<script defer src="modules/ui/namesbase-editor.js?v=1.105.11"></script>
|
<script defer src="modules/ui/namesbase-editor.js?v=1.105.11"></script>
|
||||||
<script defer src="modules/ui/elevation-profile.js?v=1.99.00"></script>
|
<script defer src="modules/ui/elevation-profile.js?v=1.99.00"></script>
|
||||||
<script defer src="modules/ui/temperature-graph.js?v=1.99.00"></script>
|
<script defer src="modules/ui/temperature-graph.js?v=1.106.6"></script>
|
||||||
<script defer src="modules/ui/routes-editor.js?v=1.104.3"></script>
|
<script defer src="modules/ui/routes-editor.js?v=1.104.3"></script>
|
||||||
<script defer src="modules/ui/routes-creator.js?v=1.104.3"></script>
|
<script defer src="modules/ui/routes-creator.js?v=1.104.3"></script>
|
||||||
<script defer src="modules/ui/route-group-editor.js?v=1.103.8"></script>
|
<script defer src="modules/ui/route-group-editor.js?v=1.103.8"></script>
|
||||||
|
|
@ -8151,8 +8160,8 @@
|
||||||
<script defer src="modules/ui/rivers-editor.js?v=1.106.0"></script>
|
<script defer src="modules/ui/rivers-editor.js?v=1.106.0"></script>
|
||||||
<script defer src="modules/ui/rivers-creator.js?v=1.106.0"></script>
|
<script defer src="modules/ui/rivers-creator.js?v=1.106.0"></script>
|
||||||
<script defer src="modules/ui/relief-editor.js?v=1.99.00"></script>
|
<script defer src="modules/ui/relief-editor.js?v=1.99.00"></script>
|
||||||
<script defer src="modules/ui/burg-editor.js?v=1.102.00"></script>
|
|
||||||
<script defer src="modules/ui/burg-group-editor.js?v=1.106.0"></script>
|
<script defer src="modules/ui/burg-group-editor.js?v=1.106.0"></script>
|
||||||
|
<script defer src="modules/ui/burg-editor.js?v=1.106.6"></script>
|
||||||
<script defer src="modules/ui/units-editor.js?v=1.104.0"></script>
|
<script defer src="modules/ui/units-editor.js?v=1.104.0"></script>
|
||||||
<script defer src="modules/ui/notes-editor.js?v=1.99.06"></script>
|
<script defer src="modules/ui/notes-editor.js?v=1.99.06"></script>
|
||||||
<script defer src="modules/ui/ai-generator.js?v=1.105.22"></script>
|
<script defer src="modules/ui/ai-generator.js?v=1.105.22"></script>
|
||||||
|
|
|
||||||
32
libs/jquery-ui.css
vendored
32
libs/jquery-ui.css
vendored
|
|
@ -314,30 +314,44 @@ body .ui-dialog {
|
||||||
}
|
}
|
||||||
.ui-dialog .ui-dialog-titlebar {
|
.ui-dialog .ui-dialog-titlebar {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0.4em 0.3em;
|
padding: 0.3em 0.8em;
|
||||||
justify-content: space-evenly;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
min-width: 150px;
|
min-width: 150px;
|
||||||
}
|
}
|
||||||
.ui-dialog .ui-dialog-title {
|
.ui-dialog .ui-dialog-title {
|
||||||
float: left;
|
|
||||||
margin: 0.1em 0;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
width: 90%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-dialog .ui-dialog-titlebar button {
|
.ui-dialog .ui-dialog-titlebar button {
|
||||||
padding: 0;
|
padding: 3px;
|
||||||
width: 1.8em;
|
margin-left: 5px;
|
||||||
height: 1.8em;
|
width: 19px;
|
||||||
|
height: 18px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
background: none;
|
background: none;
|
||||||
font-size: 0.75em;
|
font-size: 0.8em;
|
||||||
border: 1px solid #c5c5c5;
|
border: 1px solid #c5c5c5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
.ui-dialog .ui-dialog-title {
|
||||||
|
font-size: 1.6em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-dialog .ui-dialog-titlebar button {
|
||||||
|
padding: 3px;
|
||||||
|
margin-left: 10px;
|
||||||
|
width: 40px;
|
||||||
|
height: 32px;
|
||||||
|
font-size: 1.6em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.ui-dialog .ui-dialog-titlebar button:active {
|
.ui-dialog .ui-dialog-titlebar button:active {
|
||||||
border: 1px solid #5d4651;
|
border: 1px solid #5d4651;
|
||||||
color: #5d4651;
|
color: #5d4651;
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ window.Rivers = (function () {
|
||||||
flux: discharge,
|
flux: discharge,
|
||||||
pointIndex: meanderedPoints.length,
|
pointIndex: meanderedPoints.length,
|
||||||
widthFactor,
|
widthFactor,
|
||||||
sourceWidth
|
startingWidth: sourceWidth
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -387,13 +387,12 @@ window.Rivers = (function () {
|
||||||
const LENGTH_FACTOR = 200;
|
const LENGTH_FACTOR = 200;
|
||||||
const LENGTH_STEP_WIDTH = 1 / LENGTH_FACTOR;
|
const LENGTH_STEP_WIDTH = 1 / LENGTH_FACTOR;
|
||||||
const LENGTH_PROGRESSION = [1, 1, 2, 3, 5, 8, 13, 21, 34].map(n => n / LENGTH_FACTOR);
|
const LENGTH_PROGRESSION = [1, 1, 2, 3, 5, 8, 13, 21, 34].map(n => n / LENGTH_FACTOR);
|
||||||
const MAX_PROGRESSION = last(LENGTH_PROGRESSION);
|
|
||||||
|
|
||||||
const getOffset = ({flux, pointIndex, widthFactor, startingWidth}) => {
|
const getOffset = ({flux, pointIndex, widthFactor, startingWidth}) => {
|
||||||
if (pointIndex === 0) return startingWidth;
|
if (pointIndex === 0) return startingWidth;
|
||||||
|
|
||||||
const fluxWidth = Math.min(flux ** 0.7 / FLUX_FACTOR, MAX_FLUX_WIDTH);
|
const fluxWidth = Math.min(flux ** 0.7 / FLUX_FACTOR, MAX_FLUX_WIDTH);
|
||||||
const lengthWidth = pointIndex * LENGTH_STEP_WIDTH + (LENGTH_PROGRESSION[pointIndex] || MAX_PROGRESSION);
|
const lengthWidth = pointIndex * LENGTH_STEP_WIDTH + (LENGTH_PROGRESSION[pointIndex] || LENGTH_PROGRESSION.at(-1));
|
||||||
return widthFactor * (lengthWidth + fluxWidth) + startingWidth;
|
return widthFactor * (lengthWidth + fluxWidth) + startingWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,8 @@ function editBurg(id) {
|
||||||
|
|
||||||
const temperature = grid.cells.temp[pack.cells.g[b.cell]];
|
const temperature = grid.cells.temp[pack.cells.g[b.cell]];
|
||||||
byId("burgTemperature").innerHTML = convertTemperature(temperature);
|
byId("burgTemperature").innerHTML = convertTemperature(temperature);
|
||||||
byId("burgTemperatureLikeIn").innerHTML = getTemperatureLikeness(temperature);
|
byId("burgTemperatureLikeIn").dataset.tip =
|
||||||
|
"Average yearly temperature is like in " + getTemperatureLikeness(temperature);
|
||||||
byId("burgElevation").innerHTML = getHeight(pack.cells.h[b.cell]);
|
byId("burgElevation").innerHTML = getHeight(pack.cells.h[b.cell]);
|
||||||
|
|
||||||
// toggle features
|
// toggle features
|
||||||
|
|
@ -402,46 +403,47 @@ function editBurg(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// in °C, array from -1 °C; source: https://en.wikipedia.org/wiki/List_of_cities_by_average_temperature
|
// in °C, array from -1 °C; source: https://en.wikipedia.org/wiki/List_of_cities_by_average_temperature
|
||||||
|
const meanTempCityMap = {
|
||||||
|
"-5": "Snag (Yukon)",
|
||||||
|
"-4": "Yellowknife (Canada)",
|
||||||
|
"-3": "Okhotsk (Russia)",
|
||||||
|
"-2": "Fairbanks (Alaska)",
|
||||||
|
"-1": "Nuuk (Greenland)",
|
||||||
|
0: "Murmansk (Russia)",
|
||||||
|
1: "Arkhangelsk (Russia)",
|
||||||
|
2: "Anchorage (Alaska)",
|
||||||
|
3: "Tromsø (Norway)",
|
||||||
|
4: "Reykjavik (Iceland)",
|
||||||
|
5: "Harbin (China)",
|
||||||
|
6: "Stockholm (Sweden)",
|
||||||
|
7: "Montreal (Canada)",
|
||||||
|
8: "Prague (Czechia)",
|
||||||
|
9: "Copenhagen (Denmark)",
|
||||||
|
10: "London (England)",
|
||||||
|
11: "Antwerp (Belgium)",
|
||||||
|
12: "Paris (France)",
|
||||||
|
13: "Milan (Italy)",
|
||||||
|
14: "Washington (D.C.)",
|
||||||
|
15: "Rome (Italy)",
|
||||||
|
16: "Dubrovnik (Croatia)",
|
||||||
|
17: "Lisbon (Portugal)",
|
||||||
|
18: "Barcelona (Spain)",
|
||||||
|
19: "Marrakesh (Morocco)",
|
||||||
|
20: "Alexandria (Egypt)",
|
||||||
|
21: "Tegucigalpa (Honduras)",
|
||||||
|
22: "Guangzhou (China)",
|
||||||
|
23: "Rio de Janeiro (Brazil)",
|
||||||
|
24: "Dakar (Senegal)",
|
||||||
|
25: "Miami (USA)",
|
||||||
|
26: "Jakarta (Indonesia)",
|
||||||
|
27: "Mogadishu (Somalia)",
|
||||||
|
28: "Bangkok (Thailand)",
|
||||||
|
29: "Niamey (Niger)",
|
||||||
|
30: "Khartoum (Sudan)"
|
||||||
|
};
|
||||||
|
|
||||||
function getTemperatureLikeness(temperature) {
|
function getTemperatureLikeness(temperature) {
|
||||||
if (temperature < -5) return "Yakutsk";
|
if (temperature < -5) return "Yakutsk (Russia)";
|
||||||
const cities = [
|
if (temperature > 30) return "Mecca (Saudi Arabia)";
|
||||||
"Snag (Yukon)",
|
return meanTempCityMap[temperature] || null;
|
||||||
"Yellowknife (Canada)",
|
|
||||||
"Okhotsk (Russia)",
|
|
||||||
"Fairbanks (Alaska)",
|
|
||||||
"Nuuk (Greenland)",
|
|
||||||
"Murmansk", // -5 - 0
|
|
||||||
"Arkhangelsk",
|
|
||||||
"Anchorage",
|
|
||||||
"Tromsø",
|
|
||||||
"Reykjavik",
|
|
||||||
"Riga",
|
|
||||||
"Stockholm",
|
|
||||||
"Halifax",
|
|
||||||
"Prague",
|
|
||||||
"Copenhagen",
|
|
||||||
"London", // 1 - 10
|
|
||||||
"Antwerp",
|
|
||||||
"Paris",
|
|
||||||
"Milan",
|
|
||||||
"Batumi",
|
|
||||||
"Rome",
|
|
||||||
"Dubrovnik",
|
|
||||||
"Lisbon",
|
|
||||||
"Barcelona",
|
|
||||||
"Marrakesh",
|
|
||||||
"Alexandria", // 11 - 20
|
|
||||||
"Tegucigalpa",
|
|
||||||
"Guangzhou",
|
|
||||||
"Rio de Janeiro",
|
|
||||||
"Dakar",
|
|
||||||
"Miami",
|
|
||||||
"Jakarta",
|
|
||||||
"Mogadishu",
|
|
||||||
"Bangkok",
|
|
||||||
"Aden",
|
|
||||||
"Khartoum"
|
|
||||||
]; // 21 - 30
|
|
||||||
if (temperature > 30) return "Mecca";
|
|
||||||
return cities[temperature + 5] || null;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,13 @@ function showBurgTemperatureGraph(id) {
|
||||||
|
|
||||||
// Standard deviation for average temperature for the year from [0, 1] to [min, max]
|
// Standard deviation for average temperature for the year from [0, 1] to [min, max]
|
||||||
const yearSig = lstOut[0] * 62.9466411977018 + 0.28613807855649165;
|
const yearSig = lstOut[0] * 62.9466411977018 + 0.28613807855649165;
|
||||||
|
|
||||||
// Standard deviation for the difference between the minimum and maximum temperatures for the year
|
// Standard deviation for the difference between the minimum and maximum temperatures for the year
|
||||||
const yearDelTmpSig =
|
const yearDelTmpSig =
|
||||||
lstOut[1] * 13.541688670361175 + 0.1414213562373084 > yearSig
|
lstOut[1] * 13.541688670361175 + 0.1414213562373084 > yearSig
|
||||||
? yearSig
|
? yearSig
|
||||||
: lstOut[1] * 13.541688670361175 + 0.1414213562373084;
|
: lstOut[1] * 13.541688670361175 + 0.1414213562373084;
|
||||||
|
|
||||||
// Expected value for the difference between the minimum and maximum temperatures for the year
|
// Expected value for the difference between the minimum and maximum temperatures for the year
|
||||||
const yearDelTmpMu = lstOut[2] * 15.266666666666667 + 0.6416666666666663;
|
const yearDelTmpMu = lstOut[2] * 15.266666666666667 + 0.6416666666666663;
|
||||||
|
|
||||||
|
|
@ -60,7 +62,7 @@ function showBurgTemperatureGraph(id) {
|
||||||
const minT = burgTemp - Math.max(yearSig + delT, 15);
|
const minT = burgTemp - Math.max(yearSig + delT, 15);
|
||||||
const maxT = burgTemp + (burgTemp - minT);
|
const maxT = burgTemp + (burgTemp - minT);
|
||||||
|
|
||||||
const chartWidth = Math.max(window.innerWidth / 2, 580);
|
const chartWidth = Math.max(window.innerWidth / 2, 520);
|
||||||
const chartHeight = 300;
|
const chartHeight = 300;
|
||||||
|
|
||||||
// drawing starting point from top-left (y = 0) of SVG
|
// drawing starting point from top-left (y = 0) of SVG
|
||||||
|
|
@ -107,9 +109,9 @@ function showBurgTemperatureGraph(id) {
|
||||||
});
|
});
|
||||||
|
|
||||||
drawGraph();
|
drawGraph();
|
||||||
|
|
||||||
$("#alert").dialog({
|
$("#alert").dialog({
|
||||||
title: "Annual temperature in " + b.name,
|
title: "Average temperature in " + b.name,
|
||||||
width: "auto",
|
|
||||||
position: {my: "center", at: "center", of: "svg"}
|
position: {my: "center", at: "center", of: "svg"}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue