News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

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.

THLeaderH

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.

prissi

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.

An_dz

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.

THLeaderH

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?

Dwachs

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 (simview.cc) work well is another (bigger) part.
Parsley, sage, rosemary, and maggikraut.

THLeaderH

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.

prissi

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.

makie

That would allow real mountains as in the Alps 8)

prissi


Ranran

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

prissi

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.