The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: THLeaderH on June 27, 2018, 01:16:17 PM

Title: Configurable Height Limit of the World
Post by: THLeaderH on June 27, 2018, 01:16:17 PM
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 diff file is attached to this post.
Title: Re: Configurable Height Limit of the World
Post by: prissi on June 27, 2018, 03:42:08 PM
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.
Title: Re: Configurable Height Limit of the World
Post by: An_dz on June 27, 2018, 09:57:08 PM
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.
Title: Re: Configurable Height Limit of the World
Post by: THLeaderH on June 28, 2018, 01:22:16 AM
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?
Title: Re: Configurable Height Limit of the World
Post by: Dwachs on June 28, 2018, 06:07:32 AM
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.
Title: Re: Configurable Height Limit of the World
Post by: THLeaderH on June 28, 2018, 07:00:02 AM
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.
(https://preview.ibb.co/hcmQN8/2018_06_28_3_32_00.png)
Title: Re: Configurable Height Limit of the World
Post by: prissi on June 28, 2018, 07:31:42 AM
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.
Title: Re: Configurable Height Limit of the World
Post by: makie on July 01, 2018, 12:27:52 PM
That would allow real mountains as in the Alps 8)
Title: Re: Configurable Height Limit of the World
Post by: prissi on September 11, 2018, 01:27:16 AM
Incorporated in r8574, thanks.
Title: [r8574] Bug of "Configurable Height Limit of the World" patch
Post by: Ranran(retired) on January 22, 2021, 08:29:24 AM
A bug caused by this patch have been reported. (´・ω・`)
Please confirm extended bug report thread (https://forum.simutrans.com/index.php/topic,20723.msg194302.html#msg194302). This bug can also be seen in Standard.
Title: Re: Configurable Height Limit of the World
Post by: prissi on January 24, 2021, 02:22:56 PM
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.