Page 10 of 10
Re: New Rail Types
Posted: 09 May 2010 23:35
by dandan
I have a question on coding the new railtypes: How do I select what tunnel and bridge graphics a new railtype should use? I expected it would follow the value of property 12, which selects the default station graphics to use, but that does not seem to be the case. At the moment, I always end up with the standard rail graphics.
Re: New Rail Types
Posted: 09 May 2010 23:59
by Zephyris
I haven't tried it myself, and I don't know how accurate these instructions are, but according to
these specs you need to define some overlay graphics which are layered onto the existing tunnel and bridge graphics... It should then be fully automatic.
Re: New Rail Types
Posted: 10 May 2010 00:08
by dandan
Yes, and that works just fine. But on top of the track overlays you provide, OpenTTD will of course still place the tunnel graphics, either the original ones or whatever some landscape or tunnel set has provided. And these come in three flavours (rail, monorail, maglev) and I see no way to select which one gets used.
Re: New Rail Types
Posted: 10 May 2010 00:59
by maquinista
Bridges needs lots of changes. Loading custom sprites (instead of replacing unused toyland sprites), one way bridges, custom pylons layouts, custom sprite layouts, custom bridge heads...
But these changes must be made by someone and It is not easy to add these features.

Re: New Rail Types
Posted: 10 May 2010 03:44
by dandan
You are certainly right that NewGRF bridges are very unsatisfactory at the moment, and the devs are well aware of that. But I'm asking for something much, much simpler. Just a question of choosing which type of graphics should be used for tunnels (and maybe bridges). Since it's done for station graphics, I don't see why it shouldn't be possible for tunnels, too.
Re: New Rail Types
Posted: 10 May 2010 07:04
by peter1138
You can't at the moment because I forgot to write that bit. I'm sure someone could come up with a patch for it...
Re: New Rail Types
Posted: 10 May 2010 15:18
by dandan
petern wrote:You can't at the moment because I forgot to write that bit.
Okay, fair enough. The implementation of railtypes being perfect otherwise, I think you can be forgiven

. I was more afraid that there might be some conceptual reason that I couldn't think of.
I'll make a feature request on flyspray.
Re: New Rail Types
Posted: 02 Aug 2010 04:27
by dandan
*BUMP* The situation with tunnel portals is still very unsatisfactory. Let me sum it up again:
Problem: The graphics for tunnel portals are not part of the rail types feature. (I am NOT talking about the track overlays for tunnel entrances, which are working fine.) Since the tunnel portal sprites currently involve parts of the ground sprite, they depend on the terrain type. What is worse is that there is no way to select which one of the three sets of tunnel portal graphics (rail, monorail, maglev) is used with a new rail type which means that ALL new rail types have to use the same graphics.
So at the moment, we have to use the same tunnel graphics for, say, 19th century narrow gauge tracks and Transrapid maglev lines.
Possible solutions:
1) Extend property 12, which determines which default stations graphics are used, to also cover tunnel portals.
2) Include tunnel portals into the new rail types feature, so that terrain-independent overlays can be specified for each new rail type.
I think that 2) would be a much better solution. But it is obviously more work to implement, while 1) should be pretty easy for anyone with some knowledge of the code, as far as I can tell.
Any thoughts?
Re: New Rail Types
Posted: 02 Aug 2010 10:32
by FooBar
I think /both/ solutions can be useful and not only one should be chosen.
Solution 2 will probably result in tunnel portals without terrain, as there is a top-sprite required that covers the train. Drawing terrain on this again makes the tunnel base-set dependent.
Drawing a custom tunnel portal could be done as follows: draw sloped terrain sprite from base graphics, draw user-provided terrain overlay which will cut into the terrain and includes the track, draw user-provided overlay that will cover the train.
Cargo-type 03 can be extended for this:
- if 4 sprites are provided, current behaviour is used where property 12 (or an additional property) defines what type of base set tunnel to draw.
- if 8 sprites are provided, underlay and additional overlay are drawn on top of normal sloped terrain sprite, as described above.