The International Simutrans Forum

 

Author Topic: climates based on humidity and temperature  (Read 429 times)

0 Members and 1 Guest are viewing this topic.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2305
climates based on humidity and temperature
« on: June 24, 2020, 02:24:54 PM »
Proof of concept stage currently. I don't see this as replacing prissi's new code for multiple climate distribution, or the need to read climate maps from files, but as a potential alternative which could be selected. Climate becomes dependent on temperature - which is related to height, and humidity, which is dependent on bodies of water and contours from the direction of the prevailing wind. Tree generation at map start also is dependent on humidity.

Known issues:
Westward edge of map has climates which don't necessarily reflect rest of map
Wind always blows from west
Areas around rivers don't match climate (think this might be shared with trunk).
Doesn't pay any attention to climate settings - fixed assumption that sea level has a temperature of 25.
Climate definitions are fixed (see sketch diagram in attachment)
Not tested enlargement of existing maps






Offline Vladki

  • Devotee
  • *
  • Posts: 3328
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: climates based on humidity and temperature
« Reply #1 on: June 24, 2020, 02:33:32 PM »
Interesting idea. Just a small note that wind in simutrans blows from north-east - planes land and take off against wind, smoke also moves to south-west = right to left.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9992
  • Languages: De,EN,JP
Re: climates based on humidity and temperature
« Reply #2 on: June 24, 2020, 02:42:38 PM »
Interesting. I think one still should be able to set "temperature" regions for climates, as well as making the apparent height scalable via a parameter, because the relative height of a mountain very much depends on the size of the map

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2305
Re: climates based on humidity and temperature
« Reply #3 on: June 24, 2020, 02:53:07 PM »
Interesting. I think one still should be able to set "temperature" regions for climates, as well as making the apparent height scalable via a parameter, because the relative height of a mountain very much depends on the size of the map
Indeed - I see a way forward as having a number of options related to map generation:
a) Heights - from file, from perlin, from other generators
b) Climates - from file, from heights (including your overlapping patches), from other generators (including this from humidity and temperature)

Other generators of height and climate will have a need for different parameters to be set - for humidity and temperature this would include wind direction for example. Scaling of temperature can probably be calculated in a global way based on sea level, summer snowline and winter snowline, but a common request is for temperature to increase toward the southern edge of the map (or north). It would be nice to change the temperatures and or humidities associated with different climates too. Have to start somewhere though!

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9992
  • Languages: De,EN,JP
Re: climates based on humidity and temperature
« Reply #4 on: June 24, 2020, 11:42:20 PM »
One thing which I find strange is the randomness followed by smoothing. I think both of them can go away ... Also I think lakes should contribute to humidity too, (and maybe rivers as well).

The wind can easily change to the four direction NSEW, as one would just iterate the map differently. A diagonal map iteration is not so straight forward.

Altogether this is already great and I would envision a combobox in the climate settings that then either show the current options or the temperature-height based climate options. I can take care of the gui.

I think one needs to set the temperature borders and the 65% and 75% humidity, the summer snowline and the wind direction, the "evaporation/resaturation" and the temperature gradient.

I think, it would make sense to add this also with the current climate options to the next version.

I also like the humidity dependent trees. Of course this asks for humudity dependent agriculture locations ...
« Last Edit: June 25, 2020, 12:00:16 AM by prissi »

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2305
Re: climates based on humidity and temperature
« Reply #5 on: June 25, 2020, 01:39:03 AM »
Not got the code in front of me but lakes should contribute to humidity (any water tile will). Unless lakes are generated after climates but that can be swapped if desired. Rivers is trickier as they would be added later on in the map generation after climates had been made.


As an aside one idea I had was that rivers should be more likely to appear at higher humidities. To some extent trees, rivers and lakes would all have a two way interaction with climate - trees will cause humidity to rise and if you cut down a rainforest you’re often left with desert, but equally there needs to be moisture in the air in the first place for trees to thrive. In desert climates rivers may (almost) disappear before they reach the ocean and lakes will evaporate to a lower level, sometimes even to a salt flat. I had thought whether to try and represent endorheic basins (e.g. the Dead Sea, Death Valley, Turpin Depression, Afar Triangle).


I do find the humidity based distribution of forests great when maps have a fair bit of elevation, but for flatter maps it can result in just a uniform spread which is a little boring. Hence maybe a combination which could be seen as acknowledging different soil types might work better, I might play around with that a bit more.


The randomness just adds a bit of variation - effectively trying to represent the factors that are too small scale to be otherwise visible. The smoothing is there to take away isolated climate tiles which otherwise look odd and is necessary regardless of randomness. I’ve also been looking at picking up some element of coastal humidity even if it’s not in line with prevailing wind.


I’ve added a snow line based temperature calculation which seems to work well for giving adjustments on the temperature range across the map. Also there were a few errors in the original that have picked up on (such as isolated trees never being generated).


And yes, humidity dependent agriculture (and forestry) would seem to be logical. Storing the humidity map would allow for such things.


