-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix land edges glitch when vehicles go through gentle to flat tunnels #23811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix land edges glitch when vehicles go through gentle to flat tunnels #23811
Conversation
Thanks so much for testing all of these. Really appreciate it. It seems like a kind of random selection of door tunnels are affected by this? I'm not really sure what is happening or why. I'll try to get this sorted. Seems like it's not just door tunnels actually. Yeah I think the way I implemented this is just broken. The idea should still work though. Back to the drawing board. |
f42d76d
to
625cc20
Compare
This should be working now. The implementation is simpler and more explicit what it's doing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked a bunch of parks, including the previously tested sprightly park. Tunnels display as expected.
@@ -638,7 +639,9 @@ static void ViewportSurfaceDrawTileSideBottom( | |||
|
|||
if (isWater || curHeight != tunnelArray[tunnelIndex].height) | |||
{ | |||
PaintAddImageAsParent(session, baseImageId, { offset, curHeight * kCoordsZPerTinyZ }, { bounds, 15 }); | |||
const auto td = kTunnels[EnumValue(tunnelArray[tunnelIndex].type)]; | |||
const auto boundBoxZ = curHeight == tunnelArray[tunnelIndex].height - 1 ? td.lowerEdgeBoundingBoxZ : 15; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What edge case is this intended to catch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Feature: [OpenRCT2#22905] Add diagonal downward-inclined brakes to hybrid coaster and single rail coaster. - Feature: [OpenRCT2#23759] Add see-through option to the “Cut-away View“. - Improved: [OpenRCT2#23677] Building new ride track now inherits the colour scheme from the previous piece. - Improved: [OpenRCT2#23720] Text fields now allow cutting to clipboard (Ctrl+X) in addition to copy and paste. - Improved: [OpenRCT2#23874] The load/save file browser window now uses icons for its action buttons. - Improved: [OpenRCT2#23875] Rides forbidden to be modified or destroyed can now be edited with the All destructible cheat. - Improved: [OpenRCT2#23879] Unique weather icons for snow, heavy snow and blizzard. - Fix: [OpenRCT2#1972, OpenRCT2#11679] Vehicles passing by toilets can cause them to glitch (original bug). - Fix: [OpenRCT2#9999, OpenRCT2#10000, OpenRCT2#10001, OpenRCT2#10002, OpenRCT2#10003] Truncated scenario strings when using Catalan, Czech, Japanese, Polish or Russian. - Fix: [OpenRCT2#14486] Guests will fall through upwards sloped paths when making their way through a park entrance or ride exit (original bug). - Fix: [OpenRCT2#15826, OpenRCT2#23835] Wooden Roller Coaster steep turn supports glitch when train goes over them (original bug). - Fix: [OpenRCT2#16357] Chairlift station covers draw incorrectly. - Fix: [OpenRCT2#16657] Mine Ride right S-bend uses Mini Roller Coaster sprite (original bug). - Fix: [OpenRCT2#18376] Ghost train gentle to flat track is not visible in tunnels. - Fix: [OpenRCT2#18389] Gentle sloped track pieces are not visible in low clearance height tunnels (original bug). - Fix: [OpenRCT2#18423] Underground Mini Golf holes can draw over land edges (original bug). - Fix: [OpenRCT2#18433] CJK TrueType fonts cannot be located when font names are translated by the OS. - Fix: [OpenRCT2#18436] Scenery on the same tile as steep to vertical track can draw over the track (original bug). - Fix: [OpenRCT2#18711] Park entrances with their sides underground can cause glitching. - Fix: [OpenRCT2#20848] Junior Roller Coaster booster track does not draw correctly in tunnels. - Fix: [OpenRCT2#20948] Incorrect diagonal brakes supports on the Giga Coaster, Looping Roller Coaster and Wooden Roller Coaster. - Fix: [OpenRCT2#21768] Dirty blocks debug overlay is rendered incorrectly on high DPI screens. - Fix: [OpenRCT2#22229] Opening a park save file from a newer version of OpenRCT2 yields an unhelpful error message. - Fix: [OpenRCT2#22617] Sloped Wooden and Side-Friction supports draw out of order when built directly above diagonal track pieces (original bug). - Fix: [OpenRCT2#22620] Mine Train Coaster trains glitch on large banked turns. - Fix: [OpenRCT2#23522] Diagonal sloped Steeplechase supports have glitched sprites at the base. - Fix: [OpenRCT2#23580] Table header labels may overlap if the window is made very small. - Fix: [OpenRCT2#23641] Steep to flat track is not drawn correctly in tunnels (original bug). - Fix: [OpenRCT2#23795] Looping Roller Coaster vertical loop supports are drawn incorrectly. - Fix: [OpenRCT2#23797] 3D Text cut off too early on multi-line signs. - Fix: [OpenRCT2#23809] Trains glitch on Bobsleigh Coaster small helixes. - Fix: [OpenRCT2#23811] Land edges glitch when vehicles go through gentle to flat tunnels. - Fix: [OpenRCT2#23814] Scenarios not indexed on first start. - Fix: [OpenRCT2#23818] Spinning tunnels can draw over sloped terrain in front of them. - Fix: [OpenRCT2#23828] Vehicles passing by station entrances and exits can cause them to glitch (original bug). - Fix: [OpenRCT2#23831] Hybrid Coaster large gentle banked right turns glitch when diagonal track is above them. - Fix: [OpenRCT2#23832] Hybrid Coaster large gentle banked left turns supports glitch as train passes. - Fix: [OpenRCT2#23836] Adjacent track can draw over large turns (original bug). - Fix: [OpenRCT2#23858] LSM launched lift hill has a misaligned sprite.
- Feature: [OpenRCT2#22905] Add diagonal downward-inclined brakes to hybrid coaster and single rail coaster. - Feature: [OpenRCT2#23759] Add see-through option to the “Cut-away View“. - Improved: [OpenRCT2#23677] Building new ride track now inherits the colour scheme from the previous piece. - Improved: [OpenRCT2#23720] Text fields now allow cutting to clipboard (Ctrl+X) in addition to copy and paste. - Improved: [OpenRCT2#23874] The load/save file browser window now uses icons for its action buttons. - Improved: [OpenRCT2#23875] Rides forbidden to be modified or destroyed can now be edited with the All destructible cheat. - Improved: [OpenRCT2#23879] Unique weather icons for snow, heavy snow and blizzard. - Fix: [OpenRCT2#1972, OpenRCT2#11679] Vehicles passing by toilets can cause them to glitch (original bug). - Fix: [OpenRCT2#9999, OpenRCT2#10000, OpenRCT2#10001, OpenRCT2#10002, OpenRCT2#10003] Truncated scenario strings when using Catalan, Czech, Japanese, Polish or Russian. - Fix: [OpenRCT2#14486] Guests will fall through upwards sloped paths when making their way through a park entrance or ride exit (original bug). - Fix: [OpenRCT2#15826, OpenRCT2#23835] Wooden Roller Coaster steep turn supports glitch when train goes over them (original bug). - Fix: [OpenRCT2#16357] Chairlift station covers draw incorrectly. - Fix: [OpenRCT2#16657] Mine Ride right S-bend uses Mini Roller Coaster sprite (original bug). - Fix: [OpenRCT2#18376] Ghost train gentle to flat track is not visible in tunnels. - Fix: [OpenRCT2#18389] Gentle sloped track pieces are not visible in low clearance height tunnels (original bug). - Fix: [OpenRCT2#18423] Underground Mini Golf holes can draw over land edges (original bug). - Fix: [OpenRCT2#18433] CJK TrueType fonts cannot be located when font names are translated by the OS. - Fix: [OpenRCT2#18436] Scenery on the same tile as steep to vertical track can draw over the track (original bug). - Fix: [OpenRCT2#18711] Park entrances with their sides underground can cause glitching. - Fix: [OpenRCT2#20848] Junior Roller Coaster booster track does not draw correctly in tunnels. - Fix: [OpenRCT2#20948] Incorrect diagonal brakes supports on the Giga Coaster, Looping Roller Coaster and Wooden Roller Coaster. - Fix: [OpenRCT2#21768] Dirty blocks debug overlay is rendered incorrectly on high DPI screens. - Fix: [OpenRCT2#22229] Opening a park save file from a newer version of OpenRCT2 yields an unhelpful error message. - Fix: [OpenRCT2#22617] Sloped Wooden and Side-Friction supports draw out of order when built directly above diagonal track pieces (original bug). - Fix: [OpenRCT2#22620] Mine Train Coaster trains glitch on large banked turns. - Fix: [OpenRCT2#23522] Diagonal sloped Steeplechase supports have glitched sprites at the base. - Fix: [OpenRCT2#23580] Table header labels may overlap if the window is made very small. - Fix: [OpenRCT2#23641] Steep to flat track is not drawn correctly in tunnels (original bug). - Fix: [OpenRCT2#23795] Looping Roller Coaster vertical loop supports are drawn incorrectly. - Fix: [OpenRCT2#23797] 3D Text cut off too early on multi-line signs. - Fix: [OpenRCT2#23809] Trains glitch on Bobsleigh Coaster small helixes. - Fix: [OpenRCT2#23811] Land edges glitch when vehicles go through gentle to flat tunnels. - Fix: [OpenRCT2#23814] Scenarios not indexed on first start. - Fix: [OpenRCT2#23818] Spinning tunnels can draw over sloped terrain in front of them. - Fix: [OpenRCT2#23828] Vehicles passing by station entrances and exits can cause them to glitch (original bug). - Fix: [OpenRCT2#23831] Hybrid Coaster large gentle banked right turns glitch when diagonal track is above them. - Fix: [OpenRCT2#23832] Hybrid Coaster large gentle banked left turns supports glitch as train passes. - Fix: [OpenRCT2#23836] Adjacent track can draw over large turns (original bug). - Fix: [OpenRCT2#23858] LSM launched lift hill has a misaligned sprite.
This fixes the land edges glitching when vehicles go through gentle to flat tunnels. It does this by drawing the edge underneath the tunnel with a lower height bounding box so that it doesn't conflict with the vehicle or track.
gentletoflattunnelsglitch.mp4
gentletoflattunnelsfixed.mp4
It doesn't fix this issue with the gentle slope tunnels, but it should help with solving it completely:

Most of this happens because those sprites are cut with the full edge beneath the tunnel in the front sprite.