Railway Signalling Overseer

by Sopel

This is a mod for factorio that checks the visible railway in realtime and checks whether the signal placement is correct.

Utilities
2 months ago
1.1
2.14K
Owner:
Sopel
Source:
https://github.com/Sopel97/railway_si...
Homepage:
N/A
License:
MIT
Created:
2 years ago
Latest Version:
1.1.28 (2 months ago)
Factorio version:
1.1
Downloaded by:
2.14K users

Railway Signalling Overseer

This is a mod for factorio that checks the visible railway in realtime and checks whether the signal placement is correct. It detects:

  • when a chain signal has no destination
  • when a train would wait on chain signal indefinitely due to the train being on the same block it is waiting for clear up
  • when any block a train on a chain signal could wait for to clear has insufficient length (also fuses with previous block if safe)
  • when a normal signal should likely be a chain signal

NOTE: The mod works only with single directional rails. If there are rails that function in both directions the result is undefined. This behaviour will likely not change in the future.

Currently it will NOT suggest signal placement where there are no signals, so you do need to know where to place signals yourself.

The mod also adds a selection tool (under shortcuts) that allows marking rail signals as "correct". This instructs the script to assume that the rain signal and additional signalling after are correct for the purpose of finding blocks after chain signals. This is useful for example in situations where train limits are governed not by signals but by stations - in such cases there's no need for train-sized blocks but the mod would otherwise warn on them. NOTE: it works by using a different rail signal entity due to factorio limitations. This means that removing the mod will remove the signals marked as "correct" and may compromise the railway's safety. It is recommended to replace these with normal rail signals before sharing railway blueprints.

How it works

First it gets all signals in an area around the player. Then it takes rail segments attacked to those signals and infers the traffic direction for them. From these rail segments a graph is expanded to cover enough railway to produce a result (around 2-3 blocks past the last visible chain signal). After this the traversals and block discovery algorithms are performed to find chain signal and block relations - this is where the problems are identified. The results are rendered on the surface. The graph formation and issue identification steps are done in separate ticks (unless update every tick selected) to reduce the lag spikes for denser areas.

Known issues

Known NOT issues

  • The direction of the text rendered on rails always follows the direction of the traffic on a given segment. If you have trouble reading upside-down text this is a perfect opportunity to learn that skill. This will not change.