Bug #321

Monorails clipping tunnels

Added by Domestic almost 11 years ago. Updated almost 10 years ago.

Status:ClosedStart date:2009-07-12
Priority:LowDue date:
Assignee:-% Done:

0%

Category:Base
Target version:0.3.0

Description

When monorails go downhill and into a tunnel, they appear to be showing slightly through the ground. This is imediately visible on the start screen (nb: hidden at higher resolutions behind the welcome box). See the attached image to see the clipping. The visible line (colour of train) flickers as it goes into tunnel.

bug.png - As vehicle moves through, the line will appear and dissapear rapidly (36.4 KB) Domestic, 2009-07-12 11:34


Related issues

Related to OpenGFX - Feature #662: Rework trains Closed 2009-12-03

History

#1 Updated by foobar almost 11 years ago

  • Category set to Base
  • Status changed from New to Feedback
  • Target version set to 24

Confirmed. Problem analysis follows.

Possibly caused by:
- Faulty tunnel entrance sprite (missing pixels)
- Longer than TTD rail vehicles (sprites being out of their bounding boxes)

Possible solutions:
- Match size of tunnel sprites to TTD counterparts
- Decrease wagon length (nasty fix)

#2 Updated by Ammler almost 11 years ago

  • Target version deleted (24)

Version 0.1.0+ is meant for extra newgrfs, which won't be used in the base grfs.

#3 Updated by edorfaus almost 11 years ago

foobar wrote:

Possibly caused by:
- Faulty tunnel entrance sprite (missing pixels)

I took a closer look at this sprite(2374), comparing the one in OpenGFX to the one from TTD.

The upper-right border(wrt. transparency) of both have the exact same shape, and the offsets ends up at the same place.
This means either that this sprite is not the problem, or that the original TTD one had the same issue.

Assuming that the sprite length is the problem, it appears not to be limited to the wagons, but also go for the engine - the third train on that line shows one flash of different color when the engine goes in, but I don't see any further blinking (admittedly on a high-dpi screen, so if the color is similar I might just have not noticed for the wagons). This train appears to have wagons that are not as high as the other trains - maybe the problem is not length, but height?

If the sprites are out of their bounding boxes, would it be easier to change the bounding boxes than the sprites? Is that even possible?

#4 Updated by edorfaus almost 11 years ago

I took a closer look at the image and noticed that the white pixels are above where the tunnel entrance sprite is (not on top of it), so I figured I'd check the station sprite just in case that one was the problem. I had some difficulty locating it, but assuming it's 1151 or 1233 (which seem identical), those also have the same shape and offsets as the TTD ones, so can probably be ruled out the same way.

It appears to be the leading edge of the wagons that show up, most likely when a wagon is precisely at the edge of the tunnel entrance sprite, something I think would correspond well with the problem being sprite length.

Maybe it's possible to just make those three pixels that overflow transparent, instead of shortening the entire wagons? The edge of the wagon might start to look odd though, depending on what other wagons it's placed with; I haven't tried it so can't say.

#5 Updated by foobar almost 11 years ago

  • Priority changed from Normal to Low

Caused by full-size wagons. Also happens with default TTD graphics and NewGRF rail set with full-size wagons.

OpenGFX wagons are slightly longer than the TTD ones. Can only be fixed by shortening the rail wagons or by modifying OpenTTD somehow. Last solution is preferred, as that also fixes the same problem with TTD graphics and certain NewGRF sets.

#6 Updated by Ammler over 10 years ago

  • Target version set to 0.3.0

#7 Updated by planetmaker almost 10 years ago

  • Status changed from Feedback to Closed

Trains and wagons have been revised. It cannot be completely avoided. If it's too bad, request a re-open

Also available in: Atom PDF