-
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
Median detection #503
Comments
Just looking through code of the PR referenced above: A median is defined as:
Also, it can affect much more than just path finder, for example:
|
Tagging #89 |
I am wondering how this 1-meter threshold was determined. Below were based my incorrect calculation of lane gaps. The correct way to calculate the spacing is directly (lane separation - lane width). This gives 0.75 m gap between lanes in CSUR so the 1 m threshold already suffices.
|
The 1m gap thing came from #243 I think (author of NExt2). It's not set in stone, it's just what was propposed by that PR. If there is a better value we'll use that. This is the main problem with medians; we have no freaking clue how to reliably identify them (other than something crazy like building a massive list of road asset IDs and manually defining the medians on them all). There are some potential indicators (I guess, I don't really know that much about road assets) - things like spotting a prop/tree lane (I assume those exist?) or a pedestrian lane could indicate median between road lanes. But in many cases central medians on avenue roads are just empty spaces between lanes. Maybe for the empty spaces we could look at median gap between road lanes and anything bigger than that treat as a median? Any info you could provide that could help us narrow down a reliable way to identify medians in general for any road would be much appreciated. Also if there's any way to determine if a median allows crossing at a junction or whether it's a "hard median" (eg. a barrier across it as seen with some workshop roads) that would be extemely useful for guiding bulk junction policy applicators that are currently being developed. |
I see you already posted some info that can help with continuous median detection: #649 (comment) @kianzarrin this might be useful for the stuff you're working on? |
I'm not very familiar with roads outside CSUR, so these are my general ideas about road assets based on how CSUR was made. Let's just assume that most road asset creators are responsible and don't randomly mess with parameters in their roads, such as a 4 m wide lane next to a 3 m wide lane. Median detection using lane spacingStarting with vanilla roads, the lane separation is about 3 m in regular (non-highway) vanilla roads and about 4 m in vanilla highways, and these lanes are correspondingly 3 m wide in regular roads and 4 m wide in highways. Then, a car lane in a road asset is likely 3 m wide if it used a regular road as template and is likely 4 m wide if it used the highway as template. For skinnier highway assets, like the SHUTO expressway, the lane width is likely decreased from the 4 m default. Among road assets using regular roads as template, CSUR likely has the largest lane separation of 3.75 m. The narrowest hard median in CSUR is 1.875 m separating local and express roadways in a road, giving a 2.625 m spacing between two non-cross-able lanes. Solely based on compatibility with CSUR (old and new), a threshold between 0.75 m and 2.625 m can be used to detect medians. For roads without dedicated bus or tram lanes, case in #89 would be much rarer, and the major concern of median detection is to prevent cars from crossing between local and express roadways in roads with "planting strip" medians. As far as I know, there are very few roads with separated local and express lanes outside CSUR. Typically, the local/express median would be narrower than central medians, which also justified that 0.75 -- 2.625 m is a reasonable range for the median detection threshold. Median detection using additional lanesIn vanilla 4-lane roads with medians, there is a prop lane at 0 position for road light and trees with laneType Hard medians at intersectionsCSUR extensively implements continuous medians at intersections when a divided road intersects another road (see #649). Solely for the CSUR case, when the traffic lights are turned off for an intersection with at least 2 roads with medians, traffic should not cross any median (both central median across incoming traffic and local-express median) when passing the intersection. The same logic may be applicable to any road asset with medians and traffic lights on by default, because continuous medians only make sense when traffic lights are off. (For vanilla roads one may manually plop a median across a non-trafficlight intersection to achieve this effect) A more robust way is to just apply this to roads with continuous medians. This can be done by searching for a direct connect node with |
My direct connect mods can change median connection at junctions based in TMPE rules. so there is median if There are no criss crossing lanes at junctions. |
Closing this as it's now all tracked in #1223 |
This is closely related to #89 but there is no issue that details the requirement, hence this issue.
The game does not have any concept of medians. They are purely visual, generated by the road prefab mesh. In other cases, it's not even the mesh that depicts the median, but the road texture (think striped line lane in middle of road).
This poses issues for both pathfinding and DLS. Vehicles should not be able to cross medians; medians should be treated as barriers.
In #243, the proposed solution is to identify medians based on distance between adjacent vehicle lanes.
Note that a road could have median between lanes in same direction. Some examples and illustrations are shown in #89.
What is required:
The text was updated successfully, but these errors were encountered: