The International Simutrans Forum

Community => Simutrans Gaming Discussion => Topic started by: AP on July 16, 2009, 06:58:36 PM

Title: Steeper/Mountainous maps
Post by: AP on July 16, 2009, 06:58:36 PM
Hi all.

Was just thinking, thought I'd throw this idea to the floor for general comment.

The simutrans terrain is good, when it comes to emulating wide open countryside, rolling hills, and now rivers (  :D ),  complete with, forest, desert, and fields, but what it doesn't do a great job of is mountains and more serious terrain. One of the most challenging things to contemplate is to construct an infrastructure through severe terrain, to build a rail line clinging to a mountain slope, to spiral tracks over each other and span deep ravines, connect with ferrys along lakes and fjords, and all the stuff that makes pretty postcard images.

(http://trainholidays.files.wordpress.com/2008/09/swiss2.jpg)
(http://www.bls.ch/images/content/infrastruktur/trassen.jpg)
(http://k43.pbase.com/g6/21/622621/2/81650112.f7xQKm36.jpg)


I am interested to see, for instance, that the experimental simutrans is working on a way to make trains handle gradients more realistically.

What I was also wondering, however, is if there is potential for a terrain alteration. So what about this: (?)

As well as the current terrain slope (1:1, 45 degrees), a new terrain slope tile is created: a 2:1 tile (up 2 levels in the space of 1 tile). This would require a few extra corner terrain tiles as well (and I'm not certain how you join a 1:1 slope to a 2:1 slope beside it...)

It would seem that such an idea would allow a geography which could very quickly gain altitude, and build "impassible" terrain, deep valleys etc, which would have to be engineered or diverted around (unless someone comes up with a rack railway system...).

Any thoughts? Any better ways of achieving the above?
Title: Re: Steeper/Mountainous maps
Post by: LeifInge on July 16, 2009, 08:23:59 PM
Coming from Norway I think this is a great idea :)
Title: Re: Steeper/Mountainous maps
Post by: KrazyJay on July 16, 2009, 09:07:59 PM
I just love to see those train pics RRRROOOAARRRR!!

On topic: I vaguely remember this has been discussed before, I remember it came down to the effort that had to be taken for creating new tiles, bridges, tracks and so on, but if you want to keep those steeper tiles too rough to be used for tracks and stuff, I guess that sheds a new light on this proposal; it just sticks to new tiles only then, making it more realistic to achieve concerning the time it needs to create the extra files...
Title: Re: Steeper/Mountainous maps
Post by: Severous on July 16, 2009, 11:23:05 PM
I was thinking about a scenario with difficult terrain.  With standard pak 128 we can make a fairly rough terrain.  Admittedly not as steep as those great pictures above..but rough enough to make route building a bit more challenging.

(http://img189.imageshack.us/img189/7848/simscr05.th.png) (http://img189.imageshack.us/i/simscr05.png/)

Pity we cant hug the terrain very well. The track on the left cant be connected without earth works.
Title: Re: Steeper/Mountainous maps
Post by: gerw on July 17, 2009, 06:20:06 AM
It's now the 3rd time in the last ~2 weeks, that I'm get in contact with the ideas of this double slopes :)

Prissi told me, that in past versions (90.x) simutrans could handle slopes with two different gradients. So most of the code is already there, but the part of the code, which generates the images of the slopes out of the lightmaps and the textures has to been rewritten for double slopes. But that should be not more than a little bit copy+paste - and thinking :)

Another problem is, that the generation of the map won't create such steeps slopes very often, therefore 'regular' maps won't have a profit from double slopes. But user-made or heightmap-maps could benefit from it.
Title: Re: Steeper/Mountainous maps
Post by: prissi on July 17, 2009, 09:14:55 AM
Also many other issue with way and bridges and so on where not fixed and some new parts do not work. Also instead of 32 tiles per climate this would require like 972 tiles per climate which means with 7 climates a total of 6800 tiles. And it would require new images for the grey maps and transitions. Judging from the work I did last time I would be still quite an effort for very little visual effect. If I have time, I will compile an old version for those who want to try.

Nevertheless, this would still not give realy montains. Remeber one tile is essentially one 1km square! Thus any real high mountion would still cover an immense area.
Title: Re: Steeper/Mountainous maps
Post by: AP on July 17, 2009, 08:26:00 PM
Quote from: gerw on July 17, 2009, 06:20:06 AMIt's now the 3rd time in the last ~2 weeks, that I'm get in contact with the ideas of this double slopes :)
Great minds and all that... :D

Quote from: gerw on July 17, 2009, 06:20:06 AMPrissi told me, that in past versions (90.x) simutrans could handle slopes with two different gradients.
Wow! Was it playable? And perhaps more interestingly, does anyone know why the feature was removed? Or rather, mothballed, if I'm understanding correctly.

Quote from: gerw on July 17, 2009, 06:20:06 AMSo most of the code is already there, but the part of the code, which generates the images of the slopes out of the lightmaps and the textures has to been rewritten for double slopes. But that should be not more than a little bit copy+paste - and thinking :)

