OpenTTD / OpenTTD

OpenTTD is an open source simulation game based upon Transport Tycoon Deluxe
https://www.openttd.org/
Other
6.35k stars 891 forks source link

Wires incorrectly drawn on top of pylons that should be in front #7675

Open EratoNysiad opened 5 years ago

EratoNysiad commented 5 years ago

Version of OpenTTD

1.9.2

Expected result

When developing new graphics for catenary where the pylons overlap with the wires (see image below), I expect pylons that are visually in front of the wires, to be drawn over the wires, instead of having the wires drawn over the pylons.

Actual result

https://i.imgur.com/JQbOhQE.png The wires get drawn on top of the pylon that goes in front. Only seems to happen in the NW-SE direction.

Steps to reproduce

Either make new pylon graphics. Make them like bright purple or w/e and make them tall enough that the pylon graphics overlap with the wires. Alternatively, load up a copy of Auztracks 4 and build the Main line very high speed (catenary) tracks, which should look like this: https://i.imgur.com/hxmeqCL.png If you look at the sprite of the pole itself you see that the top should be flat, however you can see that the wire has "chopped" off a piece of the pole.

LordAro commented 5 years ago

This sounds like it could be another instance of #119, as documented in known_bugs.txt Bounding boxes should confirm - can you screenshot with them turned on?

Eddi-z commented 5 years ago

Seems like the pylon bounding boxes are not high enough for the sprite sorter to recognize them as relevant. you might try to make them taller, but that might collide with other things (stations, bridges, etc.) Unbenannt, 1  Jan 1965#10 (also, the sloped catenary bounding box seems too wide)

EratoNysiad commented 5 years ago

image It should be noted that it only draws them incorrectly in the NW-SE situation (left in this image), but I can't see a real difference between the two bounding-box wise. Making the bounding boxes taller might help. There is some space left before they start overlapping with the bounding box of tunnels and bridges, so that might be an idea.

TrueBrain commented 3 years ago

I am wondering if making them taller indeed solved the issue, and/or if this issue is still relevant?

Sorting anything in an isometric world is very difficult, and often there is no right answer. But we do our best :D So please let us know if this is still relevant :) Tnx!

2TallTyler commented 2 years ago

I asked the original reporter if this problem still exists, and they said yes.

PikkaBird commented 1 year ago

I can confirm this is still a problem. Poles show behind wires they should be in front of, sometimes with glitching as a vehicle drives past. Poles also show underneath bridges they should be in front of. Test grf attached.

Noodlespool Transport, 1950-07-07

wiretest.zip

I suspect making the bounding boxes for the poles taller would help. Station tiles can disable the default pylons and draw their own (or not), so sprite ordering there is not too much of a concern.

frosch123 commented 9 months ago

A few issues have been raised here. I'll comment some of them:

For reference here is the savegame for the screenshots from above: catenary_sorting.zip