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

Pedestrian crossings review #854

Open
originalfoo opened this issue Apr 19, 2020 · 2 comments
Open

Pedestrian crossings review #854

originalfoo opened this issue Apr 19, 2020 · 2 comments
Labels
JUNCTION RESTRICTIONS Feature: Junction restrictions Pedestiran Crossing

Comments

@originalfoo
Copy link
Member

Need to check that our pedestrian crossing logic is correct. Triggered by this image - why are there ped crossings on highway roads that don't have pedestrian lanes?

img

In #578 (comment) , @kianzarrin said:

I did brought this up int he pull request #845 (comment).

Fixing it would be as easy as setting IsPedestrianCrossingAllowedConfigurable() to false

if the road does has 2+ pedestrian lanes:
    IsPedestrianCrossingAllowedConfigurable = true
    GetDefaultPedestrianCrossingAllowed = true
else if the road to the right has pedestrian lanes AND the road to the left has pedestrian lanes
    // maybe this logic should be more sophisticated to check that the pedestrian lanes is on inner/outter side of the road
    IsPedestrianCrossingAllowedConfigurable = true
    GetDefaultPedestrianCrossingAllowed = true
else
    IsPedestrianCrossingAllowedConfigurable =  false
    GetDefaultPedestrianCrossingAllowed =  false

The GUI automatically does not show pedestrian crossing overlays if they are disabled. Actually in my mod I have patched TMPE to hide pedestrian crossing overlays when appropriate.

@kianzarrin
Copy link
Collaborator

kianzarrin commented Apr 30, 2020

Screenshot (951)
updated algorithm to handle special case like urban highway connection above. even if the road does not have pedestrian lanes pedestrian can cross.:

//psudo code

segment.SortedLanes[0] is pedestrian => segment has pedestrian lane on the right (going toward the junction).
segment.SortedLanes[count-1] is pedestrian => segment has pedestrian lane on the left(going toward the junction).
bool HasPedestiransOnRight = segment has pedestrian lane on the right OR segment.RightSegment has pedestrian on the left
bool HasPedestiransOnLeft = segment has pedestrian lane on the left OR segment.RightSegment has pedestrian on the right


IsPedestrianCrossingAllowedConfigurable = HasPedestiransOnRight and HasPedestiransOnLeft
GetDefaultPedestrianCrossingAllowed = 2+ pedestrian lanes

So the highway-urban junction above pedestrian crossing is configurable but is banned by default.


Screenshot (955)

I also would like to avoid ugly wierd junction transitions like above:

if node has two segments:
	GetDefaultPedestrianCrossingAllowed &= segment.size < otherSegment.size // pedestrian corssing is allowed on the smaller segment only.
	for equal segments only the first one gets pedestrian crossings by default.

With this code (and the hide crossings mod) the zebra crossings will look like this by default but both are configurable:
Screenshot (952)

@aubergine10 what do you think?
should we ban crossings across highway-urban junction by default?
in a node with two segments, should we remove crossing on the bigger segment by default?

@originalfoo
Copy link
Member Author

originalfoo commented Apr 30, 2020

Yes, that looks good. IMO we could probably ban crossings on any road with 4+ lanes (medium/large/highway roads) unless there is a traffic light to ensure safety of pedestrians.

However... I think we will need to look carefully at pathfinder to ensure that cims with check other side of a node. In the image directly above this comment, a cim walking along the road with grass verges hoping to cross to other side is likely to assume there is no crossing rather than notice the crossing on the smaller road. I'm not sure if that issue ever got fixed: VictorPhilipp/Cities-Skylines-Traffic-Manager-President-Edition#168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JUNCTION RESTRICTIONS Feature: Junction restrictions Pedestiran Crossing
Projects
None yet
Development

No branches or pull requests

2 participants