Page 1 of 1

Mod to Visualize Train Network Efficiency & Congestion

Posted: Mon Jul 28, 2025 4:20 am
by lilycollins9x
I've been diving deep into building large-scale train networks lately, especially on megabase-style maps. One recurring problem I face is understanding where trains are spending most of their time — which segments are congested, which stations are underutilized, and where delays are building up.

The vanilla game gives basic train stats and schedule info, but it's hard to get a clear visualization of:
  • Queue lengths at stations
  • Average waiting time per stop
  • Tracks with heavy vs. light usage
  • "Dead zones" where no trains ever go
Wouldn’t it be great to have a mod that overlays heatmaps on the rail network, tracks throughput over time, and highlights bottlenecks?

Something like the circuit network visualization — but for trains.

I imagine it could also help players who use LTN or other train-based logistics systems to optimize throughput. Has anyone seen or made something like this? Or is there interest in collaborating to develop such a mod?

Re: Mod to Visualize Train Network Efficiency & Congestion

Posted: Sat Aug 09, 2025 2:32 am
by lilycollins9x
I’d love to hear if anyone has ideas, prototypes, or even partial solutions that could point us in the right direction.

Re: Mod to Visualize Train Network Efficiency & Congestion

Posted: Sat Aug 09, 2025 11:38 am
by robot256
https://mods.factorio.com/mod/train-trails gives some of what you need in a fun way.

You could also achieve this with basic combinator circuits and display panels scattered around the map.

In the most general form, what you're asking for is a huge amount of data (a usage number for every rail entity). You can improve that by only tracking Track Segments. So be aware there will be performance effects in large bases.

Re: Mod to Visualize Train Network Efficiency & Congestion

Posted: Sat Aug 09, 2025 5:49 pm
by Osmo
This is an interesting idea
I think it can be made performant if stuff only gets checked in the on_train_changed_state event. For example, amount of time spent waiting at a signal or station could probably be gathered from that, and then displayed to the user when needed.
And while that doesn't give congestion information for every point along the track, it would probably provide it where its needed the most, at little cost.

Re: Mod to Visualize Train Network Efficiency & Congestion

Posted: Sat Aug 09, 2025 6:24 pm
by Tertius
lilycollins9x wrote: Mon Jul 28, 2025 4:20 am
  • Queue lengths at stations
  • Average waiting time per stop
  • Tracks with heavy vs. light usage
  • "Dead zones" where no trains ever go
I didn't feel the need of a mod for this so far. Previously, I did this:

queue length: place a programmable speaker next to a station or number of stations and raise an alarm, if the queue length is too short or too big.

average waiting time per stop/heavy track usage: No automating but manual inspection of the map in map view mode, so waiting trains and congested lines are visible. One waiting train isn't an issue, but another waiting train behind a waiting train is a sign of overload and danger of congestion. When I see this, I inspect from where the trains came and where they want to go and check if there is a way to make them not cross that track in the first place. tl;dr I try to change the track layout.

dead zones: don't care about that. Might be used later with expansion of the base, or with changing the track layout to avoid congestion. Never visited loading stations (for example ore mines) are a sign of me building too many of them, but no problem. Never visited unloading stations are a sign of me building not enough trains or not enough loading stations, so I add more of them. My train concept includes having a surplus of trains at all times, so any unloading station without at least 1 train in the queue is an error, so I would add an alert through a programmable speaker if this was a common issue.