CitiesSkylinesMods / TMPE

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

Warn if destination is unreachable #321

Open RenaKunisaki opened 5 years ago

RenaKunisaki commented 5 years ago

Recently I had an issue with some service/industry buildings failing to spawn vehicles (trucks in use goes from 0 to 1 and immediately back to 0), and after a lot of investigation, I discovered the cause: the only route to some buildings went through a road that had banned trucks. Removing the restriction solved the problem.

It would be a big help if TMPE reported (even just to Debug.Log) when pathfinding fails, where the source and destination are, so that we can more easily find such broken routes.

CosignCosine commented 5 years ago

I was under the impression that this operation would be extremely expensive when scaled to the entire vehicle simulation under a detour (although I may be wrong).

originalfoo commented 5 years ago

TMPE already shows which destinations cims are trying to get to on one of the info views (traffic, or routes, can't remember; Real Time does similar).

For showing the route though, we'd probably need a diagnostic tool. We can't just take the point at which pathfinder fails, as that probably won't highlight the problem (the patfinder will keep trying other routes beyond the main problem point).

Related issue: https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/issues/96

RenaKunisaki commented 5 years ago

Right, with this problem though the info views don't show any route because it can't find any. I'm talking about just a log message like "Failed to find route from Some Company (building 12345) to Some Shop (building 7511)", just to draw attention to the fact that a routing problem exists.

Personally I have the game's debug log displaying live on another screen, so even that would be enough for me. I assume you'd want some kind of in-game display of these messages too, though.

Also worth noting, this applies to trains too, and metros with Metro Overhaul Mod. If the track has too sharp of a bend, trains just won't use it, and metros will spawn at the depot and immediately despawn if they can't find their way to the line. (MOM adds depots)

originalfoo commented 5 years ago

There's probably something along those lines if you build the mod from source in DEBUG setting.

rogermartensson commented 4 years ago

It would be really nice if this could be shown either in the "Failing building" or using a "search for a fix mod" with it's own window.

If possible it show the name and be clickable so you can "zoom into" the failing building. Atleast then one have a starting point to look for what is wrong.

A more advanced way would be to show where the most paths fail but that I guess would be pretty hard to show.

Anyway. There seems to be some problem with the pathfinding in the TM:PE-mod because the problem disappears when disabling the mod. I've tried to disable the all the settings (or changing if multivalued) and that doesn't help. If there was a button to disable the pathfinding while in-game that would be a good test.

kvakvs commented 4 years ago

Possible solution: Introduce a storage for N most recent problems per building id, or most recent in last minute, and when user opens a building info window, show a text label with the description of the last discovered problem or two. For example: Delivery vehicle failed to find a path to destination.

rogermartensson commented 4 years ago

I had two problems. One was due how I have set up my roads with TM:PE. It sure took a while to find it. :) The other was a Recycling center that got fixed when I turned off "highway lane rules". On this one I didn't find the "real reason of the problem".

The pathfinding isn't the problem here. It can't find the destination so it bails out. From my view as a user it seems that the when it fails it stops trying to find another route. For example. I had some resource storage that could've been used but when it was in "no path found"-mode it never got used.

If there is a way to show, on the building, that there is a problem finding a path to a building (with clickable name to "zoom" to building) that would be great.

I think someone with insight should take a look and see if the pathfinding could blacklist a building for delivery because there is no path to it. Then it wouldn't be stuck trying to spawn trucks.

If it is a delivery that fails then the building needing material would show as "not getting enough resources" so that would be a sign there is something wrong, possible, around that building. Same would be with other services. Other game play mechanics would show it's something wrong.

Then it would be possible to "debug" the city. ;-) This could be a bit hard because it's not that obvious that the problems is because of bad or wrong roads. So some sort of error at the resource producer would be nice.