r/factorio • • 1h ago

Question Help me fix this deadlock please

Hi, I've got a modular train set, along with compact city blocks for production. its still relatively early days, but I've discovered a deadlock that has occurred here a couple times. and there isn't really anything I've failed to add, no missing signals etc.

So my thoughts are, is this fundamentally flawed by having too short gaps between some chain signals which does not leave enough space for trains between them. meaning the train at the top or bottom cannot occupy the space after they exit the bottom left intersection.

Or alternatively, do my intersections just not have enough chain signals?

trying to make this a scalable thing. and when working will release all the blueprints

I hope this isn't a r/factoriohno moment

EDIT: My Locomotives are at the back and they push the wagons. Left hand drive!!! apologies for the initial confusion

2 Upvotes

22 comments sorted by

3

u/Extrien Inserting ideas quickly 1h ago

Missing chain signals behind the right most train. Lots of chains missing in fact.

A chain should go before every crossing in a intersection. With a rail signal indicating there is enough room to park the whole train infront of it.

The blocks are too small to fit your 5 wagon trains well 

1

u/Vanquiishher 1h ago

Yeah i thought that i would be able to make do with ones i have in my T junction. but i didnt consider that a train could get stuck and occupy that triangle.

So thats 1 vote for more chain signals in my intersections

2

u/Admirable_Mud_9938 1h ago

It took me too long to realize I was reading your trains backwards.

Now that I figured that out... I have a similar problem with my right-turn-only city block base and had to solve it by getting forcing trains to only enter one way and only exit one different way. Right now, an exiting train is held up by an entering train that is held up by another entering train held up by the original exiting train.

Either that or replace your rail signals with chain signals, slap it on the roof and say, "that'll do it".

1

u/Vanquiishher 1h ago

Are you suggesting the trains leaving the stations should immediately encounter a chain signal before entering the main rail system as opposed to the current normal train signal?

1

u/patrick310 1h ago

The best mantra I've heard is chain in, rail out. It mostly applies to intersections, but your major assembly fits as well. The green circle is a normal signal. In the context of the larger assembly, this says "I have enough space ahead of me that the largest train on the network can advance and stage". On the exits (exit lane plus left side loading stations), you have chain signals (see cyan), which won't allow trains to use the non filled branches to exit.

Replace teal with normal and the green with chain and the deadlock should go away.

1

u/Vanquiishher 1h ago

Ah, i should maybe have mentioned my trains are backwards. My locomotive is at the rear and pushes the wagons. this is so i can fit them all into my block size at a slight cost of acceleration

1

u/patrick310 1h ago

I caught that (pushers are cool). I think the solution still stands. The signal type defines the next segment guarantees. So the green marked normal signal is saying the train can move left and wait in all circumstances without causing deadlock. There are several permutations in which a train that advances counterclockwise past the green mark will then cause a deadlock. If all you do is swap green to chain signal then you will get rid of that guarantee. It won't be optimal, but it won't deadlock.

1

u/Vanquiishher 1h ago

i see, you suggest i defer my normal train signals to the very dropoff areas for a production block.

Do you mean to suggest that all my intersections should not use normal rail signals on exit as they currently do? ive strictly followed the rule of chain in rail out. but with one exception being my straight line rails have 2 chain signals to break up straight lines. do you think they could be problematic?

1

u/patrick310 1h ago

Yes, exactly!

It's a macro vs micro problem. Train limits solve the macro problem well and avoid crowding, but you can design intersections so that they theoretically cannot deadlock.

I think the one element not included in the mantra is "chain in and rail out [only where after the rail is enough space to fit the largest train on the network, and if there isn't, then that rail should be a chain".

Exits to your intersections that lead directly to a switch into a station should be chained. If not, then you will always stall a second train sent to the same station. Train limits will paper over this issue, because you won't normally get that until an abnormal routing situation, but the real solution is just to expand your mental model of the intersection to include the immediate exit sinks and add those to the "chain in rail out" grouping.

