CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
571 stars 85 forks source link

Disable pedestrian crossing if adjacent roads have no pedestrian lanes #1302

Open Elesbaan70 opened 2 years ago

Elesbaan70 commented 2 years ago

Describe the problem

A junction that has no pedestrian lanes on any of its segments is still set to allow pedestrian crossings by default.

Steps to reproduce

View the junction restrictions of a highway junction with no pedestrian lanes, and note how pedestrian crossings are allowed.

Expected behavior

When the junction has no pedestrian lanes on any of its segments, pedestrian crossings should be disabled by default. If pedestrian lanes are introduced into a junction that is in this state, the pedestrian crossings should be automatically enabled at that time.

Why does this matter?

I want to create highway ramps for Adaptive Networks that will show crosswalks when they cross roads that allow pedestrians. As it stands now, I cannot do this using AN's ZebraCrossing flag because this would be a significant nuisance for the player, who would have to go through and disable them at every highway junction.

Possible alternative solutions

Adaptive Networks could introduce a node flag that indicates whether the node has pedestrian lanes on any of its segments. I'm tempted to say it could just never set the ZebraCrossing flag unless there are pedestrian lanes present, but I really think that flag should always mirror the junction restriction settings.

Screenshots?

This screenshot demonstrates the behavior I want for my highway ramp when it crosses a city street:

image

This screenshot demonstrates the problem it causes for highway junctions, due to the default junction restriction being wrong:

image

Elesbaan70 commented 2 years ago

Turns out it was stupid-easy to implement a flag in AN as described above. If the pull request is accepted, I will close this. đŸ™‚

kianzarrin/AdaptiveNetworks#18

originalfoo commented 2 years ago

To summarise: Ped crossing on a segment entering junction should be disabled if adjacent roads don't have ped lanes. ?

Elesbaan70 commented 2 years ago

Right. Or alternatively, rely on the change I made in AN, if @kianzarrin will accept it, and if changing it in TM:PE is too much work.

Elesbaan70 commented 2 years ago

Three additional points on this:

  1. It's important to note that simply disabling the option is not enough. It also needs to default to reporting crossings as disallowed when the option is disabled.

  2. Even one road with pedestrian lanes is enough for crossings to be enabled--at least for that one road. Consider the scenario where a road with pedestrian lanes ends at a node where none of the other roads have them. A pedestrian's shortest path across the road may be through that node, so the road still needs to allow crossings by default in that case.

image

  1. One advantage fixing this in TM:PE has over my AN flag-based solution is that TM:PE is better positioned to selectively enable crossings based on pedestrian paths that make sense. For example, consider the edge case in the image below, where crossings over the ramps don't make sense. It makes sense to only enable them for the local streets in this case. But this kind of selective enabling is just a nice-to-have, not a core part of change I'm requesting.

image

kianzarrin commented 2 years ago

I think there is another more generic issue regarding this.

Elesbaan70 commented 2 years ago

You might be thinking of #1231. I think it's worth keeping this issue around to document use cases and it matters, and their specific requirements.

originalfoo commented 2 years ago

Tagging #854

Elesbaan70 commented 2 years ago

@aubergine10, the more I think about this, the more I'd love to see this implemented in TM:PE, including the selective disabling part.

You may recall a discussion we had some time back about asymmetrical pedestrian lanes. I really thought I created an issue for it, but I can't find it anywhere. So a quick recap: The traffic AI does not support only providing a pedestrian lane on one side. If you do this, then pedestrians ignore stoplights to get to the side of the road that has the pedestrian lane. To work around this limitation, you have to make the unwanted lane useless by disabling as many crossings connected to it as you can, like this screenshot from my Access Roads:

image

If TM:PE were selectively disabling crossings at segment ends where they "don't make sense," it could be leveraged to resolve this limitation. It would go something like this:

  1. TM:PE has this hypothetical logic that just completely disables a crossing if no pedestrian would reasonably use it to cross the node.
  2. In Adaptive Networks we add a "node traversal only" toggle to lanes.
  3. TM:PE examines the "node traversal only" flag and if it is true, then certain crossings which connect that lane get disabled. I think I already know what the rules would be, but for brevity I won't go into that here unless you want all that.
  4. Additionally, TM:PE would probably need to disable such crossings at node types such as middle nodes, which I'm guessing it doesn't touch at all right now.
kianzarrin commented 2 years ago

Maybe we should not apply the rule above if there are more than 2 pedestrian lanes.

image for example on tram roads ppl need to get from the stops to the sides if there are tram stops near intersection A.

but one can argue they won't need to get to the sides on intersection A and need to get to the sides on intersection B so let them walk all the way to there instead.

In the image bellow they would be trapped if there are no pedestrian crossings: image

Elesbaan70 commented 2 years ago

1558 enables all crossings by default in each of your examples.