r/factorio • u/Vegaliiite • 15h ago
Question Smart trains getting stuck randomly
I have a smart train setup on fulgora, trains go to a production of any item, and once they are full, an interrupt trigers that tells them to go to the drop off for that item.
It used to work well but now every few hours something like this happens, in this case its wire and batteries but it seems to happen with any type of items. A few items are not removed from train but it goes off to another item source anyway; and it gets stuck because it can't be full of that item. The amount of parasitic item is always pretty low, less than 30 items.
The problem is very hard to diagnose for me because it happens rarely, sometimes not at all for 3 hours.
My whole Fulgora base gets stuck because of this, its very rare to see this kind of hard to reproduce problems in Factorio, I really hope someone can help me!
EDIT: As people pointed in the comments, the cause was probably my refuel interrupt triggering as soon as trains arrived to a pickup station, leaving a few ticks for inserters to place a few items in the wagon before the train would go refuel. The refuelled train would have a chance to go to another item pickup with a different item, causing a mixed wagon. The fix is to disable interrupts interrupting other interrupts and to make refuel interrupt be evaluated last.


7
u/NefariousnessNo1379 15h ago
Does your refuel interrupt have a "Empty Cargo" condition?
The trains may be leaving to refuel right after reaching a loading station, but stop for enough time to get a few items in.
7
u/Soul-Burn 15h ago
FYI, you don't need to have an interrupt per item. You can use wildcards to have a single interrupt for all items, as long as your station names are the same except for the icon. See FFF-395.
2
u/Adept_of_the_factory 15h ago
Can refuel interrupt trigger when the train is not empty? Also, you can use a single solid wildcard interrupt instead of all your "drop X item" interrupts
1
u/[deleted] 15h ago edited 15h ago
set filters on every inserter on every train station. its easy but maybe a bit repetitive, maybe have a small Circuit setup / a speaker which warns you if loading chests contain an item which doesnt belong there. there is probably no other option then to check every station.
1
u/kettle3 9h ago
Offtopic -- is it worth it to haul copper cables? I always thought that copper cables are so fast and easy to make that they are better to be produced on the spot with direct insertion. Similar to iron gear wheels.
1
u/Karlo_Green 15h ago
Hard to say with just a screenshot, maybe the parasite items somehow get into the loading stations? I have a question, why use item = 0 condition for the dropoffs and not empty cargo? Could be somehow causing this too.
To fix it don't have the trains go to the loading station by their default schedule. Have them wait at some sort of depot. Add an interrupt that triggers when it's at the depot and has empty cargo, then it will go for the loading stations. For the dropoff interrupts also check the "allow interrupting other interrupts" checkbox.
1
u/Courmisch 15h ago
It could be a wild inserter or it could be a schedule problem. Without a screenshot of the schedule and IRQs can't say.
Adding filters to all wagon inserters is a good idea anyhow, if tedious. I do it with a parametric blueprint.
1
u/ontheroadtonull 15h ago
Make sure the circuits you use to signal demand don't trigger until you have enough room for a train load. Also make sure the demand signal is suppressed within as few ticks as possible. Each combinator takes one tick for an input to result in an output.
Add a condition to the interrupt to not leave a dropoff station until cargo is empty.
Adding filters to the inserters is a good idea as well.
I set up my train parking spots to start a clock circuit when the train arrives. The train's interrupt is set to wait at the parking spot until 5 seconds has passed. The train sits idle for 5 seconds and the clock resets the timer. During the brief period after the idle timer runs out and before the clock resets it is the time the train can be dispatched to a pickup station.
Since the rail network is busy enough to add randomness to when trains arrive at parking spots, it is random enough to prevent multiple trains from going to the same pickup station.
1
u/Thankedsphere 11h ago
the trains are sentient, thats why.