Another problem is, that the generation of the map won't create such steeps slopes very often, therefore 'regular' maps won't have a profit from double slopes. But user-made or heightmap-maps could benefit from it.
Interesting. Presumably the map-generation could itself be "improved" if it were later deemed desirable, as a seperare thing. I just really think that more varied terrain would add to gameplay.

Quote from: prissi on July 17, 2009, 09:14:55 AMRemeber one tile is essentially one 1km square! Thus any real high mountion would still cover an immense area.
Well now, that could be debated - I know *technically* that's the simutrans definition, but i also know I'm not the only one who puts effort into making my villages and towns look like villages and towns 1-house = 1 house, not abstract representations of something else.

Besides - on a 2048x2028 map, I think one could engineer a sufficiently convincing mountain or three if given the chance...  ;D
Title: Re: Steeper/Mountainous maps
Post by: Matthi205 on July 21, 2009, 01:34:29 PM
Living in Bulgaria I like that idea!How about curved bridges?
Title: Re: Steeper/Mountainous maps
Post by: AP on July 21, 2009, 08:12:21 PM
Can we move this thread to "extension requests" ? Given that there's interest, I mean...
Title: Re: Steeper/Mountainous maps
Post by: Isaac Eiland-Hall on July 21, 2009, 08:50:04 PM
Given Prissi's reply, I don't think it would serve a purpose to move there.
Title: Re: Steeper/Mountainous maps
Post by: Ashley on August 18, 2009, 02:39:23 PM
I just found these images from the last time I had a play with 2-height tile graphics. I gave up on this project due to lack of code support in Simutrans, and I haven't really thought about it in my own game project since it's quite complex and, IMO, not the right way to "do" mountains (it would look pretty cool however, and would certainly make the terrain more interesting).

Of course, as others have said, the main problem with this approach isn't the graphics. Changing all the code for tunnel/bridge building, way building, routing, etc. etc. to take account of two different slope steepnesses may not really give the appropriate benefit...

It'd be much better IMO to use the half-height slopes alone, and then make mountains by some other means. Or, better yet, switch to using 3D graphics and have a "proper" heightmap.

Anyway, enjoy the images :)

