OpenRCT2 / OpenRCT2

An open source re-implementation of RollerCoaster Tycoon 2 🎢
https://openrct2.io
GNU General Public License v3.0
13.45k stars 1.54k forks source link

River Rapids Z Sorting issues #2153

Open Krutonium opened 9 years ago

Krutonium commented 9 years ago

boats

Not just on Slopes, but also on corners.

Dracheron commented 8 years ago

I happen to have an idea that might solve this problem - treat it like a normal lift hill - have the piece before it act like a block brake and the rapids cannot go up until a certain condition is met (user decides condition, and they should not have to determine it right away - this could also fix similar issues with the Log Flume and Splash Boats).

Krutonium commented 8 years ago

That would only hide the problem, not fix it. There are many other places where z fighting occurs, where that wouldn't be possible either.

mrtnptrs commented 8 years ago

Can still reproduce it after the drawing functions of the river rapids have been implemented and all the vehicle code.

Ayane commented 3 years ago

I have encountered the same issues on this ride: image image They are several issues, not just z-index ordering, on the lifting track:

Now i have launched the original game and we have exactly the same issue: image

Ayane commented 3 years ago

I have looked on the code and found the algorithm causing this behavior in Vehicle::UpdateTrackMotion line ~9650 of Vehicle.cpp It's decrease the acceleration with vehicle->mass as it should normaly. I have added this hack and

    // HACK FIX #2153: River rapids lift shouldn't decrease speed with vehicle mass
    auto trackElemType = vehicle->GetTrackType();
    if (curRide->type == RIDE_TYPE_RIVER_RAPIDS && (trackElemType == TrackElemType::Up25 || trackElemType == TrackElemType::Up25ToFlat || trackElemType == TrackElemType::FlatToUp25))
    {
        vehicle->velocity = static_cast<int32_t>(curRide->lift_hill_speed) * 15539;
        vehicle->acceleration = vehicle->velocity;
    }
    else
    {

This hack fix the clogging, making this coaster working more as intended. image I don't remember the formulate with acceleration and velocity (This physics algorithms I have done was force driven), the entering and leaving of the lift can be a little too slow or fast. (This was caused by Up25ToFlat and FlatToUp25, code updated)

A proper fix should add a flag on the metadata of the ride.

duncanspumpkin commented 3 years ago

no I don't think that is sensible. In real life these would go slower fully laden. It makes sense that they bunch up.

ocalhoun6 commented 3 years ago

Seems to me the problem is just that they bunch up too tightly, making them overlap. Just needs an increase for the minimum distance between two vehicles for this ride type.

Ayane commented 3 years ago

In all similar rides I have been, the lift was a conveyor belt. The distance between vehicles on a conveyor belt doesn't increase or decrease. These conveyor belts have great grip properties so vehicles don't slides down and don't ramp up. Theorically with more weight the conveyor belt slow down making all vehicles slow down, in reality they equip it with motors with enough torque so you don't see much of a speed variation (they are controller driven to provide power as required to maintain the same speed with different duresses). On lift speed topic I don't understand why this ride doesn't have the option to change it.

For the colliding size for what i have seen in the code, the collision seem to be disabled when a vehicle is on a lift, I suppose to improve performance as it is not intended to have collision on a lift (in case of emergency breakdown all vehicles on a lift are immediately stopped, so no ramp up in a stopped vehicle).

duncanspumpkin commented 3 years ago

The lift though doesn't look like a conveyor belt but more like a number of rollers though.

Ayane commented 3 years ago

It's possible, Wikipedia list 176 rides of this type and some can have this system. I also seen this with steel: image But in the game on the border we see it round and the shadows suggest cylinders, supporting your hypothesis on rolling cylinders. A rolling cylinder lifting system in reality should cost more at construction and upkeep and should be less safe (but rides have not always been made by engineers and safety is not always the priority of parks).

Gymnasiast commented 3 years ago

The River Rapids in RCT (at least the boats) are most likely based on those from Big Country Motioneering:

Although the only installation (Rocky Mountain Rapids in ) does seem to use the kind of lift in your picture:

In above picture, it also uses boats that looks different. But in this footage, the boats look much more like those in RCT: https://www.youtube.com/watch?v=jRBsO2KuFxc