Page 1 of 1

Automatically split rail blocks when rails are too close together to insert signals

Posted: Sun Jan 22, 2023 6:45 am
by sparr
In a reddit thread about using a simple circuit to create priority merges, the topic shifted to dense rail layouts, particularly where crossing rails are too close together to insert a signal. Someone pointed out that the game Sweet Transit has a novel solution to this. Their rail network implementation uses rail and chain signals similar to Factorio. What they did to resolve the dense rail problem is to automatically inject invisible fake chain signals anywhere there's a crossing too short for a real signal. This allows for much denser rail layouts without giving up separation of rail blocks, and doesn't seem to have significant gameplay drawbacks.

https://steamcommunity.com/games/161277 ... 5098171865 "Signal Blocks" section

Re: Automatically split rail blocks when rails are too close together to insert signals

Posted: Sun Jan 22, 2023 7:58 am
by Koub
Pretty smart solution :)

Re: Automatically split rail blocks when rails are too close together to insert signals

Posted: Sun Jan 22, 2023 3:46 pm
by Amarula
Very cool! Thanks for sharing!

Re: Automatically split rail blocks when rails are too close together to insert signals

Posted: Sun Jan 22, 2023 4:43 pm
by FuryoftheStars
I'm not necessarily against this suggestion, but currently I consider this a trade-off. Want verbously signaled rails? Need to leave some space. Want compact rails? Going to have to sacrifice some signaling.

Re: Automatically split rail blocks when rails are too close together to insert signals

Posted: Sun Jan 22, 2023 5:19 pm
by robot256
This is basically how OpenTTD "path signals" work too. You place a path signal, and every tile up to the next normal signal is basically considered its own block. Factorio train signaling was inspired by OpenTTD, but that feature has not been replicated yet. Using a path signal entity to trigger the desired behavior would be more intuitive than having it happen spontaneously in certain situations.

Re: Automatically split rail blocks when rails are too close together to insert signals

Posted: Sun Jan 22, 2023 7:20 pm
by DarkShadow44
Not 100% sure I understand, what would it for example do with the following intersection?
Screenshot_20230122_201605.jpg
Screenshot_20230122_201605.jpg (579.85 KiB) Viewed 2071 times

Re: Automatically split rail blocks when rails are too close together to insert signals

Posted: Sun Jan 22, 2023 11:05 pm
by robot256
In my idea, the game would recognize when a block could only be entered by path signals, and color it red-yellow hatched for example. Then it would behave as though every joint between rail entities (curved or straight) had bidirectional chain signals at it. This would be bad for performance, and might cause graphical glitches with trains passing too close together, but it's the least invasive, most intuitive approach in my opinion.

Because it adds so many blocks to the network, you'd want to minimize the number and size of pathed junctions in use. It could be optimized by looking for intersections like Rail Signal Planner and combining some segments, but in cases where this would be useful the boundaries between intersections become hard to find.

Re: Automatically split rail blocks when rails are too close together to insert signals

Posted: Wed Jan 25, 2023 9:28 pm
by Eketek
Another option might be use a more permissive system for rail signal placement - switch from a colliding entity occupying a 1x1 tile adjacent to a track to a non-colliding entity anchored to the track, and allow them to be freely attached to any rail segment that does not join or intersect another rail segment (said rail segment doesn't need to be the whole 2x2 block - just a few pixels of space between intersections should suffice).

Re: Automatically split rail blocks when rails are too close together to insert signals

Posted: Thu Jan 26, 2023 3:19 am
by robot256
Eketek wrote: Wed Jan 25, 2023 9:28 pm Another option might be use a more permissive system for rail signal placement - switch from a colliding entity occupying a 1x1 tile adjacent to a track to a non-colliding entity anchored to the track, and allow them to be freely attached to any rail segment that does not join or intersect another rail segment (said rail segment doesn't need to be the whole 2x2 block - just a few pixels of space between intersections should suffice).
This gets really tricky in intersections like the one pictured because what you really need is multiple signals in one spot, so that the curved track and the straight track can be reserved separately even though they start on the same exact tile. You'd have to be able to place a signal in the middle of a curved track but have it actually exist at one end of it or the other.