Dear Devs: A proposal for improved (and performant) traffic lane distribution AI

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
I don't think I understand the advantages to this system.

Currently, if you see a long line of cars, you go to the front of the line to see where the congestion is happening and improve outflow of traffic, the dispersal of traffic is off in some way.
All traffic on the same road travels at the same speed, merging is a nightmare and causes congestion in multiple lanes which will lead to more problems in more areas. But the end fix is exactly the same, improve your dispersal at the end so that the cars get where they need to go.
 
One problem I would like to see an elegant solution to is dynamic re-routing.

Let's say you have 3 lanes and only one turn right but two of them go forward. Pretty much cars have a destination possible to reach by turning right, but instead of doing so they re-route upon seeing the big queue and take a slightly longer route that will get them to their destination much faster due to traffic.

This happens in reality and works to distribute traffic more evenly.

One potential way might be for the game to actually dynamically adjust what turns are allowed instead, so that the intersection tracks that say 90% of the cars want to turn right, and "changes" the markings after a while to actually allow all 3 lanes to make a right turn.
 
If we have this happen instead of de-spawning the traffic (IE the dynamic behavior only shows up WHEN it's needed and not before) might that cut down on any processor load increase?
 
are you saying that each car should have a pre-designated lane that they will always use?

Yes, essentially. They would have a lane preference that would come into play (during the route pre-calculation, not on-the-fly) whenever they have a choice of multiple lanes that all lead in their desired direction.

The numbers I posted (random # between 1-60, etc) is just an idea for a specific implementation that should be highly performant... you could generate lookup tables for all the possibilities which would run exceptionally fast, no actual math or decision-branching required at all.


So what happens when you have two lanes that can turn left onto a two-way street, so 50% of traffic is using each turning lane, but then after both lanes turn left they both need to turn left again but this time there is only one turning lane?

Then what you would have is one lane trying to merge into the other, which would cause massive backups anyways. The difference being is that now the entire two-way street is backed up, preventing cars from turning left AND right, rather than the current system which only blocks the left.

Yes, it is entirely possible (likely, in fact) that resolving one bottleneck will reveal new bottlenecks "further down the line", and in certain circumstances these could even be more detrimental to traffic flow than the original issue.

But that's the nature of the beast when trying to resolve bottlenecks, all you can do is deal with one at a time. If that pushes the problem "further down the line", that is generally A Good Thing.

In your above scenario, there could certainly be a new merging issue AFTER the intersection, instead of the "single-file problem" BEFORE the intersection. But I would still view that as an improvement. And it's a realistic problem that actual traffic faces, with realistic in-game solutions (eg, provide more lanes/higher capacity routes to the destination).
 
Mostly, the traffic problem I've seen this far on the forum are the result of bad road layout or interchange design. In real life, people in the car would be complaining about how stupid the road are set, but here, it's the counterpart. And I think most of the problem could be solved by having more road type, and especially assymetrical road, like 5 lane, or 3 lane road.
 
  • 3
Reactions:
This solution only addresses one of the problems and wouldn't really go far enough.

Another problem is every car switches to its turning lane at the exact same distance from the turn, leading to non-optimal lane usage. To address this, the point at which the car will switch to its turn lane should also be randomized. So for example some cars will switch lanes at 1/2 mile out while others will wait until the last minute, and everything in between, randomly distributed. Now multiple lanes are being used even if all the cars are going to be making the same turn.

The third problem is that cars changing lanes seem to block traffic in the lane they are changing to. I don't have enough information to offer a solution to this. You'd need to know a lot more about how much cars are able to vary from their route plan. Obviously some variance is required because you can't predict traffic lights, stopped traffic, emergency vehicles and cargo deliveries. So maybe there is a way to allow some variance during lane changes which would make this process smoother.
 
Is it possible to mod the behavior of emergency vehicles so they always take the right of way? they sit in traffic in the turning lane at red lights for example. They should be able to go around anything even the wrong way on roads. Can it be changed? This would help so many problems with the game.
 
Really the key here is that the AI already knows the best path to where they are going. I traveled extensively in the past four years and before Google Nav added "proper lane selection" and "dynamic traffic rerouting" while driving, I basically was in a random lane. If I wanted to turn right in a few intersections, I would be in the right most lane, but then it would turn into a right turn only and then I would have to merge left to make it through that intersection and actually turn right at the next.
Again, the AI already knows the proper lane to be in, so the traffic stays in that lane, regardless if they could "pass traffic" and pick a better one. Dynamic decisions like this would require lots of CPU power, IMHO.

Edit: my point being that "proper lane selection" and "dynamic traffic rerouting" while driving may require the collective power of Googles billion servers and not a desktop/laptop computer that most of us are using. :)
 
I like this thought process, anything that adds a little random or inefficient is always welcome in a game like this.

City Builders have a penchant for creating utopian situations that just don't happen out here in the real. This little
idea may not totally solve the issue, but it's enough to make a start as opposed to rehashing and over thinking the
problem to perfection or death, whichever comes first.

To take this to the next logical step: What if the number assigned chose the 2nd, 3rd or 4th fastest calculated route instead..?
Conceivably you could use just 3 weighted choices in a 50-30-20 something split. 50% take the fastest, 30% take the 2nd and
20% take the 3rd fastest route to a destination. Heck, even a 70-30 with only two classes would be enough to have a substantial
impact. I'd think this would also be more feasible computation wise as opposed to individual cars..?

Either way, I'll take a little "imperfect" behavior to spice things up whether it solves the problem perfectly or not. Nice thought... :cool:

Now if we could only extend this thought process to having everyone educated including the family dog and to buildings leveling up.
_
 
I don't think I understand the advantages to this system.

Currently, if you see a long line of cars, you go to the front of the line to see where the congestion is happening and improve outflow of traffic, the dispersal of traffic is off in some way.
All traffic on the same road travels at the same speed, merging is a nightmare and causes congestion in multiple lanes which will lead to more problems in more areas. But the end fix is exactly the same, improve your dispersal at the end so that the cars get where they need to go.

I'm pretty much in agreeance with you on this one. I'm not saying that it's always going to be the case, but essentially this is main point.

Yes, it is entirely possible (likely, in fact) that resolving one bottleneck will reveal new bottlenecks "further down the line", and in certain circumstances these could even be more detrimental to traffic flow than the original issue.

But that's the nature of the beast when trying to resolve bottlenecks, all you can do is deal with one at a time. If that pushes the problem "further down the line", that is generally A Good Thing.

In your above scenario, there could certainly be a new merging issue AFTER the intersection, instead of the "single-file problem" BEFORE the intersection. But I would still view that as an improvement. And it's a realistic problem that actual traffic faces, with realistic in-game solutions (eg, provide more lanes/higher capacity routes to the destination).

I hear ya. I've been reading over a lot of threads and responses about the traffic behavior, and from what I gather the biggest issue seems to be that the visual of a big, high-capacity street with only 1 lane being backed up looks very unappealing and unrealistic to players. Even if the traffic congestion is legitimate (they all need to use the same turning lane), you'd rather have the entire street clogged rather than just one lane.

Would you agree with that? I'm thinking of a possibility of having vehicles use the late-lane-merging behavior only on 6 lane streets, or other high capacity roads. And keep the current system for smaller roads.
 
I hear ya. I've been reading over a lot of threads and responses about the traffic behavior, and from what I gather the biggest issue seems to be that the visual of a big, high-capacity street with only 1 lane being backed up looks very unappealing and unrealistic to players. Even if the traffic congestion is legitimate (they all need to use the same turning lane), you'd rather have the entire street clogged rather than just one lane.

Would you agree with that? I'm thinking of a possibility of having vehicles use the late-lane-merging behavior only on 6 lane streets, or other high capacity roads. And keep the current system for smaller roads.

I think this is pretty much the concern most people have. If they have a bunch of cars stuck at a bottleneck, they will blame their poor road layout and fix it. If they see a conga line they blame the AI. Blaming poor road layouts is the better outcome. (and any of the more hardcore gamers who bother about how to optimise layouts based on AI behavior will quickly adapt).
 
I am not sure if you fully understand the underlying problem or discomfort. If the suggestion of late lane merging resolves the issue of lane utilization (especially when turning off a multi-lane road onto another multi-lane road) then great. But if all late lane merge does is move the merging point further up the road and ignores the use of multi-lanes then I'm not sure if that's an improvement (but anything that will help in increasing lane utilization for multi-lane roads is appreciated).

Edit: in response to Azurespecter's recent post/suggestion.
 
I hear ya. I've been reading over a lot of threads and responses about the traffic behavior, and from what I gather the biggest issue seems to be that the visual of a big, high-capacity street with only 1 lane being backed up looks very unappealing and unrealistic to players. Even if the traffic congestion is legitimate (they all need to use the same turning lane), you'd rather have the entire street clogged rather than just one lane.

Would you agree with that? I'm thinking of a possibility of having vehicles use the late-lane-merging behavior only on 6 lane streets, or other high capacity roads. And keep the current system for smaller roads.

Partly so. As you discribe it all cars would still only use one lande to turn, just merge later to use that lane. That would indeed look better and give players a better feeling but without tackling the underlying problem.
The method proposed by the OP would not directly change the merging behaviour of the vehicles, but instead increase the number of lanes used on each intersection. That not only looks better but also alleviates traffic problems.
 
...A) the biggest issue seems to be that the visual of a big, high-capacity street with only 1 lane being backed up looks very unappealing and unrealistic to players. Even if the traffic congestion is B) legitimate (they all need to use the same turning lane), you'd rather have the entire street clogged rather than just one lane.

