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

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by hthhs »

VVG wrote: Variable minute's length has been done already. If you are going to make a minute's length variable, you might find this http://www.tt-forums.net/viewtopic.php?f=33&t=49799 helpful.
Using this sounds like a good plan. I'll attempt to compile with both this and departureboards.

EDIT

departureboards0.82rc + virtual time

Use this patch after applying departureboards0.82rc and virtual time to get departure boards to display times in hh:mm format:
departureboards0.82rc-virtualtime.diff
(2.83 KiB) Downloaded 183 times

Comm Cody wrote:One Question. Does this mess up vehicle invention date? Or the year you pick in the start new game menu?

EDIT And it does.
Which vehicles does it mess up for you?
ChillCore wrote: On topic,
hthhs,
When the departure tables are empty you have put a redirect to openttd.org. Lol, they are not there either, I checked. :mrgreen:
Would it not be better to give a more relevant message? eg. "The departure times are not calculated yet. Are you using timetables?" or something alike?
That would make all kinds of sense. :p
User avatar
Dwight_K._Schrute
Traffic Manager
Traffic Manager
Posts: 209
Joined: 01 Sep 2010 11:29

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by Dwight_K._Schrute »

I have a little problem...

My trams don't appear on the departure board... don't know why... They all have timetables (see screenshot)
Attachments
McAlpine & Co., 09_41 Day 494.png
(148.06 KiB) Downloaded 1 time
hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by hthhs »

Dwight_K._Schrute wrote:I have a little problem...

My trams don't appear on the departure board... don't know why... They all have timetables (see screenshot)
Hmm, that's odd - trams work for me.

Do they load from the station, or only unload?
Attachments
tram.png
tram.png (125.11 KiB) Viewed 1069 times
User avatar
Dwight_K._Schrute
Traffic Manager
Traffic Manager
Posts: 209
Joined: 01 Sep 2010 11:29

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by Dwight_K._Schrute »

They load and unload... no special orders...

that's really weird... in other cities it's the same... but trains an buses work properly ?(
hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by hthhs »

Would you mind sending me your save file?
User avatar
Dwight_K._Schrute
Traffic Manager
Traffic Manager
Posts: 209
Joined: 01 Sep 2010 11:29

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by Dwight_K._Schrute »

Here it is... But my version is patched with Chill's Patch Pack v10.. so I hope you can open it...
Attachments
McAlpine & Co., 16_42 Day 495.sav
(5.51 MiB) Downloaded 198 times
User avatar
Dwight_K._Schrute
Traffic Manager
Traffic Manager
Posts: 209
Joined: 01 Sep 2010 11:29

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by Dwight_K._Schrute »

Ok.. now it hates me completely :evil:
Attachments
McAlpine & Co., 12_53 Day 497.png
(231.97 KiB) Downloaded 1 time
hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by hthhs »

I'm stumped. :( I really can't see why it's not working. I haven't managed to replicate the behaviour from scratch either, even using the same patchpack. The order list you've given them should be fine.

Unfortunately as you're not using the patch applied to an otherwise unpatched source I'm not in a position to figure out what's going wrong. Sorry! Maybe the patchpack changes something to do with vehicle orders, and/or the vehicles have an order to go to a station and stay for 0 days/ticks?
Scautura
Engineer
Engineer
Posts: 102
Joined: 01 Aug 2006 07:30

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by Scautura »

I have exactly the same issue, with the same patch pack - Daylength is set to 3, my timetables are automated (as such, some are "stay 0 days" - does this matter only for the departing station, or all stations in the list?). It does seem to have occurred after I built a few stations (5th or 6th station, or so) and any further stations also exhibit the same behaviour. I've had it occur in a brand new game, and an older savegame.

I'm inclined to believe it's a bad interaction between patches, so I'll see if I can replicate it with a "vanilla" patched version.

Affected stations (in which savegame):

Drafingbourne Transport: Trefingfield, Plindston North, Drafingbourne, Dinston Heights
Draston Transport: Daningwell South
Attachments
Drafingbourne Transport, 1932-11-21.sav
(201.25 KiB) Downloaded 164 times
Draston Transport, 1933-02-25.sav
(263.62 KiB) Downloaded 147 times
Duct tape is like the Force - it has a Dark side, a Light side, and it holds the universe together.
hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by hthhs »

Scautura wrote:I have exactly the same issue, with the same patch pack - Daylength is set to 3, my timetables are automated (as such, some are "stay 0 days" - does this matter only for the departing station, or all stations in the list?). It does seem to have occurred after I built a few stations (5th or 6th station, or so) and any further stations also exhibit the same behaviour. I've had it occur in a brand new game, and an older savegame.
Any "go to station" order with a travel time of 0 days or a stay time of 0 days is significant and will cause the patch to stop trying to find the next departure for the vehicle as it assumes that the vehicle is not fully timetabled.
Scautura wrote:I'm inclined to believe it's a bad interaction between patches, so I'll see if I can replicate it with a "vanilla" patched version.
Thank you! That would be much appreciated :) I haven't encountered this problem so maybe I have a weird playing style that doesn't cause it to happen.
Scautura
Engineer
Engineer
Posts: 102
Joined: 01 Aug 2006 07:30

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by Scautura »

Results:

