The International Simutrans Forum

 

Author Topic: climate setting issues  (Read 596 times)

0 Members and 1 Guest are viewing this topic.

Offline Freahk

  • *
  • Posts: 929
  • Languages: DE, EN
climate setting issues
« on: April 16, 2020, 01:19:20 PM »
There seem to de three different climate setting windows:
One appears in the "climate" tab of the settings window when creating a new map, one appears at the "climate" tab when using the settings tool of an existing game and one appears when opening the "climate settings" window on map creation.

All these bahave differently and have their own issues:
None of these can set the "arctic" climate height, not sure if this is a bug or a feature.
Further, the "rocky" or "mountain" climate setting seems to behave differently from the other climate height settings.
I had to set it to a value of 40 to get an actual mountain climate level, thus also a summer snowline at level 12.


Value boundaries of the different windows
settingstandalone climate settings windownew map settings climate tabmodify existing maps settings climate tabshould be
water level-20 to 0-10 to 0none-25 to 25
Beach-25 to 32-water_levelwater_level to 24 water_level to 24water_level to dune_climate
Dune-25 to 32-water_levelwater_level to 24 water_level to 24beach_climate to plains_climate
Plains-25 to 32-water_levelwater_level to 24 0 to mountain_climatedune_climate to lowlands_climate
Lowlands-25 to 32-water_levelwater_level to 24 water_level to 24plains_climate to uplands_climate to max_map_height
Uplands-25 to 32-water_levelwater_level to 24 water_level to 24lowlands_climate to mountains_climate
Mountains-25 to 32-water_levelwater_level to 24 water_level to 24uplands_climate to max_map_height
winter snowline-25 to mountain_climatewater_level to 24water_level to 24water_level to mountain_climate

Observations and further strange bahaviors
I guess there is a sign error in the height logic of climate zones boundary and and the calculation of the winter snowline is odd:

In the standalone climate settings window, the upper boundary seems to be 32-water_level, but it should rather be 32+water_level.
Further, that upper boundary comes from an ancient limit of 32 height levels. I don't think it makes sense anymore.
For heightmaps generated maps this is still true but for simutrans generated maps that boundary does not seem to apply anymore.

The actual summer snowline seems to be at 32 - water_level -mountain_climate + 1.
I would expect the actual summer snowline height to match the set value of mountain_climate height.

Climate and snowline levels below the water level don't make sense to me. Especially the fixed lower boundary of -25 does not make sense to me as the lower boundary of water level is -20.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9901
  • Languages: De,EN,JP
Re: climate setting issues
« Reply #1 on: April 16, 2020, 02:58:27 PM »
There is one window show at map creating, which can be called later stand alone, but it will not affect the map. Same as the tab in the settings, both will only affect new maps (with the execption of the snowline).

Artic climate is summer snowline by definition, because artic is always snowy. But zou are right, it should be configurable. (I am sure, it had been at some point.)

The winter snowline has an error in its calculation, which cannot be fixed without breaking all old maps. I think there should be a thread discussing this somewhere.

The climate height borders are not needed to be in any order apart from sommer snowline at the top and water (sea) at the bottom. It will become just the climate which border got next. You can have tundra and then desert and then tropical. (Actually, one could have them all at the same height level, but like double slopes also lateral climate generation is sadly almost non existent.)

Offline Freahk

  • *
  • Posts: 929
  • Languages: DE, EN
Re: climate setting issues
« Reply #2 on: April 16, 2020, 04:16:28 PM »
I did not know climates are ordered by their height values, I was quite sure they were in fixed order, ignoring any climate set lower than "previous" climate, so I agree there is no reason to restict these that much.
If it's really not possible to fix the rocky height level aka summer snow line without breaking any old saves, that's not optimal but fine.

However, most of the isues still remain. The most critical one first:
The standalone climate settings window is the only one that can properly set climates if the water level is low enough.

The redundant and inconsistent climate setting windows at map creation are annoying but not a huge issue once you know you have to set the climate after doing any other settings using the standalone climate window...
The inconsistencies, however are a much larger problem when modifying any settings of an existing save, either using the settings tool or abusing the new game settings.

If you set values in the standalone climate settings window on map creation that are not within the boundaries of on of the other setting windows, you will get a map with corrupted climate data once you modify any other setting.

The only quite hacky way to fix such a savegame currently is by modifying the savegame manually.
It just took me fouur hours of reasing rdwr code to locate and modify these data in the savegame.
Apart from being very annoying, I'd expect most players and some server admins will not be able to do this.

"Mediterran" can only be set from 0 to 24 in the settings tool and the maximum value of 24 is not sufficient for the buggy rocky climate aka summer snowline.