A) For my part, I really don't care too much the visual except insofar as it imparts information (see B). And for some reason, in my maps with six-lane roads with two turning lanes at junctions, I still have only one lane backing up. (I freely admit that this is hardly "proof".)

B) If the traffic were so high as to warrant such a blockage, yes. At the moment, only one lane blocked imparts less information, IMO, than what you describe here.


I think this is pretty much the concern most people have. If they have a bunch of cars stuck at a bottleneck, they will blame their poor road layout and fix it. If they see a conga line they blame the AI. Blaming poor road layouts is the better outcome. (and any of the more hardcore gamers who bother about how to optimise layouts based on AI behavior will quickly adapt).

I would disagree with the last part: in order to play the traffic game as is is to have to create extraordinary counter-intuitive designs. (Though part of the issue in the below picture would be taken care of if there were always two turning lanes if the road going off it had the capacity.)

CD0u1i.jpg


We are not talking about one road with one junction which causes traffic to back up. In no street in the world will everyone pile up on the innermost lane because they plan to turn off at the next junction, the one after that, and the one after that. That seems to be the issue. Most people simply do not take the innermost lane in preparation for a turning which could be a kilometre away. :)


While I'm not sure that anyone has fully satisfactorily modelled traffic dynamics as a whole (let alone per lane), I cannot see - based on my very limited experience of the game - why the OP proposal would result in an outcome worse than the present, and many instances where it would be better... Worth spending some time on it, I think.
 
