-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Temporary solution
Set DLS to less than 50% in mod options.
New Issue Description
To summarize on what this issue is, as seen in the images below, cars often prefer to use one lane other than a bunch of the other open lanes leading into the same direction. My theory on what's happening? I think cars will prefer to use the shortest distance without taking into account the cars that could block their path (taking more time) resulting in vehicles all choosing the same lane.
I mean, that's pretty much it, the previous description included a lot of debate and conversation about the implications of what's needed to make this happen, but I am 99% sure this is the direction I want to steer this issue in (as it's been all over the place).
Previous Issue Description
This was talked about in the Discord, and I'm putting it here so we can include more people. I'll also be transferring over a lot of the discussion we had in the Discord. Images will be uploaded to the bottom of this issue and will be referenced.
Basically, the idea of this feature is that cars will calculate which lane would be the best lane to go into before entering the next segment. The way it would work is like this:
In Image 2, the blue path represents what was already calculated by the main pathfinder. This is what the car will do if all else fails. The red path represents what the car could do because of this feature. Since the lane is clear, it'd result in a better flow of traffic. Now, in Image 3, let's say the car is currently in segment 0. The pathfinder wants the car to go to segment three. It did this by choosing the middle lane. What this logic would do is it would check the other lanes within segment 1 and determine which lane is the best lane to lead the car to segment 3.
For an example of a failed case, the logic would check the bottommost lane (still referring to Image 3). The bottommost lane goes straight, meaning it wouldn't lead to segment three, therefore being an invalid path.
For an example of a success case, there's actually two situations in this image that could be successful: the bottommost turning lane and the topmost turning lane. Since they both get you to segment three, we move on to the next part of the check. We check both lanes to determine how many vehicles are in both lanes. Since the topmost turning lane has the least amount of vehicles, and it satisfies the first half of the check, the AI would switch the vehicle's path to the topmost turning lane.
As I've stated in the past for other development features (turn on red, emergency vehicle calculation), it would be unbelievably helpful to have a utility class that lists the vehicles within a segment's lane. Code wise, there's multiple situations where we would need this feature to get the vehicles in another lane. For this issue, we could use the calculation to determine how many cars were in each lane. This utility class could be updated by the cars pathfinder's themselves, and when the car is on the main path, it would update the segment (or lane) to say that it's in that lane and remove itself from the old lane. It's simple logic that wouldn't need to be done live, and would save many calculations in many features.
Due to the fact this feature overall would require live calculations, however, it's a very controversial issue and is believed to be a huge performance drag. I don't think so, especially if we implement the utility class, but I'd have to see an implementation of it to fully believe it'll cause major issues; and I mean a well made implementation, not a half-assed put together one. It's not like we haven't done this before with other features that would cause a huge performance drop -- we found utilities, better methods, and good ways to make them more performance-safe. And there's a reason we have options, it's to let the user decide which features they'd like to have on or off. If we implement option tooltips that I talked about a little bit with the devs, we could include a warning stating that it could be a performance. Or we could move some other performance-dropping features into a category stating they'll possibly drop performance. I don't think we need to do either of these personally, but some people do, so /shrug.
(Image 2 - The Possible Path Calculations; Blue is pre-calculated, red is live-calculated)


