News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Inconsisted climate range

Started by uci, February 15, 2018, 09:44:40 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

uci

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

Leartin

Quote from: uci on February 15, 2018, 09:44:40 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.

uci

Quote from: Leartin on February 15, 2018, 10:54:42 AM
...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.

prissi

Then you are using a set with single ground heights. Check next nightly please.

Leartin

Quote from: prissi on February 16, 2018, 03:31:30 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.

prissi

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).

Leartin

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.



prissi

It works after changing water level, then it is updated on the climate dialoge. The initial updating was missing, will be fixed soon.

uci

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?

IgorEliezer

Quote from: uci on February 23, 2018, 08:44:53 PM
Also, water level goes now up to -40! A feature?
Tss.. someone's been watching too much Pacific Rim, yo! :D

prissi

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)

uci

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.

prissi

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.)

uci

Quote from: prissi 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.

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).

Dwachs

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.
Parsley, sage, rosemary, and maggikraut.

prissi

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.

uci

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.

prissi

In r8408 the artic climate is now converted upon loading/saving in older games to give the correct value without adding the groundwater.

uci

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.


prissi

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

uci

Summer snowline is clipped at 32 levels above water, no matter how high I set alpine climate (r8411). Is this the intended behaviour?

prissi

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.


uci

This is fantastic! Now we have a very flexible and more robust climate system. Thank you.  8)

Quote from: prissi on March 25, 2018, 01:56:41 PM
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.

prissi

That is certainly possible. In in r8415

Dwachs

I somehow managed to get alpine climate on beaches without changing the climate borders to extreme values. Could not reproduce.
Parsley, sage, rosemary, and maggikraut.

uci

Quote from: Dwachs on April 10, 2018, 09:20:22 PMI 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.