additional sprite offset for station rail types

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

additional sprite offset for station rail types

Post by michael blunck »

nfo-specs state:
nfo specs:Action0Stations:Sprite layout (09) wrote: Depending on the railtype the sprites may get additional offsets: [...] So, TTD sprites [+82, +164] and the first ground sprite [+1, +2] are affected by the railtype [...]
But obviously TTDPatch and OTTD differ in what exactly means "the first ground sprite" when talking about "multiple ground sprites".

See waypoint bug report by Drakous79 here: http://www.tt-forums.net/viewtopic.php? ... 2#p1129022

Layout for those waypoints is defined in this way:

Code: Select all

  tile(
      ground(1012) // track
      normal(0, xyoff(0,0)) // overlay
      normal(2, xyz(0,0,0),dxdydz(16,5,10)) // building
  )
  tile(
      ground(1011) // track
      normal(1, xyoff(0,0)) // overlay 
      normal(3, xyz(0,0,0),dxdydz(5,16,10)) // building
  )
Interestingly, this works flawlessly in OTTD, but not in TTDPatch which adds +1 for monorail to the "overlay" sprite number, i.e. for x-direction it therefore draws the overlay in y-direction, and for y-direction it draws the building sprite in x-direction (see pic in said post).

Who´s wrong here, TTDPatch or OTTD? Makes no sense to handle it differently for both, from a newGRF developer´s POV.

regards
Michael
Image
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: additional sprite offset for station rail types

Post by Lakie »

What's the issue precisely, is it that you don't feel the overlay ground sprite should be adjusted like the actual ground sprite?

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: additional sprite offset for station rail types

Post by michael blunck »

Lakie wrote: What's the issue precisely ..
Identical code produces different results in TTDPatch/OTTD.
Lakie wrote: .. is it that you don't feel the overlay ground sprite should be adjusted like the actual ground sprite?
"Offset" isn´t about sprite adjusting, but about "adding an additional offset" to the sprite number for monorail and maglev:

Image

regards
Michael
Image
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: additional sprite offset for station rail types

Post by Lakie »

Without understanding what the intended behaviour should be; it isn't possible to identify which is wrong. TTDPatch does indeed adjust the (custom) sprite number for the overlay ground sprite by adding the track type to it. I believe this is by design to allow customized overlay ground sprite for each (default) rail type.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: additional sprite offset for station rail types

Post by michael blunck »

Lakie wrote: Without understanding what the intended behaviour should be; it isn't possible to identify which is wrong. TTDPatch does indeed adjust the (custom) sprite number for the overlay ground sprite by adding the track type to it. I believe this is by design to allow customized overlay ground sprite for each (default) rail type.
I remember having already pointed out this flaw a couple of years ago, but get flamed immediately by a OTTD developer.

Indeed, implementation of "multiple ground tiles" is different in TTDPatch and OTTD (causing problems when using mono/maglev rail in stations), and I still wonder why.

regards
Michael
Image
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: additional sprite offset for station rail types

Post by Lakie »

As a work around, couldn't you just duplicate the overlay ground sprite (for each rail-type) and simply adjust all the sprite numbers accordingly?
I understand its frustrating to have further inconsistent behaviour between OpenTTD and TTDPatch in regards to stations.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 16 guests