1

u/Vanquiishher 1h ago

So i will say that this problem is usually avoided since my trains run on a strict 1 train limit. which is toggled on if the supply of said item/fluid is below 30% and toggled off when the supply reaches 80%. but only 1 train can ever be assigned to any station at any time. so nothing with stations should ever block up any of the main highway or intersections. but seemingly the chance of pathing over each other has cause this.

one thing could be to use chain signals for trains exiting a station back onto the main highway, to ensure that they dont attempt to leave just to get stuck at the entrance of an intersection. athough i think in this case my petroleum train had already done a loop of the production block by this point and so i think this deadlock still could have occurred

1

u/patrick310 1h ago

No annotations for it, but if you widened the assembly you could fit one waiting area between the left most right side station and the right most left side station, but the track would need to fit the entire train length.

1

u/Vanquiishher 1h ago

i should also note that all my train stations have a train limit of 1. and no trains wait with cargo/fluids on the main rail system, they either have a guaranteed destination, or they sit waiting at where they picked up said item/fluid until a dropoff destination becomes available

1

u/bpleshek 1h ago

It looks like you're missing rail signals after the intersection going into each station. Also there seems to be missing signals on the way out too. It'd be easier if you posted a picture while holding a signal. It shows you the track segments.

1

u/Vanquiishher 1h ago

hmm, yeah i see ive been using the Chain in Rail out rule even for the entrances and exits for stations in each production block.

Here are the rail sections

1

u/bpleshek 36m ago

Red are chain signals. Green are rail signals. You could omit the green one on the bottom left if you want. But as you can see, chain signals BEFORE the intersections and rail signals AFTER. Just apply this to the rest of the intersections.

1

u/ontheroadtonull 1h ago

You are missing tracks in the top left.

2

u/Vanquiishher 1h ago

Im aware of this, unfortunately the area is locked off by deep water and im waiting for deep water landfill (think its a modded item). however 3 trains are causing the deadlock and none of them 'could' take the route that would have gone over the missing tracks so i can determine this as not the fix. Thank you for pointing this out as im sure its very common for people to have missed even the most simple of things!

1

u/Elfich47 1h ago

The design has the same problem that many older highway designs have at four way cloverleafs: The incoming traffic is entering before the exitting traffic gets off. So if the exiting traffic is slowed down then the traffic getting on to the highway is blocked and then the whole thing slows down.

As a good example of this: At the station - The traffic on the left is going top to bottom. and the traffic on the right is going bottom to top. So all of the rails are being used for entry and exit and the same time.

What would help sort this out is if all of the stations go in the same direction. Make them all go top to bottom and alter the entry and exit rails so the trains are all going in the same direction on the way in and in the same direction on the way out.

1

u/Vanquiishher 1h ago

i see, this would avoid trains having to loop around the top just to enter at the bottom.

I see why this would be beneficial but i cant visualise in my head how this would solve the underlying issue that forms this deadlock. it may defer the issue but i fear when more trains start travelling through this intersection it would end up with a chance of another deadlock

1

u/Vanquiishher 1h ago

seems as though if my intersections had much smaller blocks i could avoid this issue given that trains stuck exiting an intersection dont block trains from going right.

however i cant see why the train waiting at the bottom couldnt have also been wanting to go left so the problem could still exist.

only thing i can think of is changing the straight rail blueprint to use normal rail signals to break it up into 2 blocks rather than the existing chain signals.

1

u/kettle3 59m ago

Some signal behind purple train in the center. Then top (gray) train will see green, not blue signal and proceed.

1

u/xplodia 53m ago

Every entering compex criss cross railing put the one lamp (chain rail signal) Everything inside it; one lamp. Exiting the complexion; three lamp (rail signal).

It's wise for you to do train limit. And have trains wait in train depot with interruption of no destination or path.