Jump to content

How to make covered / sheltered roller coasters


Recommended Posts

Hi first of all great work dev guys.

I am playing 0.1.2, would want to know if the "rollercoaster being considered indoor if enough portion is covered" feature has been implemented or not? According to this wikia post, it claimed that if 40% of your track is covered it shall be considered indoor and guest will ride during rain. However I have tried placing roofs and base blocks above the tracks but it did not seemed to work. Is there any caution I have to take while "covering" the track? must I use roof objects or something? must they be built 1 tile directly above track?

Link to comment

What that wikia page says is wrong. I don't believe 40% of a track has to be covered, so I checked out the code to find out more.

Rides have a value that keep track of how much of the track is covered. Directly taken from a comment in the source code: This is a very rough approximation of how much of the ride is undercover. It reaches the maximum value of 7 at about 50% undercover and doesn't increase beyond that.

This value gets calculated alongside other measurements by following a vehicle. For each track element (straight piece, corner, drops, etc.) it does a few checks to see if the track element is covered:

  • It's below the surface
  • There's a large scenery item on top of it
  • There's a footpath above it
  • There's scenery above it that uses the full tile

If any of those filters match, a track piece is considered covered. The distance doesn't matter, as long as it's later on the list of tile elements. It could even be lower than the track element when the order has been manipulated, and still be considered to be covering the track. When it is, the length of the track piece will be added to the total length of the track that is covered by something.

When the measurements are made, guests can begin to complain about not wanting to go on a ride when it's raining. Before they complain, there's a check to see how much of the track is covered. This threshold is fairly low and only requires about 10-15% of the ride to be covered.

Note that I don't have any experience with this part of the code, so my findings may not be 100% accurate.

Link to comment

Thank you for all the input guys.

After digging some code, I found that it calculates the "sheltered length" of a ride at Vehicle.cpp ride->sheltered_length = add_clamp_sint32(ride->sheltered_length, distance);

I think Broxzier is quite correct, so my next question is, what is "Large Scenery"? and what is full tile small scenery? must it be roof or something? Does it has to be "properly enclosed" not just floating blocks? because I think I did try that.

static void vehicle_update_measurements(rct_vehicle * vehicle){
    rct_tile_element * tile_element = map_get_surface_element_at({x, y});
    if (tile_element->base_height * 8 <= vehicle->z)
    {

        bool cover_found = false;
        do
        {
            if (tile_element_get_type(tile_element) == TILE_ELEMENT_TYPE_LARGE_SCENERY)
            {
                cover_found = true;
                break;
            }

            if (tile_element_get_type(tile_element) == TILE_ELEMENT_TYPE_PATH)
            {
                cover_found = true;
                break;
            }

            if (tile_element_get_type(tile_element) != TILE_ELEMENT_TYPE_SMALL_SCENERY)
                continue;

            rct_scenery_entry * scenery = get_small_scenery_entry(tile_element->properties.scenery.type);
            if (scenery_small_entry_has_flag(scenery, SMALL_SCENERY_FLAG_FULL_TILE))
            {
                cover_found = true;
                break;
            }
        } while (!tile_element_is_last_for_tile(tile_element++));

        if (cover_found == false)
        {
            ride->testing_flags &= ~RIDE_TESTING_SHELTERED;
            return;
        }
    }

      if (!(ride->testing_flags & RIDE_TESTING_SHELTERED))
    {
        ride->testing_flags |= RIDE_TESTING_SHELTERED;

        uint8 num_sheltered_sections = ride->num_sheltered_sections & 0x1F;
        if (num_sheltered_sections != 0x1F)
            num_sheltered_sections++;
        ride->num_sheltered_sections &= ~0x1F;
        ride->num_sheltered_sections |= num_sheltered_sections;

        if (vehicle->vehicle_sprite_type != 0)
        {
            ride->num_sheltered_sections |= (1 << 5);
        }

        if (vehicle->bank_rotation != 0)
        {
            ride->num_sheltered_sections |= (1 << 6);
        }
    }
  
sint32 distance = ((vehicle->velocity + vehicle->acceleration) >> 10) * 42;
	if (distance < 0) return;
ride->sheltered_length = add_clamp_sint32(ride->sheltered_length, distance);
Edited by jimmychau
typo
Link to comment
21 hours ago, jimmychau said:

and what is full tile small scenery? must it be roof or something? Does it has to be "properly enclosed" not just floating blocks?

Small scenery objects have a number of flags that dictate which parts of the tile they occupy. An object can be full tile, quarter tile, half tile, 3/4 tile, or diagonal (which means it occupies two diagonally opposing quadrants of the tile).  Any full tile object will be counted as cover - it does not have to be a roof (I don't think the game makes a distinction between roofs and other scenery), and there doesn't seem to be a requirement for any walls either. If there exists a full tile object above the ride track, that tile is considered to be covered. Large scenery objects don't have these flags and cannot occupy less than a full tile.

Link to comment

image.thumb.png.c8e5b390bfefc9d8c7879f5e26f71f1f.pngSo I have tried some more, with the simple king rapids, the one on the left with roofs directly above the track is considered sheltered, but the one on the right is considered not sheltered with or without the vertical walls makes no difference. There may be a limit to how close the tiles must be to the vehicle during testing, but I fail to see the logic in the code.

I have also tested with the dejavu, but for this track I failed to have it considered sheltered even if all the tracks and queue path are covered with glass roof, still no one wants to go in. Strangely I remember in another saved game it worked, but now I cannot replicate it.

image.png.f8734647882a60954e0160f3b8e8b232.png

 

rct_tile_element * tile_element = map_get_surface_element_at({x, y});
    if (tile_element->base_height * 8 <= vehicle->z)

 

Link to comment

@jensj12 It does. In case the first check, to see if the vehicle is above the ground, passes, it loops over the tile elements above the first surface element. For large scenery and paths it sets cover_found to true, for small scenery it first checks if the SMALL_SCENERY_FLAG_FULL_TILE flag is set first.

Edited by Broxzier
Link to comment

Correct me if I'm wrong: the surface element is the ground (not the coaster), and it starts looping from there. If it finds a large piece of scenery before looping over the track element, it will select that as cover anyways, even though it's below the track.

Link to comment

The cover_found flag? That's just a local variable, doing exactly what is says. Anyways, I think this piece of code could use some attention and deserves a GH issue. I will make one in a few days if nobody else has done it by then.

Has anyone tried covering a ride by putting scenery below it?

Link to comment
On 10/04/2018 at 23:11, jensj12 said:

The cover_found flag? That's just a local variable, doing exactly what is says.

No, I meant the flag that gets set for measuring the track block. It's not being used anywhere outside this function, and it seems to increase a counter that the ride uses to calculate how much of the ride is covered.

Link to comment
  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...