Closed Gregory365 closed 1 year ago
Added 3 commits in response to #99.
currentlyWaiting
object to it.timetable.waitingRequired()
method more robust to a timetable object in a bad state.coroutine.resume()
and subsequent error messages in the games log.
Features
Example
Timetable is (in format [arrive, depart]): [01:00, 04:00], [03:00, 06:00], [05:00, 08:00], [07:00, 10:00]
A vehicle arrives at 02:45 and picks the [03:00, 06:00] slot as its the closest and will depart at 6:00.
Another vehicle arrives at 03:30 and picks the [05:00, 08:00] slot as it is the next consecutive available slot after the nearest slot of [03:00, 06:00]. This train will depart at 8:00.
Issues
Causing the game to crash for some
Vehicles will forget their time slot upon a Save and Load cycle as currently waiting vehicles aren't stored. Therefore, lines with large gaps between arrival and departure times and high frequency may have vehicles with longer than ideal wait times after initially loading into a world.Not an issue. Currently waiting vehicles are stored (only on the develop branch)Vehicles depart too late as they pick a timetable slot that is later than expected.Resolved. Issues was caused by arrival time only being calculated once passenger loading/unloading was complete. Arrival time now calculated instantlyVehicles fail to be held for departure and departs without ever being stopped.Resolved. Issue was caused by a vehicle calculating its departure time before arriving at the next station. Departure time now calculated at the same time as arrival time.Technical Info
currentlyWaiting
objectcurrentlyWaiting
now contains two objects:vehiclesWaiting
andvehiclesDeparting
vehiclesDeparting
time increased from 40 seconds to 60 secondsbeforeDeparture
getNextConstraint
test to check vehicles can't be given the same time slot