Author Topic: Query regarding double/half heights  (Read 4244 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15551
  • Total likes: 382
  • Helpful: 172
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Query regarding double/half heights
« on: January 26, 2014, 08:05:05 PM »
May I ask - is it intended that, with the double/half height code, no slopes of the double height variety are generated automatically on map creation? I ask because I am testing Bernd's merge of the latest Standard code into Experimental, and maps that I generate with that do not have double heights anywhere, although these can be added manually.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4233
  • Total likes: 169
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Query regarding double/half heights
« Reply #1 on: January 26, 2014, 08:09:56 PM »
It should depend on map creation settings (roughness, mountain height etc).
Parsley, sage, rosemary, and maggikraut.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4733
  • Total likes: 180
  • Helpful: 108
  • Languages: EN, NO
Re: Query regarding double/half heights
« Reply #2 on: January 26, 2014, 08:25:42 PM »
As far as I can see, Simutrans creates terrain of uniform smoothness. If you make the map rougher, you get lots of small steep hill and lots of small valleys. Turn the setting the other way and you get big gently sloping mountains and wide plains between them. But there is no way of generating both steep (big) mountains and big plains. Maybe we need an option to exponentiate the random values.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15551
  • Total likes: 382
  • Helpful: 172
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Query regarding double/half heights
« Reply #3 on: January 26, 2014, 09:36:10 PM »
Hmm - how high a value for roughness/mountain height is necessary to get double height slopes? And I agree with Ters about the uniformity of smoothness/roughness, too.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline kierongreen

Re: Query regarding double/half heights
« Reply #4 on: January 26, 2014, 09:38:32 PM »
You'll need to push it to the limits for maximum height or roughness - with roughness being more important.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15551
  • Total likes: 382
  • Helpful: 172
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Query regarding double/half heights
« Reply #5 on: January 26, 2014, 09:46:47 PM »
Ahh, yes: with map roughness and mountain height both at the maximum, there are a few double height tiles here and there, but the whole place looks like the Scottish highlands, so Bernd has merged correctly, it seems. But is this behaviour really desirable? Surely the whole point of the double/half heights was to have more varied terrain?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline kierongreen

Re: Query regarding double/half heights
« Reply #6 on: January 26, 2014, 09:49:08 PM »
Well if you generate terrain from heightmaps it's perfectly possible to get varied terrain. The perlin algorithms can't really be altered easily - doing so would make extension of older maps difficult. It would probably be easier to code various algorithms for specific map types, or even easier still just use heightmaps.

Offline The Hood

Re: Query regarding double/half heights
« Reply #7 on: January 26, 2014, 09:58:24 PM »
What we could do with is some source of realistic but fictitious heightmaps. Ones that take account of realistic geology and variation from mountains to range of hills and valleys and flatter plains in different parts of the map. Even better if these heightmaps could have rivers marked on which simutrans then follows...

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15551
  • Total likes: 382
  • Helpful: 172
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Query regarding double/half heights
« Reply #8 on: January 26, 2014, 10:19:43 PM »
Hmm - I am intrigued as to what the relationship is between height maps and double height tiles. I have just tried generating a map from a height map (the same one used for the latest Bridgewater-Brunel online game). I get a similar result as with the Perlin generated maps - I have to increase the roughness to the highest setting to get even a smattering of double height tiles in the hilliest areas, and the hilliest areas are very hilly indeed.

Is not the point of the double height tiles that they simulate different steepnesses of gradient that various types of land transport might have to encounter, so that there is a real chance that a road or railway or canal might actually have to ascend the steeper types of hill in some (non-trivial proportion of) areas of a map such that the vehicles' ability to climb hills matters to different extents based on the particular routes involved? This will not be the case at present, as the steeper slopes are so rare that it is trivially easy to avoid all of them in all but a minute number of cases, even with the maximum level of roughness set.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline kierongreen

Re: Query regarding double/half heights
« Reply #9 on: January 26, 2014, 10:24:50 PM »
Well generally it's only when you get into particularly hilly parts of the country that gradient becomes a real concern. You don't see hairpin bends going up and down the north and south downs for example, only once you get to more mountainous areas. It's also worth keeping in mind the affect that gradients have on grade separated crossings. If you want those to avoid steep gradients now you will need more space, which then limits how close these can be to stations for example. Equally if you want to build a tunnel now you have to build a cutting at the entrance, and bridges are also more likely to need earthworks as well.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15551
  • Total likes: 382
  • Helpful: 172
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Query regarding double/half heights
« Reply #10 on: January 26, 2014, 10:31:38 PM »
Yes, I see the point - but, even taking that into account, they seem excessively infrequent (as it will, even on the highest possible roughness setting, virtually never be necessary for any way to ascend any natural double height slope). Is there a setting somewhere, other than map roughness generally, that affects the incidence of these slopes?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline kierongreen

Re: Query regarding double/half heights
« Reply #11 on: January 26, 2014, 10:39:39 PM »
No - as I indicated, map roughness plus height will make them occur more often. What are the limits on these in Experimental? In Standard height can now be up to 1000, with roughness up to 10, with the restriction that height/100+roughness must be no more than 10.

Offline Sarlock

Re: Query regarding double/half heights
« Reply #12 on: January 26, 2014, 10:44:05 PM »
You have to have a pretty steep gradient in your height map.  I've been able to get a lot of double heights with a modified Vancouver map that I made a while back -- but yes, it has to be quite hilly to achieve it.  Basically the gradient has to be such that the engine can't step back at half heights in order to achieve the desired altitude.  If your height map jumps in single colour increments you'll always get half heights.  You have to jump by a colour in the area to get the double heights to happen.
Current projects: Pak128 Trees, blender graphics

Offline kierongreen

Re: Query regarding double/half heights
« Reply #13 on: January 26, 2014, 10:54:26 PM »
In standard height 200, roughness 9 through to height 700, roughness 4 give the most steep slopes. Many of those will be diagonal slopes though - it's quite rare to get a straight steep slope. Those diagonal slopes make hills look more natural than those which are created when there's only single height slopes.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15551
  • Total likes: 382
  • Helpful: 172
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Query regarding double/half heights
« Reply #14 on: January 26, 2014, 11:10:28 PM »
The same limits apply in Experimental (on the 112.5-merge branch, at least). Generating maps at 400 height and 7 roughness, for example, I get a mountain range to rival the Himalayas and yet still double height slopes (straight ones, at least) are hardly anywhere to be seen (there are one or two dotted around).

Perhaps the answer is in having different map generators. Using heightmaps is one solution, but it is much less convenient than using an in-built generator, and it gives rise to far less variety. I see the point about the need to retain the Perlin generator for enlarging existing maps - but perhaps we could look into having different generation algorithms for new maps? Even Cities in Motion 2, I think, has about 4 different generation algorithms, of which Perlin is one (and is one of the less effective ones, I think).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline kierongreen

Re: Query regarding double/half heights
« Reply #15 on: January 26, 2014, 11:14:48 PM »
As I said, most double height slopes will not be straight - they will be various diagonal shapes. When you try to build roads and railways through such terrain these will quickly become obvious!

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15551
  • Total likes: 382
  • Helpful: 172
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Query regarding double/half heights
« Reply #16 on: January 26, 2014, 11:20:50 PM »
As I said, most double height slopes will not be straight - they will be various diagonal shapes. When you try to build roads and railways through such terrain these will quickly become obvious!

Do you mean that straight double height slopes will frequently be generated by players trying to remove corners from the path of ways being created in hilly terrain?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8764
  • Total likes: 307
  • Helpful: 229
  • Languages: De,EN,JP
Re: Query regarding double/half heights
« Reply #17 on: January 26, 2014, 11:41:02 PM »
First: I was also not so much impressed by the infrequency of the perlin hiehgt generate generating double steps. So indeed, so code to increase height the further the peaks are over the sealevel sound reasonable. One could even step the savegame to achieve this.

On a sidenote. OpenTTD only has double height diagonals, and can also make quite steep mountains wil 20 slope tiles instead of the 56 odd we use.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15551
  • Total likes: 382
  • Helpful: 172
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Query regarding double/half heights
« Reply #18 on: January 26, 2014, 11:51:15 PM »
First: I was also not so much impressed by the infrequency of the perlin hiehgt generate generating double steps. So indeed, so code to increase height the further the peaks are over the sealevel sound reasonable. One could even step the savegame to achieve this.

This seems like a good idea.

Quote
On a sidenote. OpenTTD only has double height diagonals, and can also make quite steep mountains wil 20 slope tiles instead of the 56 odd we use.

Interesting!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline kierongreen

Re: Query regarding double/half heights
« Reply #19 on: January 27, 2014, 12:52:26 AM »
Do you mean that straight double height slopes will frequently be generated by players trying to remove corners from the path of ways being created in hilly terrain?
Yes, and trying to build ways that climb hills you will quickly encounter these even if they aren't on the map already.

First: I was also not so much impressed by the infrequency of the perlin hiehgt generate generating double steps. So indeed, so code to increase height the further the peaks are over the sealevel sound reasonable. One could even step the savegame to achieve this.
I'm not sure this is necessarily the way forward - you can get steep slopes close to sea level as well as further away, and likewise with shallow slopes.

On a sidenote. OpenTTD only has double height diagonals, and can also make quite steep mountains wil 20 slope tiles instead of the 56 odd we use.
Indeed - although it's worth pointing out that it's not just plain diagonals steep slopes that are common in simutrans but also various other double height slopes. It's just the straight steep sided slopes that tend to not be generated naturally. As for why, well, when you turn noise up then it's unlikely that you'll get straight edges formed for hills as they tend to be more convoluted. Simutrans uses 65 slopes incidentally.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • Total likes: 7
  • Helpful: 91
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Query regarding double/half heights
« Reply #20 on: January 27, 2014, 10:39:03 AM »
Could it be possible to hack the map generator so that say height levels above the median level tend to be double?


Sent from my iPhone using Tapatalk

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4733
  • Total likes: 180
  • Helpful: 108
  • Languages: EN, NO
Re: Query regarding double/half heights
« Reply #21 on: February 24, 2014, 04:16:16 PM »
I've been wondering, what would be the result if the map generator generated a double height spanning the water level?

Offline kierongreen

Re: Query regarding double/half heights
« Reply #22 on: February 24, 2014, 10:34:57 PM »
At the moment this is broken.

What should happen is that a shallow tile is created - so instead of heights 1,1,-1,-1 you have 1,1,0,0. The problem is getting this working right so that when water level is raised or lowered the landscape around lakes alters correctly. It had been working fine but I think one fix for a different problem broke the code for some reason.