Yes, it alters the tiles *after* it set them to the calculated height. The problem IMHO is that this can result in it setting a higher heightlevel than originally defined in the heightmap.
I have attached a heightmap of Central Europe I use as testcase. Start a patched game, and open that heightmap using Alpine settings. Then you will notice that the valleys in the Alps have almost completely disappeared below the mountains, simply because the stepness of the mountains in the heightmap can´t be represented in game.
Anyway, the algorithm I have in mind is quite straightforward, so I think we will see alternative results soon.
One technical question: I currently try to add this variable
Code: Select all
[SDT_VAR]
base = GameSettings
var = game_creation.heightmap_max_heightlevel
type = SLE_UINT8
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
def = 30
min = 1
max = 255
in settings.ini, just below heightmap_rotation (it will control the height scaling of the heightmap). My expectation was that I just have to call make, the corresponding files will be generated, and I can use it in the genworld_gui.cpp. However, it doesn´t know the variable:
Code: Select all
[SRC] Compiling genworld_gui.cpp
/home/wol/openttd/_trunk_mq/src/genworld_gui.cpp: In member function ‘virtual void GenerateLandscapeWindow::OnClick(Point, int, int)’:
/home/wol/openttd/_trunk_mq/src/genworld_gui.cpp:657:38: error: ‘struct GameCreationSettings’ has no member named ‘heightmap_max_heightlevel’
/home/wol/openttd/_trunk_mq/src/genworld_gui.cpp:658:49: error: ‘struct GameCreationSettings’ has no member named ‘heightmap_max_heightlevel’
/home/wol/openttd/_trunk_mq/src/genworld_gui.cpp:666:5: error: expected ‘;’ before ‘SetDParam’
(before changing genworld_gui.cpp parallel to the compile job, I got similar errors for settings.cpp / settings.h)
Where is my mistake? Did I miss some file I also have to change?