Skip to content
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

Diagonal brakes and block brakes #19919

Merged
merged 38 commits into from
Oct 9, 2023

Conversation

spacek531
Copy link
Contributor

Speedy block brakes is merged 🎉 and this is the follow-up PR - implementing diagonal brakes and block brakes.

For paint code reasons, track elements with multiple sequence blocks now have all their sequence blocks updated when modifying brakes or brake speed.

@spacek531 spacek531 force-pushed the track/diagonal-brakes branch 2 times, most recently from 8de9125 to e65dc2f Compare April 15, 2023 22:05
@spacek531
Copy link
Contributor Author

The build should be in a playable state now. There are a few outstanding things to do like fixing looping and LIM sprites. Waiting on #19922 and potentially another PR I have yet to make before this can be merged.

@github-actions
Copy link

This pull request has been marked as stale and will be closed in 14 days if no action is taken. To keep it open, leave a comment or remove the stale-pr label. If you're awaiting feedback from a developer, please send us a reminder (either here or on Discord).

@karst
Copy link
Member

karst commented May 20, 2023

Keep this open please.
Any progress on this?

src/openrct2/sprites.h Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the stale-pr label May 21, 2023
@github-actions
Copy link

This pull request has been marked as stale and will be closed in 14 days if no action is taken. To keep it open, leave a comment or remove the stale-pr label. If you're awaiting feedback from a developer, please send us a reminder (either here or on Discord).

@SpartanFrederic104
Copy link
Contributor

Keep this open please

@github-actions github-actions bot removed the stale-pr label Jun 23, 2023
@spacek531
Copy link
Contributor Author

I have given X123M3-256 write access, he has the motivation to finish the PR in a timely manner.

@X123M3-256
Copy link
Contributor

Does anyone know why the CI is failing?

@duncanspumpkin
Copy link
Contributor

its a replay test failure so something has diverged from how it was before. Are we expecting existing logic to have changed at all?

@X123M3-256
Copy link
Contributor

I don't think so but I didn't create the PR so I'm not sure exactly what was changed (@spacek531?)

@fidwell
Copy link
Contributor

fidwell commented Jul 19, 2023

I see this error message a lot in the build output: Replay network version mismatch: '0.3.5.1-15', expected: '0.4.5-13'. So maybe it just needs rebased / main merged in, since the original PR is way behind the current replay.

@X123M3-256
Copy link
Contributor

I see this error message a lot in the build output: Replay network version mismatch: '0.3.5.1-15', expected: '0.4.5-13'. So maybe it just needs rebased / main merged in, since the original PR is way behind the current replay.

I did rebase it, but I rebased it on top of my local develop which is a little out of date, so I can try rebasing again. The network version hasn't increased since I last pulled develop, though, it's still 0.4.5-12, so I think 0.4.5-13 is the correct network version because this PR requires it to be increased?

@X123M3-256
Copy link
Contributor

I rebased it again on top of the latest develop, seems it's still failing.

@ZehMatt
Copy link
Member

ZehMatt commented Jul 20, 2023

I see this error message a lot in the build output: Replay network version mismatch: '0.3.5.1-15', expected: '0.4.5-13'. So maybe it just needs rebased / main merged in, since the original PR is way behind the current replay.

This is just the network version the replays were recorded with, this has nothing to do with the actual replay failing. The current one fails because something has changed that influences the outcome of the simulation.

@X123M3-256
Copy link
Contributor

What is a replay? What do you mean recorded? It builds and works on my machine, I find it odd that some of the Linux builds succeed and others are failing?

@spacek531
Copy link
Contributor Author

its a replay test failure so something has diverged from how it was before. Are we expecting existing logic to have changed at all?

Off the top of my head, all tiles of multi-tile block brake tracks (diagonal chain up-25/60-to-flat, cable lift hill) will have their brake flag set instead of only tile 0. I don't remember if there are other changes.

@duncanspumpkin
Copy link
Contributor

What is a replay? What do you mean recorded? It builds and works on my machine, I find it odd that some of the Linux builds succeed and others are failing?

We record a 1000 ticks of a bpb save file and record the exact properties of every single entity in a replay. If you make a change to the logic that changes how an entity performs anything (assuming that action happens in bpb during the 1000ticks) then it will show up has a replay failure. It takes a little bit of time to run these replays so we don't run it on every ci just Windows 32/64, Mac, Linux gcc/clang. The idea is that it will catch accidental changes to logic that we weren't expecting. If we have on purpose made a change then i just rerecord the replay. I can also get the replay to generate a difference report that will say exactly which entity fields have changed but its not very reliable doing that and it often goes wrong (and it can only tell you the difference after 1000 ticks but the divergence might have happened much earlier and the butterfly effect might mess up lots).

@X123M3-256
Copy link
Contributor