(http://entropy.me.uk/simutrans/ground/lightmap-half-height-annotated.png)
(http://entropy.me.uk/simutrans/ground/lightmap-half-height.png)
(http://entropy.me.uk/simutrans/ground/lightmap.png)
Title: Re: Steeper/Mountainous maps
Post by: Fabio on August 18, 2009, 09:54:17 PM
IMHO, tunnels should be built only on full slope, as well as bridges. tracks should go only through half slopes (as well as rivers/canals), roads on both. ;)
Title: Re: Steeper/Mountainous maps
Post by: TrainMith on August 19, 2009, 07:05:37 AM
I'd also like to see "natural" features like a rock ledge where the height difference between two adjacent squares is two or more units.  Actually, I don't think my idea is too difficult:  When raising/lowering terrain in the game, there already is a block and mortar wall graphic. 
Title: Re: Steeper/Mountainous maps
Post by: The Hood on August 19, 2009, 07:38:57 AM
I would agree with both the above ideas.  Rail and navigable river should only go up half tiles (otherwise too steep), road, tram, and un-navigable river up whole height tiles, and also allow cliffs, natural vertical slopes, to be generated in map creation.  Would also be good to allow tunnels straight into vertical cliff as well as into whole slopes.  As a non-programmer though, I can dream without worrying too much about practicalities of these ideas...! ;)
Title: Re: Steeper/Mountainous maps
Post by: Fabio on August 19, 2009, 02:32:05 PM
a first and simpler approach for map generation could relate slope steepness to height level. from seaside to level 3, the map will have 1/2 slopes, from level 3 to level 6 the map will have full slopes, from level 6 up could have 1+1/2 slopes. obviously these levels need to be adjusted as it happens with climates. the clearance to pass under a bridge or in a tunnel could be set in vehicle specifics (requiring certain vehicles to have a specific clearance, full slope being the default).
indivisual slopes could be adjusted with slope tools.
Title: Re: Steeper/Mountainous maps
Post by: Amelek on August 19, 2009, 03:50:55 PM
while your double/multiple height in one title seem interesting, I think we could have cool terrain by other simple mod:

Take a look at new map: you will notice that it's extremely smooth. Now, if you take a look at images at top of this topic, you will notice, that they are, in fact, made from high rocky walls. I think, it would be, for now, much easier to alter map making script to create "artificial slopes" in mountains. And I think, this would be sufficient to make it look cool. Maybe altering default max-height of stone wall would be required though.
Title: Re: Steeper/Mountainous maps
Post by: Ashley on August 19, 2009, 04:42:51 PM
I did some more thinking, the way I'd do this is to define two different terrain "levels", one for rock, one for "ground". The ground and rock systems would be essentially seperate, with the rock having about 4x the total rise/fall per square as the ground. A two-height system could be implemented here too, though the edge cases would likely start to get complicated. The idea though is that you generate the rock and ground layers independantly using two perlin noise functions (one with a greater persistence value, resulting in much steeper variations in terrain). The ground layer would then be overlayed on the rock one, and where the rock pokes through you get mountains. The rock layer wouldn't be navigable (e.g. you can't build tracks on it) but you can tunnel through it (at higher cost).

The issue with using vertical cliffs (and even tiles "steeper" than the standard Simutrans ones) is that you start to obstruct objects behind the terrain. You could always just have a function to make the mountains transparent in this case though I suppose.

You could extend this further, maybe adding another layer on top of this for even shallower ground. I think two layers, each with two heights would be optimal though. Or even just two layers with single height variation (to reduce the complexity of the tileset). I'd probably want to generate the tileset using 3D methods if the former was attempted (it took me long enough to do that set above!)

You could of course extend this method, using the perlin noise to generate pockets of minerals for industry, or tree cover, or the ground water level (which would lead you to lakes, and then use volumetric flow modelling (highly simplified) to make rivers etc.). But that's outside the scope of this discussion. All features that'll make it into my game engine sooner or later though :)

Honestly though, for this kind of thing a hybrid 3D/2D engine is going to become desirable. The ground tiles in Simutrans are already effectively rendered, you could stick to the rigid isometric grid approach and implement a simple 3D engine to render the terrain and it'd likely look pretty good, much better than restricting to a set of tiles which must be drawn by hand (or you could compromise and meet halfway, have the tiles generated procedurally, for example, I'll likely do it this way).
Title: Re: Steeper/Mountainous maps
Post by: isidoro on August 20, 2009, 01:12:31 AM
A similar approach is the one I'm following for my game.  The map is a mesh of four heights: snow, water, land, and rock, each one on top of the following one.  There will be no restrictions for the difference of height of two adjacent points.  The resulting map is rendered 3D with triangles and it looks tile-based (see the attached images).
Title: Re: Steeper/Mountainous maps
Post by: Ashley on August 20, 2009, 09:15:06 AM
Hey Isidoro, I'd like to hear more about your game, do you have a website or anything for it?
Title: Re: Steeper/Mountainous maps
Post by: isidoro on August 20, 2009, 11:33:25 PM
It's in a very preliminary state.  If everything goes well, it will be a city-building transportation game.  My plan is to build a first simple version and documentation before releasing it.  Now, I have:
Attached is an image of terrain rendering as of r16.
Title: Re: Steeper/Mountainous maps
Post by: Ashley on August 20, 2009, 11:36:51 PM
Looks very interesting :) Do please keep us updated on your progress, maybe start a thread somewhere on the forum to post updates?


On an unrelated note, I found another old image, demonstrates tiles for higher (1.5x and 2x Simutrans standard) tiles. Along with part of a crazy tileset idea I had which didn't pan out :D

