New Rail Types

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Re: New Rail Types

Post 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.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: New Rail Types

Post 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.
dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Re: New Rail Types

Post 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.
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: New Rail Types

Post 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. :cry:
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Re: New Rail Types

Post 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.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: New Rail Types

Post 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...
He's like, some kind of OpenTTD developer.
dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Re: New Rail Types

Post 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.
dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Re: New Rail Types

Post 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?
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: New Rail Types

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

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 12 guests