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

Add legacy field for booster parameters to Ride Type Descriptor #21956

Merged
merged 4 commits into from May 13, 2024

Conversation

spacek531
Copy link
Contributor

@spacek531 spacek531 commented May 2, 2024

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.

@spacek531 spacek531 force-pushed the ride/add-legacy-booster-field branch 2 times, most recently from b9456b6 to 6c51596 Compare May 2, 2024 04:23
@spacek531 spacek531 force-pushed the ride/add-legacy-booster-field branch from 6c51596 to 69c33a4 Compare May 2, 2024 06:01
@spacek531
Copy link
Contributor Author

spacek531 commented May 2, 2024

I added the second commit simplifying the GetBoosterSpeed function since I am already touching the RTD data. The new GetBoosterSpeed function I believe will handle signed values better, but even if there's no change with respect to signed values, I posit that it is better since it removes two branches. If this is preferred as its own PR, I can rebase it out.

@spacek531 spacek531 force-pushed the ride/add-legacy-booster-field branch from 69c33a4 to 8b9bfa6 Compare May 2, 2024 06:05
@spacek531 spacek531 marked this pull request as ready for review May 2, 2024 06:30
@Gymnasiast Gymnasiast self-requested a review May 2, 2024 07:30
@spacek531 spacek531 force-pushed the ride/add-legacy-booster-field branch from 8b9bfa6 to d571e53 Compare May 2, 2024 18:54
};

struct RideBoosterSettings
{
uint8_t PoweredLiftAcceleration;
Copy link
Member

Choose a reason for hiding this comment

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

Also zero-initialise these two.

Copy link
Contributor Author

@spacek531 spacek531 May 13, 2024

Choose a reason for hiding this comment

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

I have zero-initialized these for now. They are intended to be changed in a future PR as part of #21752

@@ -31,7 +31,9 @@ constexpr RideTypeDescriptor LIMLaunchedRollerCoasterRTD =
RIDE_TYPE_FLAG_ALLOW_REVERSED_TRAINS,
.RideModes = EnumsToFlags(RideMode::PoweredLaunchPasstrough, RideMode::PoweredLaunch, RideMode::PoweredLaunchBlockSectioned),
.DefaultMode = RideMode::PoweredLaunchPasstrough,
.OperatingSettings = { 10, 31, 26, 18, 52, 0 },
Copy link
Member

Choose a reason for hiding this comment

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

This changes the maximum brakes speed, is that intentional?

Copy link
Contributor Author

@spacek531 spacek531 May 13, 2024

Choose a reason for hiding this comment

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

No and yes. No, this doesn't change maximum brake speed because the value isn't used. Yes, it is intentional because it makes the maximum speed value match current behavior.

Copy link
Member

@Gymnasiast Gymnasiast left a comment

Choose a reason for hiding this comment

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

Looks fine in general, I have two small requests and two questions. See the line notes.

@Gymnasiast
Copy link
Member

LGTM, please rebase.

@spacek531 spacek531 force-pushed the ride/add-legacy-booster-field branch from 0af3151 to 673ce1d Compare May 13, 2024 21:32
@Gymnasiast Gymnasiast enabled auto-merge (squash) May 13, 2024 21:40
@Gymnasiast Gymnasiast merged commit 104a5d5 into OpenRCT2:develop May 13, 2024
22 checks passed
@spacek531 spacek531 deleted the ride/add-legacy-booster-field branch May 13, 2024 21:54
@tupaschoal tupaschoal added this to the v0.4.12 milestone May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants