News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Query regarding double/half heights

Started by jamespetts, January 26, 2014, 08:05:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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.

Dwachs

It should depend on map creation settings (roughness, mountain height etc).
Parsley, sage, rosemary, and maggikraut.

Ters

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.

jamespetts

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.

kierongreen

You'll need to push it to the limits for maximum height or roughness - with roughness being more important.

jamespetts

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.

kierongreen

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.

The Hood

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...

jamespetts

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.

kierongreen

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.

jamespetts

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.

kierongreen

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.

Sarlock

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

kierongreen

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.

jamespetts

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.

kierongreen

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!

jamespetts

Quote from: kierongreen 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!

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.

prissi

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.

jamespetts

Quote from: prissi 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.

This seems like a good idea.

QuoteOn 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.

kierongreen

Quote from: jamespetts on January 26, 2014, 11:20:50 PM
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.

Quote from: prissi 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.
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.

Quote from: prissi on January 26, 2014, 11:41:02 PMOn 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.

Fabio

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

Ters

I've been wondering, what would be the result if the map generator generated a double height spanning the water level?

kierongreen

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.