Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for NRT tunnels #79

Closed
Andrew350 opened this issue Dec 22, 2019 · 11 comments
Closed

No support for NRT tunnels #79

Andrew350 opened this issue Dec 22, 2019 · 11 comments

Comments

@Andrew350
Copy link

@Andrew350 Andrew350 commented Dec 22, 2019

Currently the NML language has no support for providing tunnel sprites for roadtypes or tramtypes. Inclusion of both the "tunnels" and "tunnel_overlay" callbacks for these features would be ideal to allow authors to complete their NRT NewGRFs in time for OpenTTD 1.10.

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Feb 21, 2020

Original frosch spec includes tunnels. https://wiki.openttd.org/Frosch/NotRoadTypes#Tunnel

[digging]

I don't see tunnels in the nfo spec or https://wiki.openttd.org/NewGRF_Specification_Status#OpenTTD_1.10

[further digging]

I don't know how action 3 is resolved, but tunnel is missing for RoadTypeSpriteGroup:
https://github.com/OpenTTD/OpenTTD/blob/13cc8a0ceec90def39cbcb84135a0bf039793a6f/src/road.h#L54

Whereas it's present for RailTypeSpriteGroup: https://github.com/OpenTTD/OpenTTD/blob/b769eb30c43ccbc4e60b8b7df024253ac55d2265/src/rail.h#L43

@glx22
Copy link
Contributor

@glx22 glx22 commented Feb 21, 2020

I don't see any use of overlays when a road tunnel portal is drawn
https://github.com/OpenTTD/OpenTTD/blob/b769eb30c43ccbc4e60b8b7df024253ac55d2265/src/tunnelbridge_cmd.cpp#L1264-L1274
So NML can't support a non existing feature ;)
Unless we are talking about catenary overlay
https://github.com/OpenTTD/OpenTTD/blob/b769eb30c43ccbc4e60b8b7df024253ac55d2265/src/tunnelbridge_cmd.cpp#L1292-L1306

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Feb 21, 2020

@glx22 so is your conclusion that there's no support in OpenTTD for custom road (or tram) tunnel sprites?

That's my understanding, from reading src.

OpenTTD ticket needed?

@glx22
Copy link
Contributor

@glx22 glx22 commented Feb 21, 2020

Yes that's my understanding, only catenary overlays are supported, both in openttd and nml.

BTW example on https://newgrf-specs.tt-wiki.net/wiki/NML:Roadtypes is wrong, there's no "tunnels" callback

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Feb 21, 2020

BTW example on https://newgrf-specs.tt-wiki.net/wiki/NML:Roadtypes is wrong, there's no "tunnels" callback

Thanks, fixed.

@frosch123
Copy link
Member

@frosch123 frosch123 commented Feb 21, 2020

Roadtypes do not include tunnels for the same reason they do not include bridges and stations.
On one tile there can be both road and tram, but only one tunnel/bridge/station.
Tunnels would be part of https://wiki.openttd.org/Frosch/ButGroundTypes , but NRT they make no sense.

@frosch123 frosch123 closed this Feb 21, 2020
@Andrew350
Copy link
Author

@Andrew350 Andrew350 commented Feb 22, 2020

@frosch123 Ok, so the idea was that roadtypes were not going to have the ability to provide custom tunnel entrances like railtypes do, in favor of waiting for a whole new schema of ground types? I love the spec proposed there, but with all due respect it sounds like another huge project which is years away. Meanwhile NRT is already going "live" in a month or so, and it would be nice in the meantime to at least have a basic implementation to provide some custom tunnel sprites similar to railtypes. Is that at least open to consideration?

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Feb 22, 2020

For NRT tunnels, the blocker is that there's no rationale for determining whether to draw the tram tunnel, the road tunnel, or overlap sprites for both on the same tile. :)

If both the road type and the tram type on the tile provide tunnel sprites, I can't envisage that looking good.

With catenary, both the road type and the tram type can provide the sprites, and authors need to make sure that doesn't look bad by keeping catenary sprites simple so they can be combined. That's going to fail sometimes, but at least it allowed NRT to be implemented.

But for tunnels I can't figure out a way to use the same approach and have any hope of a good result :)

@Andrew350
Copy link
Author

@Andrew350 Andrew350 commented Mar 7, 2020

Ok, I guess I can understand the issue with drawing the portals, so how about a callback for just the road/tram surfaces, not including the "structure"? That is definitely in-scope of NRT and doesn't involve any conflict of which sprite to draw over another.

That at least would allow for some very basic control of tunnels for NRT authors until something better comes along :)

@frosch123
Copy link
Member

@frosch123 frosch123 commented Mar 7, 2020

Tunnels already draw the normal road/tram overlay, just like rail types also do. Why would they need to be different?

@Andrew350
Copy link
Author

@Andrew350 Andrew350 commented Mar 7, 2020

Tunnel portals are quite narrow, so the normal road tiles sometimes overlap the sides of the tunnel (essentially the same reason why bridges have special overlay sprites, to make them "fit") . It would also allow for shadows/lighting inside the tunnel for better effect, and just to make things prettier in general :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.