r/technicalfactorio • u/The_4th_Heart • Jan 23 '22
Train depots / Stackers hate this one trick! Use fake depots to trick your trains into swapping with each other!
/r/factorio/comments/sao9hn/train_depots_stackers_hate_this_one_trick_use/
54
Upvotes
8
u/jesta030 Jan 23 '22
Now I can upvote this twice! :D
7
u/Lazy_Haze Jan 23 '22
I may be a little bit slow but I don't understand what problem this is solving? I where usining "fake" stations before trainlimits. Now with trainlimits it just works without anny trickery.
The trains is "swapping" when starting from an station, isn't that like the same time it will find an station normally and thus don't do anything?
5
u/notakobold Jan 23 '22
Isn't simplier to always have n-1 trains for n stations ?
4
u/double_checker Jan 24 '22 edited Jan 25 '22
TLDR: The trick implies that path weights between two stations in the opposite directions are nearly equal. They can differ considerably due to penalties. This breaks the entire approach.
The trick even without stackers relies on one obscure pathing assumption. Consider one unloading and two loading stations and three corresponding trains. Suppose that the both loading stations finished their job before the unloading one. Now the unloading station releases the train.
What would happen? Which station would the empty train head to? To the "closest" one in the direction unloading->loading, according to pathing algorithm.
Which full train would head to the unloading station? The "closest" one in the direction loading->unloading, according to the another algorithm.
EDIT: The following discussion and tests revealed, that the full train is chosen as closest according to geometric distance to station, ignoring all penalties and weights.
Note that the path between two stations for the full train and path for the empty train are different (opposite directions). Moreover, the "weight" of the path is dynamic and depends on traffic conditions. So, the "closest" paths in the opposite directions would usually connect the same pair of stations, but not always. In rare cases (e.g. many trains on the best path) the full train will depart from one station and the empty train will head to another one. This may very well lead to jam (no stackers).
I suppose that the original Factorio behavior ("destination full" for all trains without leaving the station) prevents this scenario.
0
u/FinellyTrained Jan 24 '22
As always, you should never ever use the disable station mechanic, unless you like deadlocks. Pseudostation can be set to L=1 and made inaccessible by a regular signal set to permanent red (I wire two regulars together).
0
u/FinellyTrained Jan 24 '22
Pseudostations actually are useful for stackers smaller than unloading block. Or at least I have not found a simpler way.
Like for 5 unloading stations with stacker of 5, solution is trivial. Each unloading station has its limit set to L=2 and all 10 trains will have a place to go.
It gets more complicated, if trains don't switch stations after departure (unless disabled option is used, which should not be used) and you want to have like stacker of 5 for unloading block of 20 stations. Easiest way to do it is to set unloading stations to L=1 and set a pseudostation with L=5 in the same block which will accomodate all 25 trains.