Open EratoNysiad opened 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?
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.) (also, the sloped catenary bounding box seems too wide)
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.
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!
I asked the original reporter if this problem still exists, and they said yes.
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.
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.
A few issues have been raised here. I'll comment some of them:
/**
* Some values for constructing bounding boxes (BB). The Z positions under bridges are:
* z=0..5 Everything that can be built under low bridges.
* z=6 reserved, currently unused.
* z=7 Z separator between bridge/tunnel and the things under/above it.
*/
static const uint BB_HEIGHT_UNDER_BRIDGE = 6; ///< Everything that can be built under low bridges, must not exceed this Z height.
static const uint BB_Z_SEPARATOR = 7; ///< Separates the bridge/tunnel from the things under/above it.
For reference here is the savegame for the screenshots from above: catenary_sorting.zip
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.