-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Building new track inherits alternate colour scheme from previous piece #23677
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
Building new track inherits alternate colour scheme from previous piece #23677
Conversation
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.
Code looks good, needs testing.
Could you test this one as well, @ZeeMaji ? |
Sure! |
715065d
to
33b647d
Compare
@ZeeMaji I have implemented this. I used the (The |
@ZeeMaji Nice find! I think that this is actually a pre-existing bug. Try this on develop/release: build a multidim with seat rotation at 0°, build a block brake, and keep going. It looks like the block brake was also at 0° as you built it, but if you navigate back to it, it is set to -180°. This is because the construction window would set either the brake speed or the rotation, but not both, so it gets reset to -180° (which is an internal value of 0). You're seeing it show -180° in my branch because the visual in the construction window is now actually updated, where it wasn't before. I'd guess this was a side effect of the speedy block brakes feature. I have pushed a change which should fix this by always setting the seat rotation. |
That is an original feature (not bug) that I somehow missed in speedy block brakes. In vanilla the speed and multidim properties occupied the same bits, so only one could be written at a time. |
So are you saying that the behavior ZeeMaji found is intended? I'm not sure if you're saying we should change it or not. |
I think someone changed it since speedy block brakes. The way I made it, there should be seat rotation on block brake, but not brakes. Apparently setting seat rotation never worked on block brakes and I never noticed. The bugs are:
Setting seat rotation on brakes and boosters could be added, but it will cause TD6 compatibility problems. |
In that case, I'd vote that we file these as separate bugs and fix them in new PRs. This one has already grown to be a bit more than I bargained for. |
Asides from the multidim bugs everything else seems to be working about as i'd expect. |
794abac
to
ea8930d
Compare
Do I understand correctly that the seat rotation stuff was broken before the PR, and this doesn’t break it further? |
From what I can tell, yes, that is the case. The behavior Maji found is already present in release. |
@ZeeMaji Could you approve if that’s the case? |
The multi-dim brake behavior seems different from release, as i can set it and it seemingly gets stored in the element as it gets inherited whenever i continue building from a brakes piece rather than getting set to -180 like on release. It doesn't have any affect on the trains however. It does work properly on block brakes now as in release it would get set to -180 there but here i can set it on block brakes and it gets saved and seems to work? |
Yeah, this change will fix the seat rotation a little bit, but it won't fix it to the extent that SpaceK described. If you prefer, I can change it back to its previous behavior. |
I think reverting regular brakes to previous behavior would probably be the safest option. Block brakes seem fine from what i tested so they can probably remain fixed? Up to you though. |
ea8930d
to
54c0c74
Compare
Sounds good. I've reverted the change to seat rotation; now only the color scheme should be affected with this PR. |
54c0c74
to
cf1f324
Compare
- 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.
Implementation of suggestion in #23623.
When building a tracked ride, the ride's colour scheme will now "inherit" the scheme of the previous piece, if you were using one of the three alternate colour schemes. (Previously, it would always use the main scheme for new construction.)
This change will affect two use cases that behave slightly differently:
I'm also sneaking in a similar fix for brake speed and seat rotation. All three properties are combined in the
properties
track element and ought to behave similarly. For case 1, brake speed and seat rotation would correctly be "inherited", but they would not be in case 2.Demonstrative screenshot
You can see that the main colour scheme is brown, but alternate colour scheme 2 (blue) is visible in the construction window, and will be used when building new track. (Alternate scheme 1, yellow, was also used to test.)
Technical notes
There's some repeated code in the diff for src/openrct2/ride/RideConstruction.cpp, but the two branches in that function already have a good amount of duplicated code. It felt more natural to follow the existing pattern there.
I haven't noticed any regression with constructing track yet (neither coasters and mazes).