Feature: Add news notifications for significantly delayed trains #7954
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Occasionally in single-player games, I get deeply engrossed in new construction projects only to find out hours later that I've inadvertently constructed the perfect deadlock; or I throw several new trains on a line which is nearing capacity and fail to realize that the newly introduced congestion is crowding out my profitable shared city stations.
Locating the source of these congestion points is quite easy. First, you wait until the end of the next full year.. then you observe the flood of notifications about unprofitable trains. Then you fix it. Easy, right?
But wait, if we can notify about unprofitable trains, and you can certainly notify about those ships with pathfinding issues... why can't the game tell you when your trains are deadlocking? Challenge accepted! Let me just put together a menu item...
Bit of digging around and hacking on the code...
et, voila! Stop a random train on one of your congested routes, and a short while later you'll see this message pop up. I recall the particular congestion point that caused me to write this patch, but what I didn't expect is that the first time I loaded up my game with this, it pointed out yet another highly congested track down at the bottom of my network! I hadn't looked down there for years!
I had to run a few variations on this patch to tweak the threshold, I found that path delay * 2 *
DAY_TICKS
was a reliable point where you don't receive false alerts, but it will still reliably detect deadlocks and highly congested paths. Moderate congestion does not trigger the alerts.Let me know what you think!