The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: Vladki on March 12, 2017, 10:49:26 PM

Title: Train waiting for train staff is "moving" on the spot
Post by: Vladki on March 12, 2017, 10:49:26 PM
Watch a train waiting at one train staff box. It is emitting smoke and the speed in info box varies between 0-2 km/h.
Trains waiting for clearance at other signals have no smoke and speed constantly at zero. I have not checked if it also costs money as if running or not.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 01, 2017, 10:01:29 PM
Can I ask whether this can still be reproduced, and, if it can, whether you can upload a saved game in which this can be seen? Thank you for the report.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 08, 2017, 11:11:56 AM
This can be reproduced, save game here: http://server.exp.simutrans.com/debug-saves/one-train-staff.sve

Look for the train (55) - cattle train heading to bohdanovce farm
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 20, 2017, 11:22:49 PM
I think that I have been able to fix this. Would you be able to re-test? I should be most grateful.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 23, 2017, 11:24:53 AM
The moving on spot is gone, but another error appeared: The first  train after passing the staff-box is still in track circuit mode, and second train is allowed to enter the area causing a deadlock. (while the seciond train preperly switches to on-staff mode)
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 23, 2017, 01:51:23 PM
I think that I may have fixed this; would you be able to re-test? I should be most grateful.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 23, 2017, 02:45:58 PM
Oh no!
The T-signal segfault is back  :-[
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 23, 2017, 03:55:48 PM
Can you give more detailed instructions on how to reproduce this? It is very unlikely to be exactly the same error though the symptoms may be similar.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 23, 2017, 04:39:00 PM
Just load the on-train...save from above link. Quickly move to Osterskar station, and watch the DMU approaching, loading, reversing, and segfault
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 23, 2017, 07:24:37 PM
I think that I have fixed this - would you be able to re-test?
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 23, 2017, 08:57:15 PM
T-signal bug is fixed, but the one-train staff is still broken. First train passes in track-circuit mode, and second train crashes the game:

FATAL ERROR: vector_tpl<T>::[] - 7koord3d: index out of bounds: 65528 not in 0..120
Aborting program execution ...

For help with this error or to file a bug report please see the Simutrans forum at
http://forum.simutrans.com
Neúspěšně ukončen (SIGABRT)
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 23, 2017, 09:18:59 PM
I am afraid that I am not able to reproduce this. Can you give me exact steps to reproduce from the uploaded saved game? I should be most grateful.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 23, 2017, 09:39:15 PM
I have updated the save game. Watch the train with livestock - when it will approach the on-staff-box, the game will crash.

Then load the game again, and release the milk train quickly after loading the game. It should leave the one-staff area before the livestock train arrives. Then the livestock train will pass one-staff-box still in track circuit mode.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 23, 2017, 09:46:27 PM
I think that I have managed to fix this; would you be able to re-test?
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 23, 2017, 10:27:37 PM
OMG, you are fixing it faster then I can break it ;-)

It does not crash any more, but the train still stays in track-circuit after passing along the one-staff-box
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 23, 2017, 11:29:52 PM
This is a very odd one: the problem appears to occur only when the train already in the station had already failed to reserve the whole line. If you stop the approaching train by opening its schedule window, set the other train going manually by moving it to its next item in its schedule, and, once that train has cleared the section, close the schedule window of the other train. The problem then does not appear to recur.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 24, 2017, 12:09:47 AM
I tried what you suggested, but still have a train in one-staff area running in trac-circuit mode. Can you share a savegame where it is OK?
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 24, 2017, 11:29:20 PM
I have had another look at this and I think that I have managed to fix the underlying issue. Would you be able to have another look at this? I should be most grateful.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 27, 2017, 10:15:22 PM
Well now it seems to work better - no deadlock. But is is still quite weird. I'll describe what happens:

Train in track circuit block mode is approaching the staff box at full speed. When the box is few tiles ahead (visibility range), the one-staff area is reserved, and train continues at full speed (mode unchanged). Train changes to one-staff mode only at the moment of passing the staff-box. I think the train should stop at the box in any case, and the area should be reserved only after the train has stopped.

Getting out of on-staff area is also a bit unusual. Train does not stop at the exit box, reserves the path to next signal and stays in on-staff mode. It changes to other mode upon approach to another signal. I think the train should stop on exit as well, as the staff has to be returned to the box, and then it should continue in drive-by sight mode.

Oh, and if the on-staff area is occupied, second train properly stops and waits at the staff box. But is waits for clearance no only until the first train goes past the exit box, but until it passes another signal ahead of the one-staff box. In this case, it reserves the path no only to exit staff-box, but all way ahead to the next signal.

You can test it on the same save game as before.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on April 27, 2017, 10:30:19 PM
I am not able to reproduce the second issue that you describe using the version of this saved game that I produced for testing (with the train in the siding/stop turned around and ready to depart, or else one had to wait a very long time for this to happen); can you upload a saved game in which this reliably occurs?
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on April 27, 2017, 10:50:55 PM
Updated the save game referenced above. You can fast forward a little to cca 3:13
http://server.exp.simutrans.com/debug-saves/one-train-staff.sve
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on May 07, 2017, 03:11:15 PM
I think that I have managed to fix the latter problem. would you be able to re-test?
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on May 09, 2017, 09:01:04 PM
The last issue seems to be fixed, but the two others - entering and leaving the one-staff area at full speed are still present
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on June 11, 2017, 11:12:32 AM
I don't know what has changed, but with the latest version, the trains entering the one-staff area slow down to approx half of their top speed (56->28, 90->40). Leaving the area is at full speed.
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: jamespetts on June 20, 2017, 11:06:14 PM
I have just made some changes relating to one train staff signalling to fix a bug reported in another thread. My testing there showed that this was no longer a problem, although I did not test all possible circumstances. Can either of you confirm whether this is still an issue?
Title: Re: Train waiting for train staff is "moving" on the spot
Post by: Vladki on June 23, 2017, 06:33:08 PM
Part of the problem still persists:

Quote from: Vladki on April 27, 2017, 10:15:22 PM
Getting out of on-staff area is also a bit unusual. Train does not stop at the exit box, reserves the path to next signal and stays in on-staff mode. It changes to other mode upon approach to another signal. I think the train should stop on exit as well, as the staff has to be returned to the box, and then it should continue in drive-by sight mode.

At least in my game it does not cause any deadlocks, just it is not the expected behavior.