Catenary sprites problem
Moderator: OpenTTD Developers
- Emperor Jake
- Tycoon
- Posts: 3427
- Joined: 24 Apr 2007 09:37
- Skype: Discord: Emperor Jake #4106
- Location: Not Actually Japan
- Contact:
Catenary sprites problem
While coding some stuff, I seemingly found a problem in the order in which OpenTTD draws catenary sprites. In the \ and _ views, if the poles are at the bottom of the tracks, the game draws the wires on top of the poles. This causes graphical glitches when using taller catenary poles. The / views behave as they should. (I have adjusted the alignments to show the effects of the wrong sprite order, that's why the pole sticks out of the track)
- Attachments
-
- catenary.png (45.59 KiB) Viewed 543 times
Last edited by Emperor Jake on 21 Feb 2015 09:18, edited 1 time in total.
- Voyager One
- Tycoon
- Posts: 11204
- Joined: 28 Dec 2009 09:47
- Location: Rijeka, Croatia
Re: Catenary sprites problem
... not to mention that these sprites place poles in the middle of tracks... see circled pole at the bottom...
Weird, I never have noticed it but I have to ask you what track set are you using? Normal OTTD rails have gray poles and they don't seem to show these problems.
Weird, I never have noticed it but I have to ask you what track set are you using? Normal OTTD rails have gray poles and they don't seem to show these problems.
- Emperor Jake
- Tycoon
- Posts: 3427
- Joined: 24 Apr 2007 09:37
- Skype: Discord: Emperor Jake #4106
- Location: Not Actually Japan
- Contact:
Re: Catenary sprites problem
As I said I realigned the sprites so that the problem would be clearer. I also used the brown poles so they would contrast with the wires. You can reproduce this problem with the default catenary sprites and moving them with the sprite aligner, so it's not the fault of my NewGRF. It's not apparent with the default catenary or Purno's catenary at first glance, but I noticed it when I made taller poles for my current WIP.Voyager One wrote: ... not to mention that these sprites place poles in the middle of tracks... see circled pole at the bottom...
The sprites are from an old version of my Trains of Europe Track set, which was never officially released, but I am working on something
Re: Catenary sprites problem
i suppose this is a problem with too small bounding boxes.
- Emperor Jake
- Tycoon
- Posts: 3427
- Joined: 24 Apr 2007 09:37
- Skype: Discord: Emperor Jake #4106
- Location: Not Actually Japan
- Contact:
Re: Catenary sprites problem
I've found an older thread documenting this same problem.
As you can see, this problem is also apparent with the zBase default catenary.
As you can see, this problem is also apparent with the zBase default catenary.
Re: Catenary sprites problem
What i mean with too small bounding box:
the bounding box of the pylon is not tall enough to reach in front of the catenary, so the game treats these as two unrelated objects, which can go in any order.
the bounding box of the pylon is not tall enough to reach in front of the catenary, so the game treats these as two unrelated objects, which can go in any order.
- Attachments
-
- Unbenannt, 1. Jan 1925#4.png (38.03 KiB) Viewed 2404 times
- Emperor Jake
- Tycoon
- Posts: 3427
- Joined: 24 Apr 2007 09:37
- Skype: Discord: Emperor Jake #4106
- Location: Not Actually Japan
- Contact:
Re: Catenary sprites problem
That seems to make sense, but it doesn't explain why the / view is drawn properly, is it random?. Would making the bounding boxes taller fix it and how hard would that be?Eddi wrote:What i mean with too small bounding box:
the bounding box of the pylon is not tall enough to reach in front of the catenary, so the game treats these as two unrelated objects, which can go in any order.
Here's a preview of my work in progress; I've made the poles so that the issue is barely visible, so it's not hugely important. I'd liked to have made them taller though.
Re: Catenary sprites problem
Making the bounding boxes taller may fix this, but it may also break all bridges.
Hard to predict, but you can try it: Look for BB_HEIGHT_UNDER_BRIDGE in elrail.cpp and replace it with some bigger value. But given my comment from the past, maybe that was already tried:
Hard to predict, but you can try it: Look for BB_HEIGHT_UNDER_BRIDGE in elrail.cpp and replace it with some bigger value. But given my comment from the past, maybe that was already tried:
However, generally it is not possible to fix all glitches (you can prove that). You can only try to minimize the glitches to a few pixels. And the catenary/pylon issue is about very few pixels.static const uint BB_HEIGHT_UNDER_BRIDGE = 6; ///< Everything that can be built under low bridges, must not exceed this Z height.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Catenary sprites problem
uhm, but catenary is removed under low bridges? and the pylons are basically on the adjacent tile?
Re: Catenary sprites problem
I just noticed new bounding boxes for catenary sprites.
I assume this was done to resolve some of the issues discussed above.
Now I recently noticed that the top of the poles (yellow circle) are prone to random clipping.
Would extending the bounding box to the red lines resolve this?
I assume this was done to resolve some of the issues discussed above.
Now I recently noticed that the top of the poles (yellow circle) are prone to random clipping.
Would extending the bounding box to the red lines resolve this?
- Attachments
-
- NEW BOUNDING BOXES POLE TOP..png (8.77 KiB) Viewed 1429 times
wallyweb on tt-forums: Screenshots - Wallyweb World - Projects & Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
Re: Catenary sprites problem
it might solve some clipping issues, but it might as well introduce others.
Who is online
Users browsing this forum: No registered users and 23 guests