SuicideJunkie wrote: Mon Jan 03, 2022 5:47 am
Can anyone shed some light on the train-brain logic of why it is doing what it is doing so I can design a workaround?
I'm not sure it's the only reason/best way to explain, but there's this thing i remember from the discussion that happened before train limits were added to the game :
If a train stop is deactivated by circuit network, the train "skip" the stop. This is assumed to be intentionnal otherwise it means you mess up the wiring.
If a train stop is set with a limit of 0 instead, the train will not "skip" the stop it will say in place with "destination full" message. This is assumed to be intentionnal too.
Now when a rail is destroyed and a train stop that was the target of a moving train becomes inaccessible it doesn't "skip" the stop and instead freezes with the "no-path" message. (supposedly here it is no longer intentionnal).
It ressemble the behavior of a train not moving when the limit of the next stop prevents it. This was made (somewhat) to have a state where all your trains are static because all the limits are set to 0. It's quite a sidestep to explain but if it wasn't the case there would be more problematic situations occuring in regular routine.
Say you have a train that picks up iron ore, then unload it, then picks up copper ore, then unload it. If you were to disable one of the unload, the train would "skip" it and then a train full or iron ore would arrive in a copper loading station, or even worse, you could have a train full iron ore unloaded in the copper unload station, if 2 station were "skipped".
The behavior of "no skip" for limit interaction was designed this way from what i remember because it was intended for a situation where you could frequently change the limit to prevent train from moving all at once at the same area. Making train freeze on spot was thought "dangerous" so instead when you set the limit to 0 while trains are already routing to that stop, those trains continue their travel to the stop that just got "soft-disabled". OR don't even start to move and instead display the message "destination full" (that was introduced).
The "no-skip" behavior here is on purpose, for the reason of avoiding risk of mixing material. In a situation where you intentionnaly select the train stop concerned.
When you do not intentionnaly select the train stop concerned then the game freeze the train on spot.
=> If you disabled a train stop with circuit, train skips them, since it's considered intentionnal. (no freeze)
=> if you set limit to 0, train finish their path, it's intentionnal (no freeze)
=> If instead the train stop is made not accessible because biters eat a rail, train do not skip it, it freeze on spot which prevent material contamination. Not intentionnal (freeze).
Supposedly only looking at trains, it doesn't matter because when the rail is replaced by robots, the train that was stuck like in your example should resume its previous travel. ( in practice it's different since it can create a traffic jam or you may not have robots coverage ).
Risks are if you have another station named the same, the train could go there instead of its original destination made unavailable due to rail removal. This is only a problem in (rare) certain conditions, if your station are named the same AND do not handle the same material for example.
There are no way around the fact that a train WILL get stuck if the destination is unavailable in some train network. Like when it's not grid like and there is only 1 way to reach an outpost and leave this outpost that has a unique name.
To have a fool-proof solution to your problem seem impossible with single-way-tracks since biters could always eat the rail just in front of a train. ( amongst any rail that is part of the unique path that reach to a train stop). Even though it seem like the train could have a smarter behavior when it happens sometimes ( for other rails located further in the path). Those would break in that extreme case.