CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
576 stars 85 forks source link

Lane changes happen at toll boothes #225

Closed VictorPhilipp closed 5 years ago

VictorPhilipp commented 5 years ago

Temporary Workaround

Use the lane connector tool, click the toll booth road node(s) and then press Shift+S to set them all "ahead only"


They should not.

originalfoo commented 5 years ago

@VictorPhilipp Was this still happening recently (likely due to DLS)? If so should this be reopened?

originalfoo commented 5 years ago

This seems to be most recent change to toll booth lane swapping: https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/pull/121/commits/63a653c35c1e856f2be2bb9fcce20376f26ac42e

originalfoo commented 5 years ago

Video of issue still happening on v10.18, via @FireController1847

https://www.youtube.com/watch?v=MYdVGrpmJCQ&feature=youtu.be

originalfoo commented 5 years ago

Still happening in 10.20

Screenshot_3

SubaruSVX commented 5 years ago

I was the one who had that picture.

My savegame: https://steamcommunity.com/sharedfiles/filedetails/?id=1736078702

Where this picture was taken - if you spot the three-way interchange that leads into a city area (not the Bork and Heck University one), you should see that cars are piling up and in some cases, changing lanes in the toll booth.

Also, forgive me, but I use Real Time, so there's a rather long wait.

SubaruSVX commented 5 years ago

Temporary workaround:

This doesn't quite apply to emergency vehicles, but if you were go into the lane connector nodes and press Shift + S where the cars stop in the toll booth, you can get the cars to stay in their lane when they pass the toll booth.

VictorPhilipp commented 5 years ago

The code that determine (whether the node represents a toll booth or not) / (whether lane changes are possible) is erroneous. https://github.com/FireController1847/Cities-Skylines-Traffic-Manager-President-Edition/blob/589be86a2a7272622ba22247c5c1b2b5c5f5b4b2/TLM/TLM/Manager/Impl/RoutingManager.cs#L313

A correct way would be to

  1. check whether the transit node is associated with a toll booth
  2. If yes: prohibit lane changes
VictorPhilipp commented 5 years ago

The method I described above would require running a grid search for every road node on every geometry update.

VictorPhilipp commented 5 years ago

Luckily the draw on performance is not significant. Regular vehicles should now stay in their respective lane. Yet emergency vehicles on duty still change lanes at toll boothes. Actually, I think this is something CO has to fix. Their code does not check whether lane changes are allowed/possible (see VehicleAI.FindBestLane). I will ask them on Monday if they are aware of this problem.

originalfoo commented 5 years ago

So, toll booths are just buildings (with a sub building), for example Twoway Toll Booth Medium 01 which is in category Road:

Twoway Toll Booth Medium 01

and its sub building, Twoway Toll Booth Medium 01 Sub in same category:

Twoway Toll Booth Medium 01 Sub

Can we have a lookup list of nodes, the size of list being whatever the game limit is for nodes, and store the details about nodes in there? One of the details being "is this a toll booth" another detail being "is this straight ahead only" and so on? (or is that what already happens?)

Each time a toll booth building (identified by its AI) is placed, moved or removed, the lookup list gets updated accordingly.

It would be useful to have a consistent 'single source of truth' that the pathfinder can use, to remove as much branching as possible from the decision making code in the pathfinder (and vehicle AIs too if applicable).

VictorPhilipp commented 5 years ago

Routing decisions are already precalculated by RoutingManager. It operates at simulation time (not during path-finding) and updates routing data only if a change in the traffic network is detected.

VictorPhilipp commented 5 years ago

Ok, so CO is aware of the issue with the emergency vehicles. But on the other hand, since TMPE does routing a bit differently we should fix that too.