In addition, it should always be possible to set climates in between water level and summer snowline (or maximum map height, as summer snowline itself seems to be derived from the rocky climate zone)
It should be possible to set a water level down to -25.
« Last Edit: April 16, 2020, 04:32:48 PM by Freahk »

Offline Vladki

  • Devotee
  • *
  • Posts: 3223
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: climate setting issues
« Reply #3 on: April 16, 2020, 05:09:57 PM »
I'm not sure if it is not related, but some climate adjustments probably may happen during the game. I noticed in both standard and extended, that raiding or lowering terrain changes the climate. It seems to be somehow related to what is set in one of the three dialogs, and is applied to the current game, even if it was generated with other settings. But I was not able to make a good debugging case, I'm not really sure how it works.

Offline Freahk

  • *
  • Posts: 929
  • Languages: DE, EN
Re: climate setting issues
« Reply #4 on: April 16, 2020, 05:43:13 PM »
I noticed in both standard and extended, that raiding or lowering terrain changes the climate.
That's exactly described most critical issue.
When you open the settings to change any value, the terrain data will be clamped to the (wrong) boundaries of settings climate setting tab.
If you save the game, those corrupted climate zone heights will be stored in the game, thus climates will change on terrain alignment.

That does not need any specific debugging case:
Simply create a new map with a mediterrane climate height of less than 0 or rocky climate heights of more than 24, open the settings tool, change any value (does not need to be a climate related one), save the game, load the game and you will immediately see the winter snowline went down.
Do some terrain alignment at a height in between 0 and the next lower climate and the climate of these tiles will change to mediterran.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9901
  • Languages: De,EN,JP
Re: climate setting issues
« Reply #5 on: April 17, 2020, 02:37:09 PM »
As iterated many times before, the setting dialog is not supported to be opened after starting a game. Do not do this, it will only confuse players.

And again, the climate dialoge at the beginning is exactly the same code as the "standalone". There are no three different things in the game. There is the climate tab in "settings_stats.cc" and "climates.cc".

But I agree that the borders should be set correctly. I still intend to look at it.

Offline Vladki

  • Devotee
  • *
  • Posts: 3223
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: climate setting issues
« Reply #6 on: April 17, 2020, 03:06:51 PM »
As iterated many times before, the setting dialog is not supported to be opened after starting a game. Do not do this, it will only confuse players.

I did not do that, yet the climates got corrupted somehow, and change when terraforming. So I suspect that what may have happened is:
1. start a game with some climete settings, and save it
2. start another game with different climate settings, and save it.
3. load the 1st game and start changing terrain.

Offline Freahk

  • *
  • Posts: 929
  • Languages: DE, EN
Re: climate setting issues
« Reply #7 on: April 17, 2020, 03:23:00 PM »
I did not do that, yet the climates got corrupted somehow, and change when terraforming. So I suspect that what may have happened is:
If we are talking about stephenson-siemens, I am quite sure you did.
You took down the game to change some settings months ago. After these changes the terrain alignment changed climates.
Maybe your description will also work, I don't know as I didn't test it but opening the settings dialog will definitely cause this issue.


