-
Notifications
You must be signed in to change notification settings - Fork 85
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
Junction restrictions on unnecessary and unreachable pedestrian crossings #1558
base: master
Are you sure you want to change the base?
Junction restrictions on unnecessary and unreachable pedestrian crossings #1558
Conversation
…disable unreachable pedestrian crossings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments above
I like the idea of checking distance from both sides. it did not occur to me. |
I missed that! The existing code is hardcoded to bypass the computation when it's not configurable. (Great example of an unsafe optimization.) Node Controller wasn't affected because of the way the patch works. I'm on mobile, but I'll fix it when I'm back at my computer. |
@kianzarrin Have your concerns been addressed? @krzychu124 Have you had a chance to look at this? |
@@ -645,18 +646,23 @@ public class JunctionRestrictionsManager | |||
return ret; | |||
} | |||
|
|||
private static bool IsNodePedestrianCrossingConfigurable(ref NetNode node) { | |||
return (node.m_flags & (NetNode.Flags.Junction | NetNode.Flags.Bend)) != NetNode.Flags.None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a change. The code was simply moved from another location in this commit: Elesbaan70@8e732e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Elesbaan70 are bend nodes within the scope of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say no. That code was only touched to address an issue with the way default values were handled when not configurable. This PR is about segments without pedestrian lanes, and not really related to the type of node. And this is how the code worked before.
In my opinion, it should be configurable anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works good in game.
hehe, not yet but I'll try to find some time today or tomorrow. Changes make sense and should work as described, I just need to test it in game. |
The original idea that led to this change was just disabling all crossings when no segment on the node has pedestrian lanes at all. Should I put some conditional compiling in place to limit this to just that one change, until the issue you're describing is resolved? |
is it with NCR? |
No, I posted screenshot yesterday on our discord. I've checked networks with Network detective and highway road doesn't have pedestrian lanes, only empty lanes (who knows what for). It's might be just some kind of asset issues but I didn't find anything obvious. I'll try to find the source of that problem at the weekend.
I didn't test this PR yet so it's not related (not caused by your changes). Like I said I'll investigate what is going on and try to fix before we release next Test version |
My concern was that if disabling crossings is what triggers this problem, then until it's resolved, we might want to avoid introducing a disabled default state on nodes where it might matter. |
Yes, I understand, but it's still configurable (assuming there is at least one segment with pedestrian lanes) so there is IMO big chance that user will try to configure it the same way - will spot the same problem before I fix it, plus the thing it is already broken in some cases 😉 |
This resolves #1302.
The "shortest path" is determined by the number of segments a pedestrian must cross, without regard for geometry; so it may not reflect true distances.