New Rail Types
Moderator: OpenTTD Developers
Re: New Rail Types
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
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
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.
-
- Tycoon
- Posts: 1829
- Joined: 10 Jul 2006 00:43
- Location: Spain
Re: New Rail Types
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.
But these changes must be made by someone and It is not easy to add these features.

Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
Re: New Rail Types
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
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...
He's like, some kind of OpenTTD developer.
Re: New Rail Types
Okay, fair enough. The implementation of railtypes being perfect otherwise, I think you can be forgivenpetern wrote:You can't at the moment because I forgot to write that bit.

I'll make a feature request on flyspray.
Re: New Rail Types
*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?
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
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.
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.
Who is online
Users browsing this forum: No registered users and 12 guests