You say we should not use the settings (#27) tool?
So why does it exist? That doesn't make any sense to me.

However, please move to extended.
Above described behaviour does not exactly apply to standard, although some of the described bahavior also applies to standard (e.g. the inconsistent behavior in between the three setting dialogs)

Again, the behaviors of the three different climate setting dialoges are different.
That's the case in both, standard and extended.
However, in standard new map's landscape settings seem to behave the same as the setting tools landscape settings.
The standalone window, however behaves different, allowing values that cannot be entered in the landscape settings tab.

E.g. in standard, at least in my quick test, i could only set water levels in between -2 and 0, whilst in the standalone window, I could set it from -40 to 20.
Climate levels can be set to the foxed range from -20 to 24 in the landscape settings tab, whilst it can be set from water_level to 127 in the standalone window.

If that's really the same code, there must be some very black magic going on.

Offline Vladki

  • Devotee
  • *
  • Posts: 3223
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: climate setting issues
« Reply #8 on: April 17, 2020, 04:11:13 PM »
    I did not do that, yet the climates got corrupted somehow, and change when terraforming. So I suspect that what may have happened is:

If we are talking about stephenson-siemens, I am quite sure you did.
You took down the game to change some settings months ago. After these changes the terrain alignment changed climates.
Maybe your description will also work, I don't know as I didn't test it but opening the settings dialog will definitely cause this issue.

OK, i did change some settings, but not those related to climates. Maybe the climate settings in the settings dialog are not initially read from the running game, but are stored in the game when the dialog is closed.

You say we should not use the settings (#27) tool?
So why does it exist? That doesn't make any sense to me.
Yeah I'd like to know that too. Imho there are many settings that make sense to be modified during a game, e.g. most of the stuff from general and display tabs (except bits per month). I fully accept that if I mess e.g. with just-in-time, avoid_overcrowding or separate_halt_capacities, that it may make chaos in cargo and passenger routing. But it should not affect climates. Or if I enable buying obsolete vehicles or change the way toll percentage it should not affect routing. IMHO the dialog is very useful, and reasonable efforts should be made that it works as expected. IMHO there are really only very few values that should never ever be touched (like bit per month)

However, please move to extended.
The changing climate while terraforming happens in standard as well

Offline Freahk

  • *
  • Posts: 929
  • Languages: DE, EN
Re: climate setting issues
« Reply #9 on: April 17, 2020, 04:41:18 PM »
OK, i did change some settings, but not those related to climates.
That doesn't matter. When you use the settings tool all tabs will be initialised with the values from the savegame AND clamped to their limits.
If you do any changes, the whole setting will be updated and on save stored in the savegame for sure.

The changing climate while terraforming happens in standard as well
The clamping also happens in standard but the description doesn't match exactly. There are differences in value boundaries and some other details.
The bug also exists in standard but the exact description way related to extended.
« Last Edit: April 17, 2020, 05:31:16 PM by Freahk »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9901
  • Languages: De,EN,JP
Re: climate setting issues
« Reply #10 on: April 18, 2020, 12:18:47 PM »
Leave it here, as I will look at it, since the boundaries are broken and artic is not really configurable any more.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9901
  • Languages: De,EN,JP
Re: climate setting issues
« Reply #11 on: April 21, 2020, 01:36:59 PM »
OK, I had a look:
In climate.cc each climate is handled the same. Different borders as described are impossible by the code.
In the climate.cc dialog the upper height limit is 127 and the lower limit is the water level. The border of a climate is the upper limit. If two climates have the same upper limit, only the one further up in the list will appear on the map (although random patches of both woudl be nice).
After the highest climate border the summer snowline (artic) climate will start, no matter what this climate is.

In the settings_stats.cc, (the tab), indeed, the limits were the wrong old ones, 0, for waterline, and 24 for climates, so clamping could occur here indeed. This is fixed in r9031.

All remaining isssues must be extended problems.

Offline Freahk

  • *
  • Posts: 929
  • Languages: DE, EN
Re: climate setting issues
« Reply #12 on: April 21, 2020, 01:48:56 PM »
All remaining isssues must be extended problems.

Most of them are.
Arctic climate is also missing in standard.

Offline Vladki

  • Devotee
  • *
  • Posts: 3223
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: climate setting issues
« Reply #13 on: April 21, 2020, 06:40:04 PM »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9901
  • Languages: De,EN,JP
Re: climate setting issues
« Reply #14 on: April 22, 2020, 01:14:44 PM »
Arctic climate is just above the highest climate border by definition. As said before, the climates borders are the UPPER borders.

I am not sure if the drawing engine of Extended is already updated to handle heights that high properly. Wasn't there an error report some tiem ago?

Offline Freahk

  • *
  • Posts: 929
  • Languages: DE, EN
Re: climate setting issues
« Reply #15 on: April 22, 2020, 01:51:17 PM »
I am not sure if the drawing engine of Extended is already updated to handle heights that high properly. Wasn't there an error report some tiem ago?
No it cannot properly handle heights above 33.
It can draw these but cursor won't work there. One can get around this by using sliced view mode at these heights but terrain alignment won't work in that case.
Heights below -30 cannot be used at all, at least that's the case in stephenson-siemens.
However, this range is still larger than what we can set in extendeds climate setting tab (-10 to 24), not to mention the bugged "mediterran" climate level.

I am aware climate levels are their upper bounds.
However, I might have mistakenly assumed that the summer snowline is yet another climate above arctic as (at least in extended code) arctic height seems to be stored at the last index of
Code: [Select]
sint16 climate_borders[MAX_CLIMATES];and that data is stored in the savegame. Didn't check if gets explicitly initialised or used at all but in my savegame it was set to 24, whilst rocky_climate was set to 40.
However, that might be an extendes issue.

Offline Vladki

  • Devotee
  • *
  • Posts: 3223
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: climate setting issues
« Reply #16 on: April 22, 2020, 04:27:51 PM »
No it cannot properly handle heights above 33.
And does it matter in this case? If I set a climate to higher level (e.g. 40) ? It will just not appear on the map, or be in unplayable zone. That's all.
I can change the patch to have maximum 33 instead of 128. But if the levels above 33 are fixed one day, this patch would have to be adjusted too.

Offline Freahk

  • *
  • Posts: 929
  • Languages: DE, EN
Re: climate setting issues
« Reply #17 on: April 22, 2020, 04:31:28 PM »
No that doesn't matter, 128 is fine imho. I was just answering the question.
Such heights might even already appear on generated maps, they just cannot be used properly.