The International Simutrans Forum

 

Author Topic: Configurable Height Limit of the World  (Read 536 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 244
  • Languages: JP,EN
Configurable Height Limit of the World
« 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 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9102
  • Languages: De,EN,JP
Re: Configurable Height Limit of the World
« Reply #1 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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2791
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Configurable Height Limit of the World
« Reply #2 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.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 244
  • Languages: JP,EN
Re: Configurable Height Limit of the World
« Reply #3 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?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4446
  • Languages: EN, DE, AT
Re: Configurable Height Limit of the World
« Reply #4 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.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 244
  • Languages: JP,EN
Re: Configurable Height Limit of the World
« Reply #5 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9102
  • Languages: De,EN,JP
Re: Configurable Height Limit of the World
« Reply #6 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.

Offline makie

  • *
  • Posts: 23
  • Languages: DE
Re: Configurable Height Limit of the World
« Reply #7 on: July 01, 2018, 12:27:52 PM »
That would allow real mountains as in the Alps 8)