Author Topic: Help with heightmaps  (Read 1956 times)

0 Members and 1 Guest are viewing this topic.

Offline Bear789

Help with heightmaps
« on: October 31, 2017, 05:06:23 PM »
Hi everybody.
I'm coming back to Simutrans after several years. I made a custom grayscale map with the half height feature in mind, but Im having some trouble loading it in the game (Extended version; I already asked in the section dedicated to Extended and Jamespetts told me that the code that handles loading grayscales is the same as Standard and can't help me with that).
By that I mean that it loads without errors, but none of the steps that were meant to be half height are.
I know that both Extended and Pak 128 Britain-Ex support the feature, so either I'm doing something wrong when I import the map (is there some setting I should change for this?) or the grey values I painted are wrong; I made the map using some old grayscale values that I was told about last time I played, when half-heights were just added to the game, but that was several years ago.
If that's the case, is there an official list of colours I sould use?

The map is this one, if it hels figuring out what's wrong:

Offline Vladki

Re: Help with heightmaps
« Reply #1 on: November 03, 2017, 02:53:47 PM »
I recommend you to prepare a height map that is 256 px long with black to white gradient, to that each px is one gray level darker than next one.

Then you can load that in simutrans (compare std and extended) and check which grey level corresponds to which height. Also play with sea heigt when loading the map.

Offline Bear789

Re: Help with heightmaps
« Reply #2 on: November 03, 2017, 06:16:30 PM »
Great idea, thanks! I didn't think of that.

My first tests gave me these values in case someone else is interested.
They seem to work reliably with heig_map_conversion_version 1. Version 2 is weird: at first, they worked, after I tested the same heghtmap in version 1, when I tried to make a new map in version 2 the half-heights stopped working properly once again. I swear I'm not crazy (by the way, if someone can explain me what's the difference between version1 and 2, maybe it can help me figuring out what's going on; also, it would be interesting to understand if and how the options in the climate settings window and the ones in the climate settings tab in the generic settings window interact/interfere with each other).
I'll retry with other values later to see what is going on. Also, I set the mountain height to the maximum value and the sea level to the minimum (-20 I believe).

R      G      B

255   255   255   (White, highest mountain - there are 10 more levels that can't be painted as you can't go any whiter than white - unless there is some special color for those)

251   251   251

248   248   248

244   244   244

240   240   240

236   236   236

232   232   232

227   227   227

222   222   222

218   218   218

212   212   212

206   206   206

201   201   201

195   195   195

189   189   189

182   182   182

177   177   177

170   170   170

164   164   164

157   157   157

151   151   151

144   144   144

138   138   138

131   131   131

125   125   125

119   119   119

112   112   112

106   106   106

100   100   100

94   94   94

89   89   89

82   82   82

77   77   77

72   72   72    (first above water level)

66   66   66   (first underwater level)

61   61   61

57   57   57

52   52   52

48   48   48

44   44   44

40   40   40   (deepest sea level)

Offline prissi

Re: Help with heightmaps
« Reply #3 on: November 06, 2017, 01:44:20 AM »
The value of map conversion is saved with a saved game. When you reload a game, it may restore the settings. Thus you may need to first set the settings again, close the settings and then generate the map. A different order may generate different results.

Offline Bear789

Re: Help with heightmaps
« Reply #4 on: November 08, 2017, 01:09:21 PM »
Oh, interesting. So, if I create a new map from scratch I get different results than if I create it while another one is loaded?
Then I might have some trouble, as the version of Extended I'm currently playing seem to automatically save when you exit and automatically load the last savegame on startup.

Offline Bear789

Re: Help with heightmaps
« Reply #5 on: November 12, 2017, 05:27:54 PM »
Ok, it seems that now I can consistently have height maps work the way I want with a simple formula. Disregard the list I posted a few posts ago, what seems to work correctly is working your way up from 40 40 40 by adding 4 to each value each time.
So with the same settings (sea level at -20) there's the bottom of the sea at 40 40 40, the first sea level at 44, 44, 44, and so on.
I have one more issue, though: the map is permanently covered in snow no metter where I set the winter snow line (also irregardless of where I set the sea level). I aslo fast forwarded to April to see if at spring it would start to retreat from the lowest land levels, but no luck.

Any idea why?
« Last Edit: November 13, 2017, 08:22:58 AM by Bear789 »

Offline prissi

Re: Help with heightmaps
« Reply #6 on: November 13, 2017, 05:21:38 AM »
The climates are also best set before laoding the map. But they are only applied when starting the game with a height map.

Waht values did you set the levels?

Offline Bear789

Re: Help with heightmaps
« Reply #7 on: November 13, 2017, 08:27:58 AM »
You mean the snow levels? Given that I managed to reset the height levels, I thought that the show levels were reset too. Anyway, the summer is stuck at 0, I'm not allowed to change it. The winter one, I tried almost everything, ranging from 0 to -10 (given that the sea level is set at -20), always resetting inbetween attemprs, and the result is always the same.
Now I'll try to "raise" the grayscale map since I'm not using the whole range of heights and see what happens, unless you have a better suggestion.

Offline Vladki

Re: Help with heightmaps
« Reply #8 on: November 13, 2017, 05:28:32 PM »
Snow and climate levels are relative to sea level. So they all should be positive numbers. Summer snow line is equal to arctic climate level. Try setting all climates to positive numbers.

Offline Bear789

Re: Help with heightmaps
« Reply #9 on: November 13, 2017, 08:01:55 PM »
It doesn't work. Summer snowline is preset at 0 and there's no controls to alter it, nor ways to type in a different value. I can change the winter snow line, but the game won't allow me to set it to anything higher than 0, and at that setting I get snow all the way down to the sea.
Last time I played it was years ago, the interface was different. This is also Simutrans Extended, but Jamespetts told me that he didn't touch the code for map generation.

Offline Leartin

Re: Help with heightmaps
« Reply #10 on: November 14, 2017, 05:14:32 AM »
As Vladki said, the summer snowline is equal to arctic climate. If your summer snowline is at zero, is your arctic climate at zero? Can you change your arctic climate to a higher value? That's how it should work.
In winter it's colder than in summer, so there is more snow - winter snowline has to be lower or equal to summer snowline, it can't be higher. (no support for southern hemisphere ;) )

Offline Bear789

Re: Help with heightmaps
« Reply #11 on: November 18, 2017, 02:10:28 PM »
Sorry if I haven't answered earlier, busy week.

Anyway, it seems that I managed to achieve something. There was no arctic climate among my options, only mountains, uplands, lowlands, plains, dunes, beach; mountains seemed to do the trick. Well, actually even during summer the snow doesn't melt for both mountains AND uplands, and the climates seems to change by two levels at a time (by that I mean that I increase the value by 1, yet it becomes two half-height levels in the game), but the map looks somewhat like what I designed so I'm taking it.

Thank you everybody.