As you say, changing wind direction is trivial - even to diagonal isn’t that difficult really - though would make it more necessary to handle the edges better. Having that, horizontal scaling and maybe some way to influence temperature and humidity boundaries in the gui would be good. Also another setting which I’d like to incorporate is a maximum lake height. That was set at groundwater plus 8 for a long time due to slow lake generation but that shouldn’t be an issue now.

Offline Freahk

  • Devotee
  • *
  • Posts: 1058
  • Languages: DE, EN
Re: climates based on humidity and temperature
« Reply #6 on: June 25, 2020, 07:01:56 AM »
Rivers is trickier as they would be added later on in the map generation after climates had been made.
It would be awesome if these started on hills, then searching a way without upward slopes until they meet another river, map borders or a large larke/the ocean.
Though, I guess that's a project on its own :(

In any case, this is a very interessting idea.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9992
  • Languages: De,EN,JP
Re: climates based on humidity and temperature
« Reply #7 on: June 25, 2020, 07:29:25 AM »
The rivers more or less work like that ...

The current code increases humidity only when hgt<groundwater, unless I overlooked something.

I can work a little on the GUI tonight or tomorrow.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2305
Re: climates based on humidity and temperature
« Reply #8 on: June 25, 2020, 07:51:03 AM »
As said didn’t have code in front of me last night - it’s an easy change anyway to include lakes.


In terms of code structure I’m reminded that Dwachs talked about wanting to separate out world generation from simworld - I had been thinking whether each generator could offer one or more from height generator, climate generator, tree generator, river generator, etc.


The defaults would be existing trunk - although a “from file” would be the first alternative covering not just height reader currently in trunk but also a new climate reader (plus in time others e.g. city locations?)? Users could then mix and match different elements to suit their desired map style.

Offline freddyhayward

  • Devotee
  • *
  • Posts: 224
  • Languages: EN
Re: climates based on humidity and temperature
« Reply #9 on: June 25, 2020, 08:38:49 AM »
It would be awesome if these started on hills, then searching a way without upward slopes until they meet another river, map borders or a large larke/the ocean.
The rivers more or less work like that ...
The problem on extended was that lakes acted as a black hole for rivers, so most rivers (except for a few coastal streams) never actually reached the ocean until lakes became disabled by default. Even a giant river system could end at a 1-tile lake. Does this still happen on standard? I remember reading this thread about using additional passes to create lake outflows: https://forum.simutrans.com/index.php/topic,13114.msg130518.html#msg130518

Offline makie

  • Devotee
  • *
  • Posts: 194
    • Homepage PAK128-German
  • Languages: DE
Re: climates based on humidity and temperature
« Reply #10 on: June 25, 2020, 11:28:01 AM »
[google]In real life, water flows down a hill until it reaches a barrier. There it builds up and forms a lake. The level of the lake rises until the water exceeds the hurdle, then it flows further down the river to the sea. Lakes are formed by rivers and are created in hollows or depressions that are filled with water. If the dam is breached at the end of the lake, the lake runs empty. Lakes are created when water runs into a deepening.

[de]In echt fließt Wasser einen Hügel hinab bis es eine Barriere erreicht.  Dort staut es sich und bildet einen See. Der Pegel des Sees steigt bis das Wasser die Hürde übersteigt, dann fließt es als Fluss weiter talwärts bis zum Meer. Seen werden also von Flüssen gebildet und entstehen in Mulden oder Senken die mit Wasser aufgefüllt werden. Wird der Damm am Ende des Sees durchbrochen, dann läuft der See leer. Seen entstehen also dadurch, dass Wasser in eine Vertiefung läuft.
« Last Edit: June 25, 2020, 11:38:41 AM by makie »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9992
  • Languages: De,EN,JP
Re: climates based on humidity and temperature
« Reply #11 on: June 25, 2020, 01:10:58 PM »
The problem is that not every corner of a map (especially smaller ones) has a sea. If every river must drain into the sea, then there will never be rivers and lakes in many areas of the smaller map.

And as some industries (like pak64 power stations) require rivers, those will then also spawn ess in those areas.

Offline makie

  • Devotee
  • *
  • Posts: 194
    • Homepage PAK128-German
  • Languages: DE
Re: climates based on humidity and temperature
« Reply #12 on: June 25, 2020, 01:24:53 PM »
If terrain lead the river to the card edge, then the river exit the map there.
Water follows always the steep way down. If the valley leave the map, the river do also.

Offline freddyhayward

  • Devotee
  • *
  • Posts: 224
  • Languages: EN
Re: climates based on humidity and temperature
« Reply #13 on: June 25, 2020, 01:29:45 PM »
The problem is that not every corner of a map (especially smaller ones) has a sea. If every river must drain into the sea, then there will never be rivers and lakes in many areas of the smaller map.
It's fine for rivers to end at lakes if there is no sea, or there is no reasonable route to it, but simulating outflows from lakes would be a good idea if feasible.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9992
  • Languages: De,EN,JP
Re: climates based on humidity and temperature
« Reply #14 on: June 26, 2020, 12:52:59 AM »
Please open a new thread discussing rivers and better spawning algorithms.