Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue May 22, 2018 2:19 am

All times are UTC

Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun May 20, 2018 10:15 am 
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Thu Mar 30, 2006 6:24 pm
Posts: 603
Location: Durham, UK
It's been a while since I last wrote any code for OpenTTD, but I couldn't stay away for ever. I've started playing again recently and remembered why I love this game but as always, there are things I want to fix. :)

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. :)

File comment: Timetables with times. These three trains are all running on separate timetables but each is part of an hourly service so this same scene will be repeated in 1 hour/60 days time and they never get in each others' way at the junction.
Nutborough Transport, 22nd Oct 1943.png [532.85 KiB]
Not downloaded yet

File comment: Patch file, applies on top of 42b43c998.
timetable-time.diff [106.83 KiB]
Downloaded 3 times

No-one's more important than the earthworm.

PostPosted: Sun May 20, 2018 8:22 pm 
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Jan 08, 2003 11:09 pm
Posts: 338
Location: Denmark
This is a simple and neat idea, it does make timetables more natural to think about.

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:
timetabling-mockup.png [ 4.53 KiB | Viewed 58 times ]

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.