This is a savegame made using the "vanilla" patched version on the previous page. Loaded in that version, it works fine... Loaded in Chill's patch pack and... It breaks (the trams have no departure info). Definitely an issue with the patchpack, and as such, needs to be posted in there his thread (I'm going to crosspost the info)
Attachments
Little Slarnford Transport, 1933-10-23.sav
(187.59 KiB) Downloaded 154 times
Duct tape is like the Force - it has a Dark side, a Light side, and it holds the universe together.
Steve-N
Engineer
Engineer
Posts: 4
Joined: 08 Feb 2010 05:45

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by Steve-N »

hthhs wrote:I'm stumped. :( I really can't see why it's not working.
Maybe because it's only getting the vehicle list for station 0 ? Adding the station id to the VehicleListIdentifier might help:

Code: Select all

diff --git a/src/departures.cpp b/src/departures.cpp
index bb83d36..ea7be73 100644
--- a/src/departures.cpp
+++ b/src/departures.cpp
@@ -85,7 +85,7 @@ DepartureList* MakeDepartureList(StationID station, bool show_vehicle_types[4])
                }
 
         /* MAX_COMPANIES is probably the wrong thing to put here, but it works. GenerateVehicleSortList doesn't check the company when the type of list is VL_STATION_LIST (r20801). */
-               if (!GenerateVehicleSortList(&vehicles, VehicleListIdentifier(VL_STATION_LIST, (VehicleType)(VEH_TRAIN + i), MAX_COMPANIES).Pack())) {
+               if (!GenerateVehicleSortList(&vehicles, VehicleListIdentifier(VL_STATION_LIST, (VehicleType)(VEH_TRAIN + i), MAX_COMPANIES, station).Pack())) {
                        /* Something went wrong: panic! */
                        return result;
                }
hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: [Patch] Departure boards, 24h clock (+ binary)

Post by hthhs »

That's an error - thank you for spotting it! :) Serves me right for not checking what had changed properly and just hacking something in that seemed to do what I wanted. It seems miraculous that it ever worked...

The first post of the thread has been updated.
sph
Engineer
Engineer
Posts: 20
Joined: 14 Oct 2010 16:09

Re: [Patch] Departure boards, 24h clock + binary

Post by sph »

Nice work there!

I tweaked your patch a little bit so it would show the vehicle type icon after the destination. I know you can filter them, but I find this easier to use :)
I hope you like it.

(Patch is applied on the trunk)
Attachments
departures.png
departures.png (4.84 KiB) Viewed 4749 times
departures-types.diff
(79.47 KiB) Downloaded 173 times
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: [Patch] Departure boards, 24h clock + binary

Post by Eddi »

hm... maybe before the destination would be better?
Logital82
Engineer
Engineer
Posts: 58
Joined: 15 Feb 2010 12:03
Location: Germany, Berlin

Re: [Patch] Departure boards, 24h clock + binary

Post by Logital82 »

Would be nice to have an arrival time too. SO its easyer to control the "intregral schedule". Dont know the word for this in englisch. It is when one train arrives at maby at 56 and the train in the other direction so departs at 04. or 57 to 03 ando so on...
sph
Engineer
Engineer
Posts: 20
Joined: 14 Oct 2010 16:09

Re: [Patch] Departure boards, 24h clock + binary

Post by sph »

Eddi wrote:hm... maybe before the destination would be better?
It would look like in the attachment then, somehow it feels a bit more unnatural that way, but that could just be me :)
Logital82 wrote:Would be nice to have an arrival time too. SO its easyer to control the "intregral schedule". Dont know the word for this in englisch. It is when one train arrives at maby at 56 and the train in the other direction so departs at 04. or 57 to 03 ando so on...
Yeah, I've been thinking about that as well. Would be useful to increase the station's throughput by making sure a train is gone before the next one arrives.
Attachments
departures2.png
departures2.png (6.37 KiB) Viewed 4736 times
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: [Patch] Departure boards, 24h clock + binary

Post by Eddi »

hm, maybe it's not perfect... how about as a separate column? (so between the destination and the "arrived" column, but aligned)
sph
Engineer
Engineer
Posts: 20
Joined: 14 Oct 2010 16:09

Re: [Patch] Departure boards, 24h clock + binary

Post by sph »

Eddi wrote:hm, maybe it's not perfect... how about as a separate column? (so between the destination and the "arrived" column, but aligned)
I tried that too (well actually it happened due to a bug), the type icon will look a bit isolated from the rest, it's not really the useful effect you'd have expected. I can live with the second example however, the code is a lot simpler than the first one as well.
hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: [Patch] Departure boards, 24h clock + binary

Post by hthhs »

sph wrote:Nice work there!

I tweaked your patch a little bit so it would show the vehicle type icon after the destination. I know you can filter them, but I find this easier to use :)
I hope you like it.

(Patch is applied on the trunk)
That's a cool idea! I've added it to the patch on the first post of the thread with a few modifications:
- the icons are now orange, like most of the rest of the text
- the icons are shown between the time and destination, because this was easier to implement ;)
- whether to show them or not can be set in advanced settings

Thank you! :)
Logital82 wrote:Would be nice to have an arrival time too. SO its easyer to control the "intregral schedule". Dont know the word for this in englisch. It is when one train arrives at maby at 56 and the train in the other direction so departs at 04. or 57 to 03 ando so on...
Arrivals boards would indeed be useful. I'll look into adding them this weekend if I have time.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot], Google Adsense [Bot] and 29 guests