Always-green rail signal to terminate Critical Section

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Zsar
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Jan 08, 2024 2:50 pm
Contact:

Always-green rail signal to terminate Critical Section

Post by Zsar »

Abstract:
Add a sign "end of regulated traffic" to the technology Rail signals.

Works: as an always-green signal, performing no checks, taking no signal inputs
Looks: single tile signpost with yellow triangle sign, no connection to the track
Usage: place instead of a normal signal at the beginning of a long shared track that forks into enough exclusive tracks to never block

This suggestion is meant for the early game, where blueprints, robots, auto-construct, auto-deconstruct are all "not a thing". It may still be fun at later stages of the game and retains some modicrum of utility.

Setup:
Definition: A 'Critical Section' is a section guarded from simultaneous access by different trains to prevent collisions.
  • For the purpose of the 'Is' part, a Critical Section is the one that is guarded, synonymous with 'block'.
  • For the purpose of the 'Should' part, a Critical Section is the one that should be guarded (and invite calamity, if it is not).
Consider this simple setup of tracks:
  • multiple segments #n
    • Station: load at resource output
    • short exclusive rail connection
  • long shared rail connection
  • Station: unload at home base
  • loopback: long shared rail connection
  • multiple segments #n
    • loopback: short exclusive rail connection
Trains will only ever travel in one direction. This is the early game, so trains are short and stations are small.
If we provide #n parking spots in the Station 'unload at home base' and all Stations 'load at resource output' are serviced by one train each, then the only necessary critical sections are:
  • the individual platforms of Station 'unload at home base'
  • the junctions where 'short exclusive rail connections' meet 'long shared rail connection'
Nowhere else can collisions happen.

More complex examples can be trivially extended from this basic one. Their characteristic elements are:
  • 'long shared rail connection' with loopback
  • parking spots for all trains off both of these
Trains with different speeds are probably too complicated to work in this setup, as they interact with the speed of (un)loading at stations, as well as the precise length of 'long shared rail connection'.

Is:
Once you place your first rails, 0% of your track are Critical Sections. If two trains contest the same piece of track, they will collide.
Once you place your first signal (or in case of circles your first pair of signals), 100% of your rail track are Critical Sections. No trains will collide, but they may deadlock and they will wait unnecessarily.

If you want your trains to not wait until the 'long shared rail connection' is completely empty even though they cannot ever collide, you have to manually count train lenghts to place signals all along this arbitrarily-long-but-certainly-not-short track.
If you are a beginner and underestimated the number of wagons you will want, you promptly get to manually redo it all.

... I built my first two resource outposts and already this is not fun anymore. Mainly because it is obviously unnecessary, but there is no language to tell that to the game.

Should:
An always-green signal placed everywhere a Critical Section leads into the 'long shared rail connection' would allow us to implement necessary critical sections, while leaving the whole 'long shared rail connection' wait-free without having to manually place completely redundant signals all over it.

This improves user convenience and game performance.
As it can lead to collisions if used wrongly, it also slightly raises the necessary skill level, but being 100% optional (the existing signals remain unchanged) that is actually a good thing, is it not?

Cave-at: Obviously this does not automatically work with trains of different speeds, but at least in the game as-is, the common starter setup of
  • one locomotive
  • two wagons
has constant speed and works well for the main two use cases before automation becomes available and allows convenient replacement with fully-regulated tracks:
  • two wagons ore, one wagon plates
  • one wagon oil, one wagon oil products
Related work:
  • In software engineering, Critical Sections are necessary evils to be minimised in length and count. The notion that everything (should/would) be part of a critical section is in this context completely unheard of.
  • Renai Transportation allows to throw trains through the air without any regard as to whether there might be space at the landing site. Signals will only block up to the launch platform, from there it's the player's responsibility to have planned accordingly.
  • This Reddit post suggests a general need for signals on 'long shared rail connection' for implementing derivation lines. Derivation lines are not (at first) necessary, though, because in Factorio trains cannot break down and do not differ in speed between full and empty.
  • Rejected proposal to allow forcing a signal green via circuit. Would have been a hack in this particular use case, but would have solved the issue with easily-ish available research from having just unlocked signals.


Illiander42
Filter Inserter
Filter Inserter
Posts: 414
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Re: Always-green rail signal to terminate Critical Section

Post by Illiander42 »

There used to be a way to fake this using overlapping rail blocks, but Wube fixed it :(

Post Reply

Return to “Ideas and Suggestions”