-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
#15314: unify Booster speed across all ride types and increase limits #16692
base: develop
Are you sure you want to change the base?
Conversation
c2f71a1
to
06cd75f
Compare
I believe I've managed to fully implement the feature outlined above, plus I extended it by getting the booster acceleration from the track's RTD. Getting booster acceleration from the track's RTD is temporary behavior which will be replaced by storing the BoosterAcceleration in the track element itself. |
I think a testing plan could look something like this:
If the only desyncs are Vehicle struct values, then legacy behavior is preserved. If desyncs include vehicle position, legacy behavior was not preserved. I am unsure how much testing the behavior locked behind UNIFIED_BRAKE_SPEED_ENABLED requires. It's 100% UI-focused code that locks the updated speed increments until NTDF is added. |
Would solve #6680 |
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 |
Please keep this open |
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 |
Please keep open |
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 |
Keep open please |
Todo list: see original post |
e95f8ba
to
459aa82
Compare
src/openrct2/ride/RideConstruction.h
Outdated
@@ -62,7 +62,7 @@ extern TrackPitch _previousTrackPitchEnd; | |||
|
|||
extern CoordsXYZ _previousTrackPiece; | |||
|
|||
extern uint8_t _currentBrakeSpeed2; | |||
extern int8_t _currentBrakeSpeed; |
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.
Why change this to a signed integer?
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.
It was a change related to #16692 (comment) that leaked into the original feature branch.
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.
Ok, can you revert it? I want to keep the diff as small as possible.
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.
I can, yes, but not for the next several days since I am very busy. I am still waiting on a decision regarding the 2 bits in the flags field as outlined in that comment.
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.
Sorry, didn’t know you expected me to weigh in on it. I’ll get to it.
459aa82
to
52b5d94
Compare
52b5d94
to
0327e26
Compare
This pull request is spun off from Unify Speed #16692 for ease of review, as well as making it easier to address some future features independent of Unify Speed. This PR separates the OperationSettings field of RTD into 3 new fields, since the OperationSettings struct was bloated with things that are not operation settings. This PR implements legacy and non-legacy ("modern") booster setting fields. In preparation for Unify Speed, the legacy properties are set to match the values as they stand. Separating legacy from modern allows the modern values to be changed in accordance with #21752 while preserving backwards-compatibility. Unify Speed or a spun-off subset PR will implement a vehicle flag to switch between legacy and modern behavior, which all older parks will import with, while new rides will use the non-legacy "modern" behavior. Unify speed or a spin-off will implement enforcing brake and booster speeds.
0327e26
to
0218863
Compare
ac4fd03
to
ccb5737
Compare
ccb5737
to
790a0dd
Compare
790a0dd
to
d5806a0
Compare
When a vehicle travels over a booster, launched lift hill, or Reverse Freefall Coaster launch track, the vehicle's behavior is dependent on the ride the vehicle belongs to. This means no matter how many merges you do, a Looping Coaster will always have anemic Looping Coaster boosters, and launched lift hills will never boost it.
This PR changes this behavior. Instead of looking at the vehicle's ride for how powerful or fast the boosters are, the vehicle looks at the track itself. This opens up many possibilities for ride design, as rides can now have boosters and launched lift hills of differing power, and can utilize the Reverse Freefall Coaster launch track, when using merging.
At the same time, this PR unifies the speed intervals between boosters and brakes, increases the top speed slightly, and increases the precision. Boosters and brakes of all coaster types are now twice as precise as regular brakes - the same as junior coaster boosters. The two upper bits of the speed field are reserved for booster features @X123M3-256 has worked on.
Backwards compatibility is achieved with a vehicle flag that preserves the legacy behavior. The flag is automatically set when importing from an older version of the game, and can be set or unset at any time using a plugin (plugin API to be implemented).
Critical to the legacy behavior are two new functions added to the RTD: GetAbsoluteBoosterSpeed and GetRelativeBoosterSpeed. The legacy speeds are the "relative" speed space, and unified speeds are the "absolute" speed space. When importing a park, all boosters have their speed absolutized (if giga, multiply by 2, if junior, divide by 2). When a legacy vehicle travels over a booster track, the track's speed is relativized based on the track's type (if giga, divide by 2, if junior, multiply by 2), then absolutized based on the vehicle's type (if giga, multiply by 2, if junior, divide by 2). Testing is required to find any missed edge cases.
Track designs placed in new versions of the game will not have the legacy flag set, but this should not be an issue because track designs cannot merge currently. When exporting to track design, boosters and brake speeds are capped to the maximum, and speeds that are too precise to save are rounded up. Testing of this is required to find any missed edge cases.
Todos: