Use the "Forum Search"
It may help you to find anything in the forum ;).

Configurable Height Limit of the World

Started by THLeaderH, June 27, 2018, 01:16:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


In the current simutrans, height is limited to 32. However, the z value of a coordinate is stored in a variable of sint8. We should allow players to use more higher space and I made this patch.

~Features of this patch~

  • The maximum and minimum value are configurable. The maximum height can be 16 ~ 127 and the minimum can be -127 ~ -12.
  • These values are stored in the save data and configurable through the settings window.
  • The land color in the mini map is scaled by the maximum height of the world.
  • The patch is r8524 based.

The diff file is attached to this post.


The problem is that beyond a certain height level the drawing code of simutrans breaks. Each time there are a certain number of extra height levels renders in front an the back to catch thing like high foreground mountains and planes or deep depressions in the back. With even more height levels, these things will break, and one would need to render even more (in most cases invisible) tiles. So teh height window gives an indication when the graphics engine will start to lead to artefacts.

However, the map window could of course autoscale to always show the full height. I would not introduce config values for that, just change the height routine as you did using the stored values of the world.


There's also the problem that you can't set the world height to 127 as a building with more than one height will overflow.


Thank you for your reply.
Although it depends on "certain height level" that prissi mentioned, how about changing the maximum height of the world to the fixed value, 64?


Did you check whether the world can be displayed for such altitude levels? Changing some limit is one part, making sure that the display routines ( work well is another (bigger) part.
Parsley, sage, rosemary, and maggikraut.


I know this does not guarantee the safety of the code, but at least it works at the land whose altitude is 59, while world_max_height=64.


I will usually generate artefact when you not zoom out and slow move behind the mountain.

Also the landscape generator never make land like this.


That would allow real mountains as in the Alps 8)



A bug caused by this patch have been reported. (´・ω・`)
Please confirm extended bug report thread. This bug can also be seen in Standard.


The ground remains editable even below min level in standard. But in r9587 the lowering of tunnels below the minimum level is no longer allowed.