The International Simutrans Forum

 

Author Topic: Inconsisted climate range  (Read 13482 times)

0 Members and 1 Guest are viewing this topic.

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Inconsisted climate range
« on: February 15, 2018, 09:44:40 AM »
In "Lanscape Settings" dialog the minimum range for water level is -20 and the minimum range for climates is -5.
I think these values should be equal (-20), otherwise I cannot create proper climates for certain maps derived from heightmaps with many levels of altitude.

A related extension request was reported here
https://forum.simutrans.com/index.php?topic=17745.0

and an analysis of climates and snowlines here
https://forum.simutrans.com/index.php?topic=17894.0

Offline Leartin

  • Devotee
  • *
  • Posts: 1078
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Inconsisted climate range
« Reply #1 on: February 15, 2018, 10:54:42 AM »
otherwise I cannot create proper climates for certain maps derived from heightmaps with many levels of altitude.

You can, although it's tricky. Instead of the landscape settings dialog, open the normal settings dialog, change to the landscape tab and change your water level to -20. Then close these settings, open them again, and you are able to use -20 for climate settings.

The normal landscape settings dialog is restricted to -5, while the landscape tab in the settings is restricted to the water level that was set when it was opened (unless already fixed)


Of course, it's still a bug. Just noting how you can circumvent it until it gets fixed.

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #2 on: February 15, 2018, 12:14:37 PM »
...open the normal settings dialog, change to the landscape tab and change your water level to -20

In the landscape tab water level cannot be set below -10.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #3 on: February 16, 2018, 03:31:30 AM »
Then you are using a set with single ground heights. Check next nightly please.

Offline Leartin

  • Devotee
  • *
  • Posts: 1078
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Inconsisted climate range
« Reply #4 on: February 16, 2018, 05:30:17 AM »
Then you are using a set with single ground heights. Check next nightly please.

It's actually true for half-height sets as well. You can set it to -20 in the landscape settings, but there you can only set -5 in the climates. If you open the landscape tab in the settings, it reverts to -10. However, since it was -20 when the tab was opened, you can now set the climates to -20 to have them only in the netherlands. So both climates at -20 and waterlevel -20 are possible, just not together.
It would probably be much easier to maintain if the landscape settings dialog was removed, and the button  for it would lead straight to the landscape settings tab. There, you'd only have to fix the range to allow for -20 in everything, and remove the weird "no lower than water level" restriction.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #5 on: February 16, 2018, 12:27:19 PM »
Why this is weird? Any land below the water level is turned to water on map creation. Also in order to prevent drawing errors, the highest climates should not be more than 32 levels above the lowest (the water line).

Offline Leartin

  • Devotee
  • *
  • Posts: 1078
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Inconsisted climate range
« Reply #6 on: February 16, 2018, 06:58:48 PM »
It's weird because that's not how it currently works.
The lower limit for climates is fixed once you open the window. If you change the water level after you opened the window, this is not taken into account anymore. This causes two things:
  • Unexpecting players might open the window, set the water level lower, and wonder why climates can't go down to water level.
  • Players might open the window, set the water level higher, and set the climates under water level. It doesn't do anything, I suppose they are counted as zero anyway, but being able to put it in is confusing
Removing the limit would at least fix the first situation, while the second stays the same - so over all, it would be an improvement.

Of course, if there is an intended range of waterlevel to waterlevel+32, it might be best to restrict those boxes to a range from 0 to 32 and just add the waterlevel before generation - pretty much the way it used to be.



Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #7 on: February 17, 2018, 01:08:42 PM »
It works after changing water level, then it is updated on the climate dialoge. The initial updating was missing, will be fixed soon.

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #8 on: February 23, 2018, 08:44:53 PM »
Original bug fixed in r8385. But another one surfaced (related).

Alpine climate range should be 0..32, regardless of water level settings. This is because alpine climate range is already displayed relative to water level (as intended probably).

Now, as a result of this new bug, on maps with low water level I get arctic climate (summer snow) almost everywhere (even on max serttings). For example, a water level -20 enforces arctic climate (summer snow) from level (-20+12)+1=-7 on max settings, which is just 13 levels above water.



Also, water level goes now up to -40! A feature?

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4069
  • Cake recipes are cool.... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Inconsisted climate range
« Reply #9 on: February 23, 2018, 11:59:30 PM »
Also, water level goes now up to -40! A feature?
Tss.. someone's been watching too much Pacific Rim, yo! :D

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #10 on: February 27, 2018, 06:12:17 AM »
There was also a bug that the water level was reverted to -2 whenever a relief was loaded. Now the set water level should be used. (r8387)

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #11 on: February 27, 2018, 01:51:41 PM »
The (new) bug still not fixed in r8387. ::'(

