Moderator: OpenTTD Developers
Timetables have always been a bit difficult to use, especially when you have more than one timetable interacting. Although the only time unit available by default in OpenTTD is the date, trying to do mental arithmetic with dates to figure out how what the date will be when you add 47 days to another date just isn't easy.
It's not a new idea, but I decided to see if I could display timetables on a 24-hour clock rather than using dates, and this patch is the result. The basic idea is to reinterpret the date as a time by making one minute on the clock equal to one day from the date. The result is that a journey that takes 67 days is now shown as taking 1 hour, 7 minutes, and all the arrival/departure times are shown as times. The current time is also shown next to the date in the status bar at the bottom of the window. Because I didn't want to add anything to the save-game, the first midnight is the 1st Jan, 1 AD and it rolls round every 1440 days (almost 4 years) so the actual time when you start the game will look fairly arbitrary.
I wasn't sure about how this would work when you have timetables of different lengths, but decided that that's not necessarily a limitation of the in-game timetables; real rail companies have the same problem. Like in real life if you want something to happen at the same time each hour you have to add padding at the end of the line so that the journey is a multiple of 60 minutes (or days, without this patch). Then if your timetable takes 4 hours you can run 4 trains on it, evenly spaced, and you'll get an hourly timetable. If you do that to all your routes you end up with a situation where the same thing happens every hour and you can ensure things don't get blocked at junctions or at the entrances/exits to stations.
Of course you don't have to stick to an hourly service, you can have one every 2 hours, 30 minutes, 15 minutes etc. Or if your timetable doesn't interact with any others you can keep it at 1 hour, 42 minutes long if you want to.
It turns out that you don't need to change any of the mechanics of how timetables work to make this possible, you just have to change the way they are displayed. The patch changes the 'show timetables in days/ticks' setting to add a 'show as a 24 hour clock' option but it's just a display change so it doesn't change the save-game at all. If you're playing on multi-player you can all have different settings if you want and what you do won't affect anyone else.
The patch is more of a proof-of-concept than final polished code, but I thought I'd let it out into the world to see what you all think of it.
It also makes me think of other ways the timetabling features could be improved UI-wise, maybe with a more graphical view that (tries to) collect stops at the same station together. That might make it easier to attempt to sync-up multiple vehicles on the same route, e.g. if you have a single-tracked railway. Something like this drawing perhaps:
Separate the timetable from the load.
So that on the same timetable different trains can run.
Example: the round needs 48 h starts at 00
the first train deliver Food and the 2. train, 24 h later, Goods
and by the way, a nice thing will be presets for wait times in stations.
i dont like that the trains only stop a minute
may a passengertrain stop 5 min but a train full with goods or livestock never unload in 5 min they need little bit longer, or?
3>strings.obj : error LNK2001: unresolved external symbol "void __fastcall ConvertDateToTimeInstant(int,struct TimeTableInstant *)" (?ConvertDateToTimeInstant@@YIXHPAUTimeTableInstant@@@Z)
3>strings.obj : error LNK2001: unresolved external symbol "void __fastcall ConvertDaysToTimeDuration(int,struct TimeTableDuration *)" (?ConvertDaysToTimeDuration@@YIXHPAUTimeTableDuration@@@Z)
3>timetable_gui.obj : error LNK2001: unresolved external symbol "int __fastcall ConvertTimeInstantToDate(struct TimeTableInstant const *)" (?ConvertTimeInstantToDate@@YIHPBUTimeTableInstant@@@Z)
3>timetable_gui.obj : error LNK2001: unresolved external symbol "void __fastcall ShowSetTimeWindow(struct Window *,int,int,void (__fastcall*)(struct Window const *,struct TimeTableInstant const *))" (?ShowSetTimeWindow@@YIXPAUWindow@@HHP6IXPBU1@PBUTimeTableInstant@@@Z@Z)
Do you maybe know about this issue or do you know where it possibly went wrong? I can't find it.