Skip to content
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

"Ban cars/trucks on bus lanes" causes issues with industry #85

Closed
originalfoo opened this issue Feb 14, 2019 · 21 comments · Fixed by #1381
Closed

"Ban cars/trucks on bus lanes" causes issues with industry #85

originalfoo opened this issue Feb 14, 2019 · 21 comments · Fixed by #1381
Assignees
Labels
BUG Defect detected duplicate Duplicate of existing issue high priority Affects lots of users PATHFINDER Pathfinding tweaks or issues VEHICLE RESTRICTIONS Feature: Vehicle restrictions

Comments

@originalfoo
Copy link
Member

originalfoo commented Feb 14, 2019

Fixed in TM:PE 11.6.4.8

We recently fixed the last known remaining cause of this bug in TM:PE 11.6.4-hotfix-8 :)

It seems there's an issue with Ban private cars and trucks on bus lanes (Policies tab in mod options) which makes it hard for industry vehicles to spawn from their buildings and/or reach their destinations.

I believe this could be part of the problem that's causing #24 (low amount of service vehicles) too.

I don't have a big enough city to do full testing, but on cursory glance with a small city it seems that vehicles will often despawn (shortly after spawning) if the car/truck ban option is set for bus lanes.

As far as I can tell, the Ban private cars and trucks on bus lanes option works slightly different to using normal vehicle restrictions, in that it's somehow applied as a default to all bus lanes (user can override via vehicle restrictions tool).

This seems to be giving the pathfinder grief. I've asked a Steam user to share their save for further investigations.

One possible solution might be to ignore bus lane restrictions when vehicles are spawned (ie. their first segment of travel) and also when they are reaching destination. I have no idea how that would be achieved but imagine some sort of conditional skip of vehicle restrictions in pathfinder code?

@originalfoo
Copy link
Member Author

originalfoo commented Feb 14, 2019

Save game for testing: https://steamcommunity.com/sharedfiles/filedetails/?id=1655608410

I've not yet managed to successfully load that save :/

@originalfoo
Copy link
Member Author

I've been able to reproduce this issue on a new city.

Steps to reproduce:

  1. Create a big ring road made entirely of 4-lane avenue with bus lane
  2. Connect to highway
  3. Zone a bunch of residential, and place relevant services (water, electricity, etc...)
  4. Place an industry "main building" (in my case a farm district)
  5. Paint that district bigger and plop some extraction, processing and storage builings
  6. Wait for it all to get going

What happens:

  • Production buildings (not all, just some) start complaining that their crops aren't being collected (storage full).
  • Processing buildings that require those raw resources (crops) complain they have no crops.

What should happen:

  • Production (crop) buildings should supply the processing buildings

Mod settings:

  • Ban cars/trucks from bus lanes
  • Vehicle restriction aggression: high

Notes:

  • If I set vehicle restriction aggression to low, the problem subsides as new vehicles spawn.
  • If I disable 'ban cars/trucks on bus lanes' option, the problem subsides as new vehicles spawn.
  • This suggests that, at least in the case of industry districts, the vehicles are struggling to find paths while bus lane restrictions are strongly enforced.
  • I'm not sure whether this is in the initial segment (vehicles spawning from producer) or final segment (vehicles delivering to processing), but one or both of those is likely were the problem lies.

@originalfoo
Copy link
Member Author

Image showing city setup. The square-shaped road and the road in industry district are both "4 Lane Road with Bus Lanes".

When "ban cars/trucks from bus lane" is disabled, or when it's enabled but "vehicle restriction aggression = low", things seem to work OK

working

But when "ban cars/trucks from bus lane" and "vehicle restriction aggression = high", this happens:

fail

@krzychu124 krzychu124 added the BUG Defect detected label Feb 15, 2019
@originalfoo
Copy link
Member Author