Let me summarize:
- the bug did not appear in r8374
- the bug is related with how climate ranges are computed (alpine & arctic, in particular)
- the range for highest climates (alpine & arctic) seems to be wrongly computed (except for water_level=0)

As I mentioned previously, in climate dialog the range for alpine (and implicit arctic) climate is relative to water level, but the range for lower climates are in absolute tiles height. I think this is the source of the bug. An example is given 3 posts above.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #12 on: February 28, 2018, 06:51:10 AM »
In the code the artic climate is absolute, not relative, so the same limits should apply for everything. Sorry, I was misled by the initial posting. (For some strange reason, in the climate calculation always +1 is added.)

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #13 on: March 02, 2018, 06:14:57 AM »
In the code the artic climate is absolute, not relative, so the same limits should apply for everything.

OK, but snow coverage appears too low on map then. See below.

water_level = -10
summer_snowline = 20
-----------------
I get snow on mid-summer at height = 11



water_level = -10
winter_snowline = 0
-----------------
I get snow on mid-winter at height = -9



Both snow levels should be 10 tiles higher. I think that snow coverage is displayed on map relative to water level. So, we still have a bug here (r8388).

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4491
  • Languages: EN, DE, AT
Re: Inconsisted climate range
« Reply #14 on: March 02, 2018, 02:34:20 PM »
In climates.cc lines 241--252 there are two nested for loops, both working on the variable i. I do not know what the code is intended to do.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #15 on: March 03, 2018, 02:03:23 PM »
The inner loop was useless (after being copied from the top) but it did not do any harm too.

The error is in simworld, where to the summer line (despite being absolute) the groundwater is added again. Not sure how to fix this, because it will affect the snow in all old games. The best that can be done is to correct the summer snowline upon loading, and live with the now correct (but likely higher) winter snowline.

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #16 on: March 09, 2018, 06:28:43 AM »
Having snow at lower elevations than expected is missleading for the player. I thought that arctic climate is relative to water level just because of that.

I hope some sort of fix is implemented, at least for summer snowlines. Currently maps with low water levels are "compromised" with too much snow.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #17 on: March 20, 2018, 12:18:17 AM »
In r8408 the artic climate is now converted upon loading/saving in older games to give the correct value without adding the groundwater.

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #18 on: March 20, 2018, 08:19:17 PM »
I confirm snowlines are now at absolute levels (r8410).  :)

But, there is a small remnant bug when pushing summer snowline to maximum (32 levels above water).

In spite of changing summer snowline from level 16 to 17 nothing changes on map, i.e. arctic climate begins at level 17 in both cases. Water level set to -15.

I think the later is wrong.


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #19 on: March 23, 2018, 12:49:17 PM »
The value is internally clipped on closing, but the intermediate display is wrong. Anyway, border should range up to 127, not 32. That is rather an artificial resprition, based on the possible number of height levels with the random map generator. See r8411

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #20 on: March 24, 2018, 04:45:02 PM »
Summer snowline is clipped at 32 levels above water, no matter how high I set alpine climate (r8411). Is this the intended behaviour?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #21 on: March 25, 2018, 01:56:41 PM »
The internal array to convert climates to height had only 32 entries. Thus any entry heigher was stuck at snow. (Was not so obvious error, and likely there since the introduction of climates.)

There are other errors at heights larger than 33 (like no cursor) but at least the climates will be generated as desired.


Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #22 on: March 26, 2018, 07:41:04 PM »
This is fantastic! Now we have a very flexible and more robust climate system. Thank you.  8)

There are other errors at heights larger than 33 (like no cursor).

This is not a big problem for heightmaps, since I can set black color (0,0,0) in the image to be the lowest ground level on the map (water_level = -34 for this), and I have 64 usable height levels. Pretty impresive.

On another hand, before fixing these bugs it was possible to have snowy shores around water by setting winter snowline below water level. A very nice effect!



After recent bug fixes this trick does not work anymore, because winter snowline cannot be set below water level.

May I suggest to allow the minimum range of winter snowline to be one level below water level? This will do the trick again.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Inconsisted climate range
« Reply #23 on: March 27, 2018, 06:43:04 AM »
That is certainly possible. In in r8415

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4491
  • Languages: EN, DE, AT
Re: Inconsisted climate range
« Reply #24 on: April 10, 2018, 09:20:22 PM »
I somehow managed to get alpine climate on beaches without changing the climate borders to extreme values. Could not reproduce.

Offline uci

  • *
  • Posts: 118
  • Without owner
  • Languages: EN, RO
Re: Inconsisted climate range
« Reply #25 on: April 11, 2018, 05:05:05 AM »
I somehow managed to get alpine climate on beaches without changing the climate borders to extreme values. Could not reproduce.
I played quite a lot with the new climate system in pak128, but I didn't notice anything weird.