Page 1 of 1

additional sprite offset for station rail types

Posted: 18 Aug 2014 20:27
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

Re: additional sprite offset for station rail types

Posted: 23 Aug 2014 16:38
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

Re: additional sprite offset for station rail types

Posted: 23 Aug 2014 16:54
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

Re: additional sprite offset for station rail types

Posted: 23 Aug 2014 18:35
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

Re: additional sprite offset for station rail types

Posted: 23 Aug 2014 19:02
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

Re: additional sprite offset for station rail types

Posted: 08 Sep 2014 15:05
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