News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Train waiting for full load won't depart when full load available at station

Started by Jando, May 06, 2017, 05:00:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jando

Here is a saved game where I can observe a train pulling into a station, correctly waiting for full load, but not loading any new cargo that becomes available after train entered the station: http://files.simutrans.com/index.php/s/8i15sTLdhDUGb0H

What can be observed:

  • Train #1 is about to pull into the station when the game is loaded, train configured as waiting for full load with 6h24m as maximum time. Train has a capacity of 192t coal with only 174t available for that line to the power station north. Train correctly goes into wait for full load.
  • There will be continuous demand from the power station, thus after 2-3 minutes the station has enough cargo for the train to load and depart, however the train will not load the cargo and will not depart. 
When does the train finally depart?

Train will load the cargo when one of the following actions happen (whatever comes first):

1. Player opens and closes the schedule window of that train (no change to any settings needed).
2. Another train pulls into another platform of that station, no matter whether other train is serving the same line or not.
3. Player saves the game and reloads the saved game.
4. About 3 game-hours pass.

And awfully sorry for all these reports, James. And thank you so much for your work on this! Just tell me when I should stop to file more reports, hehe.

jamespetts

Thank you for the report. I think that I have been able to fix this. Would you be able to re-test? I should be most grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Good news first: trains waiting for full load now load cargo that becomes available while the train is waiting.

Bad news too: this does not necessarily mean that the train will depart with this full load. Have seen trains sitting at station with full load not departing. Trying to catch a situation where I can reproduce this for a save game.

jamespetts

Yes, please do: I will need that in order to fix this. Thank you.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Here is a saved game where I can reproduce this bug: http://files.simutrans.com/index.php/s/a5mwqLMrmYynLyL

I think it's related to the use of a maximum wait time while waiting for full load because in this saved game the bug only happens when maximum wait time is used. To see this I suggest:

1. Load the saved game.
2. Hit pause. You see train #5 pulling into station Staffpike Colliery West. Train is configured as waiting for full load with a maximum wait time of 6h24m. Train will need to wait at the station because there's not enough cargo available.
3. Unpause. Train will pull into station and wait. Within a few minutes new cargo will become available and the train will correctly load the new cargo. However train will not depart after it has reached full cargo (192 tons).
4. Load the saved game again.
5. Hit pause.
6. Manually edit the schedule of train #5 and remove the maximum wait time.
7. Unpause. Train will pull into station, wait and load cargo and depart when full load has been reached.

Thanks again, James!

jamespetts

Thank you for the report. I think that I have managed to fix this. Would you be able to re-test? I should be most grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Have seen another case of the not-departing at 100% load with the new nightly but not yet been able to reproduce it, will try again.

Jando

Odd, here is a saved game where I can observe the not-loading when cargo becomes available bug again: http://files.simutrans.com/index.php/s/ElO7lCjhqLTId6n

You see train #8 waiting for full load at Staffpike Colliery South, cargo is available at the station that the train has not loaded. Fast forward, more cargo will become available that the train will not load. Train will load cargo (and depart if full load) when you either open and close the train's schedule window or when the waiting count-down timer has reached 3h12m00s. I reckon that's not by chance. But other trains on that same map seem to be doing fine.

jamespetts

Thank you for the report. The immediate cause of the problem seems to be that the variable telling the train how long to wait before checking whether it needs to do anything again is set to the time when the wait until max. load expires. This was the immediate cause of the other bugs above, too.

Unfortunately, from the state in which the saved game is available, there is no way of telling how that incorrect number came to be set, and allowing the game to run on so does not show this problem as being reproducible for the next two occasions on which trains of that line stop at that colliery. Are you able to reproduce a situation in which this bug arises in respect of a train which is just about to stop at the station where it occurs?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Quote from: jamespetts on May 13, 2017, 11:14:43 AM
... Are you able to reproduce a situation in which this bug arises in respect of a train which is just about to stop at the station where it occurs?

I'll try over the weekend. :)

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Tough job, have seen one more occurrence of this bug, at another line, had a saved game from 15 minutes before that, reloaded saved game, watched the train/station where it happened, didn't happen again after reloading though. 

I'm almost thinking the bug happens (or rather how the wrong data gets into the variable) through some sort of player interaction, like editing schedule or sending away a train early. I did nothing of that after reloading the saved game. Will keep looking for something that can be reproduced.

jamespetts

Thank you very much for your investigations: this is much appreciated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

I retract the earlier opinion that it may be related to editing the schedule of the train/line.

Observed a train now not loading any new cargo on a line that I did not edit/modify for several play sessions.

jamespetts

Thank you for your testing of this. If you can set out a method reliably to reproduce this, I should be very grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Hello All! :)

Sadly still no reliable way found to reproduce this error, but thought I should mention that this bug is not related to reversing stops. because it can also happen on non-reversing stops.

jamespetts

Thank you for reporting back. It is more or less impossible to fix a bug without being able to reproduce it reliably (at least it is for me: a more experienced coder might have better luck). If you or anyone else is able to find a means of reproducing this reliably, I should be most grateful.

It often happens that bugs like these are eventually fixed by fixing other bugs that are caused by the same coding error.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

I now have a saved game where I can reproduce this bug. I'm not sure it's the only way how the bug can happen, but at least it's a start. Saved game is here: http://files.simutrans.com/index.php/s/fRQE87y4bPGWgTC

It's a map I made a few weeks ago but didn't play yet. I kept the map because it has an interesting distribution of towns and industries, with an easy start for a train line transporting coal. That's where I started now, one train transporting coal from two colleries to a gasworks and a coal merchant.

When you load the saved game you see the train (the only one) approaching Carnburn Colliery. Industries have just demanded coal and the coal is in the process of transferring from the colleries to the station. No cargo will be available at the station when the train stops, thus the train correctly goes into wait for full load. After a few minutes the process of transferring coal to the station will be finished but the train will not load that cargo and instead continue to wait for full load.

The train will pick up the cargo when half of the specified maximum wait for full load time has passed or when the player opens the train's schedule information window.

jamespetts

I think that I have managed to fix this; would you be able to re-check when the next nightly build is available? I should be most grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Thank you very much, James. I will give the new version a good spin tomorrow. :)

Jando

So far no occurrence of this bug seen with the new build. Good job!