Open FireController1847 opened 5 years ago
Technically, if that's a static rule it can be implemented by introducing lane transition costs for junctions in RoutingManager
. If behavior depends on the traffic situation we can extend DLS logic.
Current implementation:
Besides technical aspects: I don't know whether there is a strict rule that prohibits vehicles from turning onto an inner lane while turning right in the US. At least for Europe I am not aware of any such kind of rule.
I just asked my girlfriend what she would do in this kind of situation: "Would you rather (1) first turn to the outermost lane and then later switch to one of the two left-turning lanes or (2) would you rather go for the innermost lanes directly?"
Her answer was: "It depends. If there was conflicting traffic coming towards me I would probably do (1), otherwise (2). It also depends on (3) whether I know the route by heart.". I probably would have given the same answer.
The new point she made (3) could be approximated by checking if the driver is a tourist. Such a logic has already been facilitated with the Parking AI: If you're a tourist you don't know of any parking possibilities beforehand. You first drive to your destination and only then start searching for a free parking spot.
This page from Utah's Driver's Handbook might be helpful with the implementation and logic of this feature. Funnily enough, it also has a small amount of information about #25 (turn-on-red) logic for one-way roads.
For archiving's sake, I will post the important section from the handbook here.
RIGHT TURNS Signal right for two seconds. Do not swing wide to the left before a right turn and always turn right from the right side of your lane.
LEFT TURNS Signal left for two seconds. Yield to oncoming traffic and always turn left from the left side of your lane.
MULTIPLE LANES Enter the same lane from which you are turning and stay in that lane until the turn is finished.
Turning from a two-way street onto a one-way street and from a one-way street onto a two-way street you may turn left onto a one-way street from a one-way street on a red light after first coming to a complete stop.
A person may not operate a vehicle over, across, or within any part of an island.
What handbooks say and what drivers do are often two different things ;)
While this is correct, some of the moves I've been watching vehicles do are extremely dangerous and would result in their death. And even though I've seen people cross multiple lanes, I haven't seen them do it nearly as much as you would expect. Later today I might be able to get some images of some examples, as well as possibly some in-game clips of these death-resulting actions. For all I know maybe all we need to do is tone down the severity of how sharply they turn.
What handbooks say and what drivers do are often two different things ;)
... which is why we go to our girlfriends for advice on traffic management ;P
Basic concept is below. In many countries it's illegal to make any lane change outside of the one closest to the curb (or, if turning from a double right (left for left-hand), the next closest one to the curb).
Of course, realistically in certain situations, it's almost remotely impossible to turn into the nearest lane. This means if our destination is nearby (possibly the next or near tile in the Vehicle Grid) then they should be allowed to cross multiple lanes.
But, at this specific example, most people don't do that, they do this.
Possibly what we could do is temporarily set the path's target lane before we make the turn, and at the same time store the original path's lane, and have the vehicle move over after they've already turned. Although I'm unsure of the complications of this.
Also, this not only happens at turns. Often I'll find vehicles in the game crossing from the innermost lane to the outermost lane, crossing a total of 6 lanes. This is completely unrealistic and is a federal crime in the real world. I'd assume this has a lot to do with the realistic vehicle AI, so it is probably more in that category. Just wanted to put this out there, however.