Open originalfoo opened 4 years ago
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.
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:
@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?
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: https://github.com/VictorPhilipp/Cities-Skylines-Traffic-Manager-President-Edition/issues/168
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?
In https://github.com/CitiesSkylinesMods/TMPE/issues/578#issuecomment-616089662 , @kianzarrin said: