Page 1 of 15

[Patch] Departure boards, 24h clock + binary 25 (r27452)

Posted: 06 Sep 2010 15:06
by hthhs
departureboardswallclock24 (r27452)

This patch adds King's Cross-style departure boards to stations, and the ability to show ingame time in hours and minutes (hh:mm format) instead of days, months and years.

Image

WARNING

In its default state, this patch breaks multiplayer compatibility with unpatched OpenTTD. Multiplayer compatibility may be retained by modifying src/timetable.h so that the value of WALLCLOCK_NETWORK_COMPATIBLE is 1 (one). However, if this is done it will no longer be possible to set timetable start dates in the hh:mm format exactly. I have done limited testing of this - use it at your own risk.

Savegames are mostly compatible; however any vehicles that have not yet started their timetable and have not reached their first order may have their schedule messed up. This can be resolved by resetting their late counters.

END WARNING

diff (requires -p1)
departureboardswallclock25-r27452.diff
(132.85 KiB) Downloaded 725 times
Please post any problems/bugs/suggestions/feedback you have! Unfortunately I cannot provide support for using this patch except with the specified SVN trunk revision.

win32 binary
departureboardswallclock25-r27452.zip
(7.26 MiB) Downloaded 646 times
This binary is not multiplayer compatible with trunk.

Unfortunately I cannot provide support for using this binary. Good luck!

Notes for interoperability with other patches

Vehicle timetable start dates are changed to be in ticks rather than days unless network compatibility is enabled.

To display a time, use STR_WALLCLOCK_x where x is one of LONG, SHORT, TINY, and ISO. It accepts a single argument; the time to be displayed in ticks. This should be an int64.

departureboards

About

This patch adds a "Departures" button to the station view window. When clicked, this opens a window showing the vehicles timetabled to depart from the station.

The design was inspired by the departure boards at train stations in the UK (specifically King's Cross).

Features

Whether to show company name or vehicle name (or both) next to each departure can be configured.

If a list of stations called at is too long to fit in the window, it will automatically scroll.

"Service at *" orders should be handled correctly.

Trains can be listed as going via a station (e.g. Inverness via Edinburgh Waverley) by adding an order to the train to go (optionally non-stop) via the station.

Handling of vehicles that have been delayed or that have already arrived already arrived is shown in the screenshot. If a train is late but the time it is expected to arrive is unknown (e.g. if it broke down just before arriving) it will be listed as "Delayed".

Future recurrences of timetabled departures may be shown (subject to the conditions set by the patch options).

The "Calling at: *" text of departures can be made to use a larger font than shown in the screenshots if desired.

There is rudimentary support for RTL languages.

Vehicles will only be listed as departing from a station if they have an order to load from that station with a nonzero wait time, and all their orders have a travel time set.

Departure boards can be set to show departures, arrivals, both or neither.

Patch options

* Interface > Departure boards > Show at most # departures at each station
- set the maximum number of departures that will be displayed for each station

* Interface > Departure boards > Show departures at most # days in advance
- set how far into the future scheduled departures will be shown

* Interface > Departure boards > Calculate departures every # ticks
- set how frequently open departure boards will be recomputed - this might increase performance when fast-forwarding but I haven't noticed much difference

* Interface > Departure boards > Show vehicle name with departures: #
- whether to show vehicles' names next to their associated departures

* Interface > Departure boards > Show group name with departures: #
- whether to show vehicles' groups next to their associated departures

* Interface > Departure boards > Show company name with departures: #
- whether to show the name of the company that owns the vehicle next to its associated departures

* Interface > Departure boards > Show vehicle type icon with departures: #
- whether to show the vehicle type icon of the vehicle associated with a departure (with thanks to sph)

* Interface > Departure boards > Show vehicle type icon in silver: #
- whether to show use silver as the colour to display vehicle type icons in departure boards

* Interface > Departure boards > Use larger font for stations called at on departure boards: #
- whether to use a larger font for the calling at list

* Interface > Departure boards > Show icons for destinations that are docks or airports: #
- whether to show a ship or plane icon for a destination that is a dock or airport, respectively, unless the vehicle making the journey is a ship or plane, respectively

* Interface > Departure boards > Show arrival and departure times on the same line: #
- whether to show both arrival and departure times for departures (disables display of arrivals)

* Interface > Departure boards > Only show departures for vehicles that can carry passengers: #
- whether to only show passenger services

* Interface > Departure boards > Handle conditional order jumps by: #
- determines how to handle conditional order jumps when displaying departures (does not apply to arrivals)

* Interface > Departure boards > Show all stations called at regardless or loading/unloading: #
- whether to list a station even if the vehicle does not unload there, and a departure even if the vehicle does not load there

* Interface > Departure boards > Don't show termini that can be reached sooner by a later vehicle: #
- whether to show a departure's true destination if it can be reached by a later departure of the same vehicle type

* Interface > Departure boards > Merge identical departures: #
- whether to merge identical departures into a single departure
wallclock

About

This patch adds the ability to show some times in minutes and hours. Game time (days, years) is unaffected and continues to progress at the same speed as before.

Features

As shown in the screenshot, the patch works with the departureboards patch.

In its default state, this patch breaks multiplayer compatibility.

Patch options

* Interface > Show time in minutes rather than days: #
- whether to show times using the 24h clock or not

* Interface > Ticks per minute: #
- how long a minute lasts in ticks

* Interface > Show month and year with time in status bar: #
- whether to show the current month and year in the status bar along with the time

* Interface > Enter timetable start times as text (requires time to be in minutes): #
- whether to enter timetable start times as text (hhmm format)

* Interface > Clock offset in minutes: #
- the number of minutes to offset the 24h clock by

Screenshots

Image

Image

Updates

* Added combined patch.
* Added link to Wasila's binary.
* Updated links to binaries.
* Updated departureboards.
* Updated wallclock.
* Added link to up-to-date binary.
* Updated departureboards and binary.
* Updated to r20801.
* 2010-09-23 Major bugfix in departureboards.
* 2010-09-26 Made the length of minutes configurable.
* 2010-10-14 Added sph's code to show vehicle type icons.
* 2010-10-18 Added the option to show vehicle type icons in silver. Changed how departure boards handles orders with wait time set to zero.
* 2010-10-19 Improved handling of "unload and leave empty" orders.
* 2010-10-19 Updated binary.
* 2010-10-19 Added arrivals. Moved departureboards advanced settings into their own category.
* 2010-10-20 Various small bugfixes in departureboards.
* 2010-10-20 Updated binary.
* 2010-10-20 Changed the ordering of departures.
* 2010-11-01 Updated to version 8b4.
* 2010-11-17 Updated to trunk version r21219.
* 2010-12-10 Updated to trunk version r21446.
* 2010-12-11 Fixed incorrect checking for vehicles going to stop in a depot.
* 2010-12-13 Added the option to show arrival and departure times on the same line.
* 2011-01-02 Added the option to show group names. Fixed display bug for 'via' stations.
* 2011-01-12 Stopped arrivals being automatically. Added departure boards for waypoints, and the ability to show vehicles going via the station whose departure boards are being shown.
* 2011-01-29 Fixed calculation of the maximum date width. Added the option to only show passenger services. Removed the vehicle timetable skip patch as an equivalent feature is now in trunk (r21832 onwards.) Updated to trunk version r21920. Binary finally updated.
* 2011-01-30 Added the ability to handle conditional order jumps.
* 2011-02-11 Added the ability to choose whether to show stations regardless of loading/unloading. Updated to trunk r22060.
* 2011-03-04 Updated binary.
* 2011-04-11 Fixed problems that occur at large dates. Changed timetabling to allow timetables to be set to start up to an hour ago. Hopefully fixed there being insufficient width to display times in the timetable window.
* 2011-04-11 Updated binary.
* 2011-04-12 Fixed a bug with the patch settings.
* 2011-05-10 Fixed an incorrect colour being used as the background.
* 2011-08-12 Fixed a bug when trying not to show non-passenger departures. Added smart termini. Updated to trunk r22733.
* 2011-08-15 Updated binary.
* 2011-11-03 Updated to trunk r23082.
* 2011-11-11 Fixed binary.
* 2011-11-17 Updated to trunk r23237.
* 2011-12-03 Updated to trunk r23362.
* 2011-12-23 Updated to trunk r23660.
* 2012-01-22 Added the ability to enter timetable start times as text. Updated to trunk r23834.
* 2012-01-26 Updated binary.
* 2012-01-27 Added the ability to merge identical departures. Updated to trunk r23856. Updated binary.
* 2012-02-16 Updated to trunk r23954.
* 2012-04-21 Updated to trunk r24156.
* 2012-05-14 Fixed missing widget header file.
* 2012-05-19 Updated to trunk r24263.
* 2012-08-16 Updated to trunk r24474.
* 2012-10-08 Added clock offset. Updated to trunk r24576.
* 2015-04-04 Updated to trunk r27218.
* 2015-11-21 Updated to trunk r27452.

Previous version
departureboardswallclock25-r27218.diff
(132.81 KiB) Downloaded 572 times

Re: [Patch] Departure boards, 24h clock

Posted: 06 Sep 2010 15:43
by Gremnon
Can I ask, for clarification, does one have to apply one patch, then the other? And if so, does it matter what the order is?

Re: [Patch] Departure boards, 24h clock

Posted: 06 Sep 2010 16:09
by hthhs
Both patches can be used either together or independently and the order doesn't matter. There *shouldn't* be any problems with them but to be safe I'll make a combined one and include it in the first post. It hadn't occurred to me to do this but it's an excellent idea - thank you! :)

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 18:41
by bwong
Nice, I like the idea a lot!
but I don't know how to compile. (even with the links people have given me...)

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 18:43
by Wasila
Great concept - I wish you luck.

I myself won't be using it as I don't use timetables.

EDIT: Making a binary now.

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 19:04
by Wasila
Patch r20725 applied to trunk (r20762). I think there's something wrong with my OpenGFX set (I keep getting error messages at start-up) so you may want to replace it with your own.

http://rapidshare.com/files/417689102/D ... r20762.zip

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 19:47
by hthhs
Awesome! Thank you, Wasila! :D I'll add a link to your post in the first post of the thread.

bwong, hopefully Wasila's binary will work for you :)

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 20:44
by bwong
haha, yes indeed it works

Is there anyway to remove the day 503 part?

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 20:45
by Wasila
Thanks :). As a matter of interest, do you get an error message about GRFs on start-up?

Except I kinda just realised that I only made a binary for one of the patches <_<. Working on one for the combined diff now.

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 20:47
by bwong
no wonder I was missing something!
:D

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 20:48
by Wasila
Compiling now.

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 20:51
by bwong
I might be going a little bit off topic, but talking about the departure board, is it possible to incorporate which platform the train will be using?

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 21:08
by Wasila
I lied about editing the old post :P.

http://rapidshare.com/files/417711813/D ... r20762.zip

THIS is the proper compiled patch. Enjoy :).

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 21:08
by Chris
bwong wrote:I might be going a little bit off topic, but talking about the departure board, is it possible to incorporate which platform the train will be using?
I would assume no, as I don't think OpenTTD numbers platforms, and I don't think the pathfinder identifies which platform the train is going to.
bwong wrote:no wonder I was missing something!
:D
I got a bit confused as to where the departures boards had gone too :D .
Wasila wrote:Thanks :). As a matter of interest, do you get an error message about GRFs on start-up?
Indeed I do.

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 21:10
by Wasila
Since the other file was misnamed, I've renamed it (which broke the link). New link for just the wallclock is
http://rapidshare.com/files/417689102/W ... 2.zip.html

Like I said, you might want to replace the OpenGFX included, since mine is kinda messed up.

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 21:11
by Vitus
Wasila, please don't include OpenGFX and OpenSFX in your download. It is completly unnecessary (user can use his own downloaded/original version after all) and only makes the archive file bigger.

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 21:13
by Chris
Why don't you attatch the file here instead of uploading it somewhere else?

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 21:15
by Wasila
Sorry Vitus, I thought that shipping a version of the game which doesn't work wouldn't be appropriate, but if it's OK then I'll keep it in mind for next time.

Class 165, I prefer uploading on Rapidshare because I can see the progress of the upload and see if it's working instead of the mysterious 'Uploading' pop-up on the forums.

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 21:16
by Vitus
Class 165 wrote:Why don't you attatch the file here instead of uploading it somewhere else?
Likely because of forum limitation (4 MiB maximum size of attachment).

Re: [Patch] Departure boards, 24h clock

Posted: 07 Sep 2010 21:17
by Wasila
That too...