Gregory365 / TPF2-Timetables

The Timetable mod for Transport Fever 2
GNU General Public License v3.0
13 stars 5 forks source link

vehiclesWaiting does not notice manually removed vehicles #60

Closed wernk1 closed 11 months ago

wernk1 commented 11 months ago

What would you do if a vehicle misses its departure? The only way is to remove it manually! Either by sending it to a depot, selling it or send it on route again. But the vehiclesWaiting entry in the sav.lua is not updated! This is the cause for infinite waiting issues I had again and again. And the worst: If a vehicle won't leave the stop you'll try to force this by again treating it manually. And soon you'll have a lot of dead entries in your sav.lua!

Whats the solution? The best is to check if there's really a vehicle waiting at the stop when another vehicle is entering. This information must be available because it's also displayed in the GUI window of the Timetables mod. So there should be no problems to query it.

Gregory365 commented 11 months ago

Resetting a timetable

In the timetable window, disable the line and then re-enable it (checkbox in the left menu). That will reset the vehiclesWaiting.

I am aware there can be dead entries in the vehiclesWaiting/sav.lua by sending trains to depots whilst they are in a station. Unfortunately, this is inherited behaviour from the original timetables mod. I have attempted to clean some of this up by removing old entries from vehiclesWaiting when a new vehicle is added to the same vehiclesWaiting, but admit its not ideal.

Sending vehicles to a depot after they have stopped, and then re-sending the same vehicle to the same line, during the same cycle is a recipe for disaster. (Cycle = the time it takes for a vehicle to complete the line from start to finish). The timetables mod never handled manual adjustments on-the-go particularly well, and it's almost impossible to handle all of these edge cases. This mod is instead designed to balance out over time, so a line should work after one or two cycles of that line.

Vehicle misses its departure (too late)

If a vehicle misses its departure, it's likely the timetable isn't configured correctly. In particular the arrival times are probably too early. Moving the arrival time closer to the departure time should help to vehicles choose the correct timetable slot.

Vehicles will pick the timetable slot with the closest arrival time to the time that they arrived.

Gregory365 commented 11 months ago

I think the issue was with sending a vehicle to the depot and back to the same line causes it's timetable slot to be re-allocated. I don't think this a reasonable edge case for this mod to handle correctly so I'm going to mark this issue as won't fix.