I can also get the replay to generate a difference report that will say exactly which entity fields have changed

How do I do this? I'd quite like to get this PR finished off because it's been almost 2 years since it was first implemented, but I've not encountered this issue before.

@spacek531
Copy link
Contributor Author

I can also get the replay to generate a difference report that will say exactly which entity fields have changed but its not very reliable doing that and it often goes wrong (and it can only tell you the difference after 1000 ticks but the divergence might have happened much earlier and the butterfly effect might mess up lots).

You are referring to the desync report, correct? When I used it previously it would identify the first frame(s) of the desync instead of the last.

My expectations for a good outcome on the desync report are that the desync consists of only TrackElement brake flags being set, and peep rand is the same on left and right.

@spacek531
Copy link
Contributor Author

I just ran bpb1000 ticks against the branch and against OpenRCT2, v0.4.5-222-gccba517 (ccba517 on develop) provided by GitHub.

The desync report is as follows:

tick left = 00014BD7, tick right = 00014BD7
srand0 left = C5AB4C49, srand0 right = C5AB4C49
Sprite modifications (Misc: Money effect), index: 511
  MoneyEffect::OffsetX, len = 2, offset = 56, left = 0x000000000000FFEC, right = 0x000000000000FFED
Sprite modifications (Vehicle), index: 575
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Misc: Money effect), index: 578
  MoneyEffect::OffsetX, len = 2, offset = 56, left = 0x000000000000FFEC, right = 0x000000000000FFED
Sprite modifications (Misc: Money effect), index: 583
  MoneyEffect::OffsetX, len = 2, offset = 56, left = 0x000000000000FFEC, right = 0x000000000000FFED
Sprite modifications (Vehicle), index: 743
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Vehicle), index: 1687
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Vehicle), index: 1861
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Vehicle), index: 1918
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Vehicle), index: 2011
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Vehicle), index: 2212
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Vehicle), index: 3042
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Vehicle), index: 3416
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008
Sprite modifications (Vehicle), index: 3908
  Vehicle::BlockBrakeSpeed, len = 1, offset = 252, left = 0x0000000000000002, right = 0x0000000000000008

Ignore the money desync, that occurs even on the prebuilt version.

The desync is telling me that block brake speed is getting loaded by the vehicle incorrectly. The affected field was added in speedy block brakes. If I knew which vehicles the entity indices referred to, I could better troubleshoot.

@karst
Copy link
Member

karst commented Oct 3, 2023

it seems the include ../../paint/Boundbox.h is not located where it used to be.

@karst
Copy link
Member

karst commented Oct 5, 2023

@duncanspumpkin Can you take a look at thisone one more time after all these small fixes?
I believe the only thing that has changed is the addition of a few more sprites + paintcode. @spacek531 can you verify?

@spacek531
Copy link
Contributor Author

yes

Copy link
Member

@karst karst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done one more playtest checking the functionality and it seems identical to its normal counter part. Very happy with this implementation, thx for the hard work :)

@Realsteel89
Copy link

A krimi this branch but clean work @spacek I will test it again tomorrow.

@spacek531
Copy link
Contributor Author

I don't have any more planned changes for this branch. The ride types that do not have brakes will be covered in a folllow-up PR.

Copy link
Contributor

@duncanspumpkin duncanspumpkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor issue with park version but other than that good to go.

@ZehMatt ZehMatt added this to the v0.4.7 milestone Oct 9, 2023
@ZehMatt ZehMatt added network version Network version needs updating - double check before merging! changelog This issue/PR deserves a changelog entry. park file version Requires updating the park file version number labels Oct 9, 2023
@ZehMatt ZehMatt merged commit f773adc into OpenRCT2:develop Oct 9, 2023
21 checks passed
SPR_G2_BM_RC_END = SPR_G2_BM_DIAG_BRAKES + 6,

SPR_G2_MINI_RC_BEGIN = SPR_G2_BM_RC_END,
SPR_G2_MINI_RC_BOOSTER_NE_SW = SPR_G2_MINI_RC_BEGIN,
Copy link
Member

@karst karst Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thisone doesn't line up with the json file. Switching them around here.