After another 5 mins (about 15 mins in to gameplay total):

  • The crop farm top-right (opposite it's identical twin with 'storage full' warning) has so far never shown the warning icon. Yet both are showing full crop output storage, both have full workers, both have 0/8 trucks in use.
  • Additional processing buildings were complaining of lack of crops. I therefore suspect the key issue might be the final segment (delivery) - otherwise by now outside connections would have started supplying crops?

@originalfoo originalfoo added the high priority Affects lots of users label Feb 15, 2019
@originalfoo
Copy link
Member Author

Sentient_Worm, who first reported the bug, states that similar is also happening with taxis. I suspect this bus lane issue is affecting all sorts of things, such as lack of service vehicles spawning.

Bumping issue priority.

@originalfoo
Copy link
Member Author

Just been looking at screenshots of my old city (it died because road assets were deleted from workshop) where I was having trouble with taxis and hearses in my main district - both were on bus roads. Interestingly, taxis and hearses from a rural district were working fine - no bus roads in that area.

Sentient_Worm mentioned that he suspects both spawning and delivery segments are issues (not just delivery as I had postulated above) and that does seem increasingly likely.

So this issue has been around for a long time, at least since Industries DLC updates to the LinuxFan version of TMPE, possibly much longer.

@krzychu124
Copy link
Member

BTW. Is it normal that I can't set road segment with bus lane to allow all vehicles?

@originalfoo
Copy link
Member Author

BTW. Is it normal that I can't set road segment with bus lane to allow all vehicles?

I think user should be allowed to override the default. It should work like the option to allow u-turns, where use can set default in mod options but override per-junction if desired.

@krzychu124
Copy link
Member

Strange thing...
When you change your road segment type to 6-Lane Road with Bus Lanes, cargo trucks can even cross middle lane to get to the factory (tested with general industry zone (orange)) which means no problems with low raw materials.

4 lane Road with bus lanes seems to break something in pathfinding or additional logic which prevents crossing median has a bug 😕

@originalfoo
Copy link
Member Author

There are definitely problems with medians. I'm not sure how asset editor defines them, like are they are special kind of lane, or just part of the 3D model? I suspect the latter, in which case the pathfinder (and everything else) will be oblivious to them. As for the differences between roads, I suspect that's down to NetInfo.m_CanCrossLane (as discussed here). I'll create separate issue relating to medians as I think they need some dedicated investigation time, particularly in respect to bus routes, but several other things too.

I've not done much testing with general industry zoning; since Industries DLC I've almost exclusively used industry districts instead, but will do some experimentations later today.

@originalfoo originalfoo mentioned this issue Feb 16, 2019
@rawrfisher
Copy link

Can anyone help me prove/disprove a hunch I have reguarding the industries bug?
I was getting the bug while having the ban cars and trucks on bus lanes option deactivated but it only started to occur after I placed a couple grain silos to import grain to speed up production of special goods.
All Buildings are on Small 4 lane road or industry roads I have yet to place anything with bus lanes.

@originalfoo
Copy link
Member Author

I'll test this out next time I'm in game and see if I can reproduce the problem.

@originalfoo originalfoo pinned this issue Feb 20, 2019
@originalfoo
Copy link
Member Author

originalfoo commented Feb 21, 2019

I'm currently doing some more testing on this.

I've got 2-lane 2-way roads to my industry area (farming again, like before) and so far no problems. I've not yet built any warehouses or storage, and I don't yet have any bus roads.

Just added grain silos and a barn, everything still looks ok - lorries are collecting and delivering as expected.

Just added warehouses and still everything ok. Remember, this is without bus lanes. Just about to see what happens with 4-lane normal roads...

@krzychu124
Copy link
Member

krzychu124 commented Feb 21, 2019

I've made few tests yesterday with farming and forestry with every building plopped. With farming I've had huge problems with congestion on roads to silos and barns...

Edit.. not bus lanes ofc..

@originalfoo
Copy link
Member Author

originalfoo commented Feb 21, 2019

Yeah, when industry is working it's lots of traffic. There are some mods that increase industry vehicle capacity or ensure industry vehicles are more fully filled etc.

4 lane 2 way normal road (no bus lanes)

I've upgraded the 2-lane 2-way roads from previous test to 4-lane 2-way (no bus lanes) roads, and started rebuilding my industry.

I noticed some minor problems here, specifically that vehicles can only choose innermost lane when doing u-turn at end of road. This means they are unable to reach any buildings near the end of that road (they need to travel at least another segment before they can reach outside lane).

I think this could be part of our general pathfinding issues and will hopefully be relatively easy to fix. It might also alleviate the "despawning" issue a little.

What is happening:

  • Vehicle reaches end of road and does u-turn, but only on to innermost lane of other direction

What should happen:

  • When making u-turn at the end (ie. dead-end / cul-de-sac) of a multi-lane road, it should be able to choose any of the lanes going in the other direction (not just innermost lane).

EDIT: I'll create separate issue for this.

@originalfoo
Copy link
Member Author

Seems the limitation with u-turns is at least partly responsible for issues with industry not dispatching / receiving deliveries:

meh

Note: These are the only enabled options on the policies tab:

policy

I don't have "ban car/truck on bus lane" set (not that it would matter as my test city here has no bus lanes).

Also, when I go in to junction restricitons, this is what the uncustomised junction looked like:

junct

Maybe the icons weren't updated? When I clicked to enable the u-turn at that junction, both the u-turn and the change-lanes icons went green, indicating possible issue with icon initial state or refresh?

To clarify: I believe the u-turn was enabled for junction, but icon wasn't showing correct state. I had not done any customisation on that junction (or any other) although I had recently upgraded that road from a 2-lane 2-way small road. (maybe the desync issue discussed elsewhere?)

I had noticed, however, very few vehicles doing u-turns at that T-junction. I would expect grain farms at other end of road would u-turn at the dead-end, drive down the other side (that the flour mill is on) and then u-turn at T-junction to make delivery to milking parlour and cattle shed. Instead, the only deliveries I've seen to milking parlour and cattle shed seem to be from outside connections.

Thus, I suspect a u-turn issue of some kind (either settings desync after road upgrade, or the issue with u-turns limiting to innermost lane) may exist at the T-junction.

@originalfoo
Copy link
Member Author

Testing with 4-lane 2-way with bus lanes

Notes:

No major issues when "ban cars/trucks on bus lanes" option disabled.

I then enabled the option but with "vehicle restriction aggression" set to "medium" and still no major problems.

However, when I set "vehicle restriction aggression" to "high", this quickly happens:

yarg

I then set restriction aggression back to medium and the problems quickly dissipated (farms started spawning vehicles and deliveries were made).

I think what we need, when restriction aggression is high, is to allow 'flexible routing' (of the sort seen in #101) on the segment where a vehicle spawns and also on the segment (and possibly preceding segment to allow lane changes?) where it makes a delivery.

@VictorPhilipp VictorPhilipp self-assigned this Mar 14, 2019
VictorPhilipp added a commit that referenced this issue Mar 14, 2019
@VictorPhilipp
Copy link
Collaborator

@aubergine10

I think what we need, [...] to allow 'flexible routing' (of the sort seen in #101) on the segment where a vehicle spawns and also on the segment (and possibly preceding segment to allow lane changes?) where it makes a delivery.

This is already implemented.

@VictorPhilipp
Copy link
Collaborator

VictorPhilipp commented Mar 14, 2019

Duplicate of #101. This has nothing to do with the "ban cars on bus lanes" policy but with the restriction that vehicles can only perform u-turns from the innermost lane. This has been fixed for #112.

@VictorPhilipp VictorPhilipp added the duplicate Duplicate of existing issue label Mar 14, 2019
@FireController1847
Copy link
Collaborator

Should we now unpin this issue for the two reasons listed above?

@krzychu124 krzychu124 unpinned this issue Mar 17, 2019
@originalfoo originalfoo added VEHICLE RESTRICTIONS Feature: Vehicle restrictions PATHFINDER Pathfinding tweaks or issues labels Aug 12, 2019
@originalfoo originalfoo added this to the 1.10.17 milestone Feb 9, 2022
originalfoo added a commit that referenced this issue Feb 9, 2022
- [Meta] TM:PE 11.6.4-hotfix-8
- [Meta] Bugfix for vehicle spawning/delivery on restricted lanes
- [Fixed] Allow vehicles to use vehicle-restricted lane when spawning/delivering #1381 #1380 #494 #85 (krzychu124)
@originalfoo originalfoo modified the milestones: 1.10.17, 11.6.4-hotfix-8 Feb 9, 2022
@originalfoo
Copy link
Member Author

Just changed milestone to 11.6.4.8 which finally fixes the vehicle restrictions (bus lanes) part of this issue in PR #1381

The other part of the issue (problems with u-turns) was fixed back in 1.10.17 in PR #233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Defect detected duplicate Duplicate of existing issue high priority Affects lots of users PATHFINDER Pathfinding tweaks or issues VEHICLE RESTRICTIONS Feature: Vehicle restrictions
Projects
None yet
5 participants