(http://entropy.me.uk/simutrans/ground/ground.png)
Title: Re: Steeper/Mountainous maps
Post by: Fabio on August 21, 2009, 08:16:41 AM
such a kind of terrain (0 :) - 0.5 - 1 - 1.5 - 2 - ∞ [veritcal]) would be *great* in the game, as shown in the image in the right (the 1tile width stripe)!!!
Title: Re: Steeper/Mountainous maps
Post by: sojo on August 21, 2009, 08:42:06 AM
Isidoro I like it. It would be fine if Simutrans could have so nice mountains.
Title: Re: Steeper/Mountainous maps
Post by: Isaac Eiland-Hall on August 21, 2009, 05:52:47 PM
SimCity3 had such terrain - tile-based and four steepness possible per tile... it would be awesome to have that. :D But of course so much work.
Title: Re: Steeper/Mountainous maps
Post by: isidoro on August 21, 2009, 11:00:30 PM
@Timothy: Thanks.  It will be a matter of years, I guess.  If forum administrators don't mind, you, my friends of Simutrans, will be the first to know when I release something or main progress is made.  Now, I'm fighting with resources and factories.  The simulation is intended to be deeper than ST for residences (they are all like little industries that need to be supplied with food and water or population will die).

@Sojo & Isaac:  one never knows...  Impossible is nothing. :)
Title: Re: Steeper/Mountainous maps
Post by: colonyan on August 22, 2009, 02:10:37 PM
@isidoro: Your project seems very,,, very interesting. I wish I've be your help. I wish you a success.
                Other than that, will you open your proper thread, site, blog in near future?
Title: Re: Steeper/Mountainous maps
Post by: isidoro on August 23, 2009, 12:57:18 AM
Thanks. My plan in the (guess far) future is to open the program once the main specifications and goals are settled, upload it to sourceforge or the like, and publish the specifications/manuals on a web site.
Title: Re: Steeper/Mountainous maps
Post by: prissi on August 24, 2009, 03:21:27 PM
Unfourtunately Timothy did not had enough tiles. For hieght of 2 you need 86 different tiles. Or you would have only unmanageable rocky tiles.
Title: Re: Steeper/Mountainous maps
Post by: Maragil on August 24, 2009, 03:55:05 PM
Quote from: isidoro on August 23, 2009, 12:57:18 AM
Thanks. My plan in the (guess far) future is to open the program once the main specifications and goals are settled, upload it to sourceforge or the like, and publish the specifications/manuals on a web site.

Wordpress or wetpaint for the manuals :)
Title: Re: Steeper/Mountainous maps
Post by: Fabio on August 24, 2009, 08:13:37 PM
Quote from: prissi on August 24, 2009, 03:21:27 PM
Unfourtunately Timothy did not had enough tiles. For hieght of 2 you need 86 different tiles. Or you would have only unmanageable rocky tiles.

still possible to paint tho other :)
Title: Re: Steeper/Mountainous maps
Post by: gerw on August 24, 2009, 08:51:05 PM
Quote from: prissi on August 24, 2009, 03:21:27 PM
Unfourtunately Timothy did not had enough tiles. For hieght of 2 you need 86 different tiles. Or you would have only unmanageable rocky tiles.
I think, in his first post with images, he had enough: 3^4 = 81
Title: Re: Steeper/Mountainous maps
Post by: Ashley on August 25, 2009, 07:48:00 AM
Quote from: prissi on August 24, 2009, 03:21:27 PM
Unfourtunately Timothy did not had enough tiles. For hieght of 2 you need 86 different tiles. Or you would have only unmanageable rocky tiles.

5 more? I made tiles for all possible combinations of the corner heights 0, 1 and 2 (which I assumed to be enough). I'd be interested to know which additional tiles are required?
Title: Re: Steeper/Mountainous maps
Post by: prissi on August 26, 2009, 03:44:26 PM
You need all tiles with eges either 0,1,2 for four corners. This is 3*3*3*3 tile = 81 tiles. When I am back I will search for the terrain I sed ofr testing double heights.
Title: Re: Steeper/Mountainous maps
Post by: Ashley on August 26, 2009, 08:02:48 PM
That's exactly what I thought/did :) The 8 red tiles are duplicates shifted up a bit, e.g. a tile with corners 0,1,0,0 is the same as a tile with corners 1,2,1,1, just shifted up by 8 pixels. In total there are 81 though. That's referring to the earlier images, not the later one which is just a single-height set with 4 different height values.