Page 1 of 1

[0.15.13] Train acting strange with self-disabling stations

Posted: Wed May 24, 2017 2:24 am
by Xgkkp
Trains can exhibit odd behaviour with self-disabling stations; Demonstration of the 'problem': https://youtu.be/krZ2HghhYWg?t=40s - the first 40 seconds show the setup but this timestamp shows the problem. 1:27 shows the train moving itself into a dead end.

I've set up stations so that stations are disabled when there is a train waiting - directly, so the station reads into T and also enables if [T = 0]. In cases where the train's other destinations are also disabled the train can sit with some odd on/off behavior - constant "chuffing" whilst moving forward a tiny amount. It looks like it disables the flag to start moving, realises that it can't go to the next station, switches destination back to the original (because it has moved slightly off the perfect position) but somehow then re-sets the "train resident" circuit condition. Possibly some feedback between train positioning and circuit tick updates?

Also, this small "movement" appears to have train momentum, so can move the train e.g. into a dead end.

I'm aware the self-disabling station is a little pathological - the aim was to turn off e.g. mines so that trains can choose identically-named stations far away, and the problem is solved using a hysteresis latch combining the train-ID signal with a normal rail signal, but the slight-moving behaviour seems intuitively to be a bug (even if it's too much of an edge case to care...). Keeping the station disabled with a latch until the train has physically left doesn't exhibit any of the moving behaviour.

Re: [0.15.13] Train acting strange with self-disabling stations

Posted: Wed May 24, 2017 7:18 am
by IV 
This issue is being discussed here: viewtopic.php?f=7&t=47911&p=276671#p276671
But not the part about momentum.

Re: [0.15.13] Train acting strange with self-disabling stations

Posted: Wed May 24, 2017 8:52 am
by Xgkkp
Apologies, I'd searched "Train" and "Trains" but hadn't seen it.

Re: [0.15.13] Train acting strange with self-disabling stations

Posted: Wed May 24, 2017 4:39 pm
by Twinsen