janisozaur added a commit that referenced this pull request Dec 31, 2023
- Feature: [#12078] Add shortcut key for toggling wall slope.
- Feature: [#19919] Add diagonal brakes and diagonal block brakes to most coaster types.
- Feature: [#20141] Add additional track pieces to the Giga Coaster.
- Feature: [#20825] Made setting the game speed a game action.
- Feature: [#20830] Display author field on scenery window.
- Feature: [#20853] [Plugin] Add “BaseTileElement.owner” which is saved in the park file.
- Feature: [objects#257] Re-introduce the RCT1 road, which does not have handrails.
- Feature: [OpenMusic#46] Added Mystic ride music style.
- Feature: [OpenMusic#50] Added Rock style 4 ride music.
- Improved: [objects#261] Add composer credits on all RCT2 music objects.
- Change: [#20790] Default ride price set to free if park charges for entry.
- Change: [#20880] Restore removed default coaster colours.
- Change: [#21102] The money effect will now update even when the game is paused.
- Change: [objects#244] Update sort priorities for expansion scenery groups.
- Change: [objects#256] Use recoloured RCT2 artwork on the Fruity Ices Stall, rather than the (slightly different) RCT1 artwork.
- Fix: [#5677] Balloons pass through the ground and objects.
- Fix: [#12299] Placing ride entrances/exits ignores the Disable Clearance Checks cheat.
- Fix: [#13473] Guests complain that the default Circus price is too high.
- Fix: [#15293] TTF fonts don’t format correctly with OpenGL.
- Fix: [#16453] Tile inspector invisibility shortcut does not use a game action.
- Fix: [#16926] When multiple vehicles are grouped in research, only one of them is unlocked.
- Fix: [#17774] Misplaced/missing land and construction rights tiles in RCT1 & RCT2 scenarios.
- Fix: [#18199] Dots in the game save’s name no longer get truncated.
- Fix: [#19722] “Forbid tree removal” restriction doesn’t forbid removal of large scenery tree items.
- Fix: [#20253] Crash when displaying a Lay-Down RC’s half loop.
- Fix: [#20356] Cannot set tertiary colour on small scenery.
- Fix: [#20624] Scrolling text glitches after language is changed.
- Fix: [#20679] Android: game crashes at launch.
- Fix: [#20737] Spent money in player window underflows when getting refunds.
- Fix: [#20747] Staff speed cheat not applying to newly hired staff, UI not showing the current applied speed.
- Fix: [#20778] [Plugin] Incorrect target api when executing custom actions.
- Fix: [#20807] Tertiary colour not copied with small scenery.
- Fix: [#20964] Crash when player connects to server with a group assigned that no longer exists.
- Fix: [#20995] TTF fonts don’t support hinting, outlines, or insets with OpenGL.
- Fix: [#21042] Peeps don’t render properly in S4 parks.
- Fix: [objects#246, objects#248] Some objects are incorrectly marked as originating from RCT1.
- Fix: [objects#260] Submarine Ride has its capacity listed incorrectly.
KatieZeldaKat pushed a commit to KatieZeldaKat/OpenRCT2 that referenced this pull request Jan 2, 2024
- Feature: [OpenRCT2#12078] Add shortcut key for toggling wall slope.
- Feature: [OpenRCT2#19919] Add diagonal brakes and diagonal block brakes to most coaster types.
- Feature: [OpenRCT2#20141] Add additional track pieces to the Giga Coaster.
- Feature: [OpenRCT2#20825] Made setting the game speed a game action.
- Feature: [OpenRCT2#20830] Display author field on scenery window.
- Feature: [OpenRCT2#20853] [Plugin] Add “BaseTileElement.owner” which is saved in the park file.
- Feature: [objects#257] Re-introduce the RCT1 road, which does not have handrails.
- Feature: [OpenMusic#46] Added Mystic ride music style.
- Feature: [OpenMusic#50] Added Rock style 4 ride music.
- Improved: [objects#261] Add composer credits on all RCT2 music objects.
- Change: [OpenRCT2#20790] Default ride price set to free if park charges for entry.
- Change: [OpenRCT2#20880] Restore removed default coaster colours.
- Change: [OpenRCT2#21102] The money effect will now update even when the game is paused.
- Change: [objects#244] Update sort priorities for expansion scenery groups.
- Change: [objects#256] Use recoloured RCT2 artwork on the Fruity Ices Stall, rather than the (slightly different) RCT1 artwork.
- Fix: [OpenRCT2#5677] Balloons pass through the ground and objects.
- Fix: [OpenRCT2#12299] Placing ride entrances/exits ignores the Disable Clearance Checks cheat.
- Fix: [OpenRCT2#13473] Guests complain that the default Circus price is too high.
- Fix: [OpenRCT2#15293] TTF fonts don’t format correctly with OpenGL.
- Fix: [OpenRCT2#16453] Tile inspector invisibility shortcut does not use a game action.
- Fix: [OpenRCT2#16926] When multiple vehicles are grouped in research, only one of them is unlocked.
- Fix: [OpenRCT2#17774] Misplaced/missing land and construction rights tiles in RCT1 & RCT2 scenarios.
- Fix: [OpenRCT2#18199] Dots in the game save’s name no longer get truncated.
- Fix: [OpenRCT2#19722] “Forbid tree removal” restriction doesn’t forbid removal of large scenery tree items.
- Fix: [OpenRCT2#20253] Crash when displaying a Lay-Down RC’s half loop.
- Fix: [OpenRCT2#20356] Cannot set tertiary colour on small scenery.
- Fix: [OpenRCT2#20624] Scrolling text glitches after language is changed.
- Fix: [OpenRCT2#20679] Android: game crashes at launch.
- Fix: [OpenRCT2#20737] Spent money in player window underflows when getting refunds.
- Fix: [OpenRCT2#20747] Staff speed cheat not applying to newly hired staff, UI not showing the current applied speed.
- Fix: [OpenRCT2#20778] [Plugin] Incorrect target api when executing custom actions.
- Fix: [OpenRCT2#20807] Tertiary colour not copied with small scenery.
- Fix: [OpenRCT2#20964] Crash when player connects to server with a group assigned that no longer exists.
- Fix: [OpenRCT2#20995] TTF fonts don’t support hinting, outlines, or insets with OpenGL.
- Fix: [OpenRCT2#21042] Peeps don’t render properly in S4 parks.
- Fix: [objects#246, objects#248] Some objects are incorrectly marked as originating from RCT1.
- Fix: [objects#260] Submarine Ride has its capacity listed incorrectly.
CorySanin added a commit to CorySanin/OpenRCT2 that referenced this pull request Feb 4, 2024
Release v0.4.7

- Feature: [OpenRCT2#12078] Add shortcut key for toggling wall slope.
- Feature: [OpenRCT2#19919] Add diagonal brakes and diagonal block brakes to most coaster types.
- Feature: [OpenRCT2#20141] Add additional track pieces to the Giga Coaster.
- Feature: [OpenRCT2#20825] Made setting the game speed a game action.
- Feature: [OpenRCT2#20830] Display author field on scenery window.
- Feature: [OpenRCT2#20853] [Plugin] Add “BaseTileElement.owner” which is saved in the park file.
- Feature: [objects#257] Re-introduce the RCT1 road, which does not have handrails.
- Feature: [OpenMusic#46] Added Mystic ride music style.
- Feature: [OpenMusic#50] Added Rock style 4 ride music.
- Improved: [objects#261] Add composer credits on all RCT2 music objects.
- Change: [OpenRCT2#20790] Default ride price set to free if park charges for entry.
- Change: [OpenRCT2#20880] Restore removed default coaster colours.
- Change: [OpenRCT2#21102] The money effect will now update even when the game is paused.
- Change: [objects#244] Update sort priorities for expansion scenery groups.
- Change: [objects#256] Use recoloured RCT2 artwork on the Fruity Ices Stall, rather than the (slightly different) RCT1 artwork.
- Fix: [OpenRCT2#5677] Balloons pass through the ground and objects.
- Fix: [OpenRCT2#12299] Placing ride entrances/exits ignores the Disable Clearance Checks cheat.
- Fix: [OpenRCT2#13473] Guests complain that the default Circus price is too high.
- Fix: [OpenRCT2#15293] TTF fonts don’t format correctly with OpenGL.
- Fix: [OpenRCT2#16453] Tile inspector invisibility shortcut does not use a game action.
- Fix: [OpenRCT2#16926] When multiple vehicles are grouped in research, only one of them is unlocked.
- Fix: [OpenRCT2#17774] Misplaced/missing land and construction rights tiles in RCT1 & RCT2 scenarios.
- Fix: [OpenRCT2#18199] Dots in the game save’s name no longer get truncated.
- Fix: [OpenRCT2#19722] “Forbid tree removal” restriction doesn’t forbid removal of large scenery tree items.
- Fix: [OpenRCT2#20253] Crash when displaying a Lay-Down RC’s half loop.
- Fix: [OpenRCT2#20356] Cannot set tertiary colour on small scenery.
- Fix: [OpenRCT2#20624] Scrolling text glitches after language is changed.
- Fix: [OpenRCT2#20679] Android: game crashes at launch.
- Fix: [OpenRCT2#20737] Spent money in player window underflows when getting refunds.
- Fix: [OpenRCT2#20747] Staff speed cheat not applying to newly hired staff, UI not showing the current applied speed.
- Fix: [OpenRCT2#20778] [Plugin] Incorrect target api when executing custom actions.
- Fix: [OpenRCT2#20807] Tertiary colour not copied with small scenery.
- Fix: [OpenRCT2#20964] Crash when player connects to server with a group assigned that no longer exists.
- Fix: [OpenRCT2#20995] TTF fonts don’t support hinting, outlines, or insets with OpenGL.
- Fix: [OpenRCT2#21042] Peeps don’t render properly in S4 parks.
- Fix: [objects#246, objects#248] Some objects are incorrectly marked as originating from RCT1.
- Fix: [objects#260] Submarine Ride has its capacity listed incorrectly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This issue/PR deserves a changelog entry. network version Network version needs updating - double check before merging! park file version Requires updating the park file version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants