1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Restore maximum ride price algo to vanilla

This reverses the functional changes made in #5294. While the new
algorithm works out well for roller coaster and encourages better
rides in general, it is hampered by the fact that the value of
flat rides is abysmal and this means that you can never ask a
decent price.

This should probably be fixed at the source instead of
papered over by an absolute bonus, but fixing that is a lot more
delicate and complicated than restoring vanilla’s behaviour.
Something to revisit at a later date and with sufficient testing.
This commit is contained in:
Gymnasiast
2025-09-12 19:53:29 +02:00
parent 2ad4d4be72
commit 1557e20a2a

View File

@@ -1111,21 +1111,7 @@ static void RideRatingsCalculateValue(Ride& ride)
{
int32_t months, multiplier, divisor, summand;
};
static const Row ageTableNew[] = {
{ 5, 3, 2, 0 }, // 1.5x
{ 13, 6, 5, 0 }, // 1.2x
{ 40, 1, 1, 0 }, // 1x
{ 64, 3, 4, 0 }, // 0.75x
{ 88, 9, 16, 0 }, // 0.56x
{ 104, 27, 64, 0 }, // 0.42x
{ 120, 81, 256, 0 }, // 0.32x
{ 128, 81, 512, 0 }, // 0.16x
{ 200, 81, 1024, 0 }, // 0.08x
{ 200, 9, 16, 0 }, // 0.56x "easter egg"
};
#ifdef ORIGINAL_RATINGS
static const Row ageTableOld[] = {
static constexpr auto kAgeTable = std::to_array<Row>({
{ 5, 1, 1, 30 }, // +30
{ 13, 1, 1, 10 }, // +10
{ 40, 1, 1, 0 }, // 1x
@@ -1136,8 +1122,7 @@ static void RideRatingsCalculateValue(Ride& ride)
{ 128, 81, 512, 0 }, // 0.16x
{ 200, 81, 1024, 0 }, // 0.08x
{ 200, 9, 16, 0 }, // 0.56x "easter egg"
};
#endif
});
if (!RideHasRatings(ride))
{
@@ -1156,15 +1141,7 @@ static void RideRatingsCalculateValue(Ride& ride)
monthsOld = ride.getAge();
}
const Row* ageTable = ageTableNew;
size_t tableSize = std::size(ageTableNew);
#ifdef ORIGINAL_RATINGS
ageTable = ageTableOld;
tableSize = std::size(ageTableOld);
#endif
Row lastRow = ageTable[tableSize - 1];
Row lastRow = kAgeTable[kAgeTable.size() - 1];
// Ride is older than oldest age in the table?
if (monthsOld >= lastRow.months)
@@ -1174,10 +1151,8 @@ static void RideRatingsCalculateValue(Ride& ride)
else
{
// Find the first hit in the table that matches this ride's age
for (size_t it = 0; it < tableSize; it++)
for (const Row& curr : kAgeTable)
{
Row curr = ageTable[it];
if (monthsOld < curr.months)
{
value = (value * curr.multiplier) / curr.divisor + curr.summand;