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

Station sets using ground tile numbers using incorrect tiles for maglev and monorail #7662

Closed
EratoNysiad opened this issue Jul 20, 2019 · 2 comments
Labels
component: NewGRF This issue is related to NewGRFs needs triage This issue needs further investigation before it becomes actionable

Comments

@EratoNysiad
Copy link
Contributor

Version of OpenTTD

1.9.2

Expected result

Station tiles using tile 3981 as ground tile should show up as grass when placed.

Actual result

For monorail it loads a coast tile and for maglev it loads a farmland tile.
https://imgur.com/a/IFjC2nT

Likely culprit

Basetiles for track are, for instance tiles 1011, 1093 and 1175 for rail, monorail and maglev respectively.
Monorail and maglev are thus 82 and 164 sprites "higher" than normal rail. Adding those numbers to 3981 gives you 4063 and 4145, which are the exact sprites shown.

Steps to reproduce

load either North Korean station set or Dutch Stations Addition Set Part 2.
Select Monorail (it's blatantly obvious there)
For the North Korean set look at the "Non-Track Tiles" tab.
For the Dutch set look at the "Non-track tiles" tab.

@Yexo
Copy link
Contributor

Yexo commented May 30, 2020

I haven't looked at those particular NewGRFs yet, but it isn't clear to me that this is a bug in OpenTTD rather than those NewGRFs. From the spec (https://newgrf-specs.tt-wiki.net/wiki/Action0/Stations#Sprite_layout_.2809.29):

Depending on the railtype the sprites may get additional offsets:

  Normal/electrified rail Monorail Maglev
TTD sprites 0 82 164
Action 1 sprite (first ground sprite) 0 1 2
Action 1 sprite (other sprites in the layout) 0 0 0

So, TTD sprites and the first ground sprite are affected by the railtype, while other action 1 sprites in the layout are not. The offset "82" refers to the offset between the default TTD track sprites; if you are using non-track ground sprites which are not from an action 1, you need to supply fake spritenumbers which preemptively reverse the offsets (that is, you need different sprite layouts for every railtype your station is available for).

@2TallTyler 2TallTyler added component: NewGRF This issue is related to NewGRFs needs triage This issue needs further investigation before it becomes actionable labels Oct 19, 2022
@frosch123
Copy link
Member

This is a difficult part / trap in the NewGRF specs.
OpenTTD's behavior is correct.
The NewGRFs need fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs needs triage This issue needs further investigation before it becomes actionable
Projects
None yet
Development

No branches or pull requests

4 participants