I am not sure if you fully understand the underlying problem or discomfort. If the suggestion of late lane merging resolves the issue of lane utilization (especially when turning off a multi-lane road onto another multi-lane road) then great. But if all late lane merge does is move the merging point further up the road and ignores the use of multi-lanes then I'm not sure if that's an improvement (but anything that will help in increasing lane utilization for multi-lane roads is appreciated).

Edit: in response to Azurespecter's recent post/suggestion.

That's exactly the point we're trying to make. We can make the cars use all lanes, but they're still going to get stuck at the exact same bottleneck. The only difference is that instead of a 1-lane-line, you'll get all lanes backed up. Visual, and honestly it's actually more harmful for your city that way.

Partly so. As you discribe it all cars would still only use one lande to turn, just merge later to use that lane. That would indeed look better and give players a better feeling but without tackling the underlying problem.
The method proposed by the OP would not directly change the merging behaviour of the vehicles, but instead increase the number of lanes used on each intersection. That not only looks better but also alleviates traffic problems.

I don't know, maybe I'm missing something still in the OP's suggestion. I simply don't see how traffic problems would be any better. As said above, and parroted by many, many other players... all you're doing is changing the congestion layout. The bottleneck will still exist, doesn't matter if it causes a conga line or a whole 6-lane street jam.

I need to make some visuals for better explanation I think, haha.

[Edit] And for Emre Yigit (since we posted at the same time) - you are correct, but getting vehicles to merge properly and efficiently is much easier said than done =/
 
Last edited: