Timetable Improvement Patch

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

ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 » 11 Sep 2017 21:00

The next version. Changes:
- Renamed variables related to the lines displayed in the window, to better reflect the content of that lines
- The rename button now shows up properly, when the line where the name is displayed is selected
stip_v24.zip
(159.88 KiB) Downloaded 39 times
Then I asked me the question, why some of the buttons occupy that much space, blowing up the minimum size of the window For the left button, I found the reason in the conditional order dropdown:
ButtonSize.png
(103.42 KiB) Not downloaded yet
(Probably) because the conditional order dropdown contains one extra-long string ("Remaining lifetime (years)"), the whole button becomes that big (minimum) size, even if some significant shorter text (e.g. "Arrival") is displayed. The technical reason is that the NWID_SELECTION (sample code below) of course takes the space of the biggest part, which here is the WID_VT_COND_VARIABLE_DROPDOWN.

The code below is from my patch, but similar code exists in the trunk order window as well.

At least unbeautiful effect of that GUI, although I don´t see a simple solution to that right now. In theory, moving the NWID_SELECTION outside would be an option (i.e. the selection doesn´t select single buttons, but whole button rows), but then some buttons would have to be present in multiple selection alternatives, and then I believe things start to become unbeautiful in a programming sense as well...

Code: Select all

				NWidget(NWID_SELECTION, INVALID_COLOUR, WID_VT_SELECTION_TOP_1),
					NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, WID_VT_NON_STOP_DROPDOWN), SetFill(1, 0),
												SetDataTip(STR_ORDER_NON_STOP, STR_ORDER_TOOLTIP_NON_STOP), SetResize(1, 0),
					NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_ARRIVAL_BUTTON), SetResize(1, 0), SetFill(1, 1),
															SetDataTip(STR_TIMETABLE_ARRIVAL_BUTTON_CAPTION, STR_TIMETABLE_ARRIVAL_BUTTON_TOOLTIP),
					NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_START_BUTTON), SetResize(1, 0), SetFill(1, 1), 
							SetDataTip(STR_TIMETABLE_START_BUTTON_CAPTION, STR_TIMETABLE_START_BUTTON_TOOLTIP),
					NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 0), SetResize(1, 0), EndContainer(),
					NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_VT_COND_VARIABLE_DROPDOWN), SetFill(1, 0),
															SetDataTip(STR_NULL, STR_ORDER_CONDITIONAL_VARIABLE_TOOLTIP), SetResize(1, 0),
				EndContainer(),

ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 » 17 Sep 2017 16:15

It seems that placing the whole button row into one SELECTION (instead of adding one SELECTION per button) indeed changes a lot. Space consumption of that window decreased significantly by that change, especially compared to the order window. Obviously, combinations of
"long city name" plus "long station name" plus "long modifier list like Full Load etc." can lead to text running out at the right, but (1) in my experience rather short lines are more common, (2) you may enlarge the window freely, and (3) you may save a bigger default size using the button near the title bar.

Furthermore, I moved the name of the timetable (if specified) to the caption, which allowed for further shortening the first property line below. It now consumes about as much minimum space as the button row below (in English translation).

The new version:
stip_v25.zip
(162.94 KiB) Downloaded 36 times
The destination list
Dest.png
Dest.png (35.05 KiB) Viewed 2180 times
The timetable list view
Time.png
Time.png (37.7 KiB) Viewed 2180 times
The order lines in that window should support all functionality which is currently present in the order window - if some functionality is not there in my timetable window I would regard this a bug. So, in theory, one could think about merging order + timetable window in that window (as discussed in chat recently).

Comments etc. welcome.

User avatar
Wolf01
Tycoon
Tycoon
Posts: 2013
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: Timetable Improvement Patch

Post by Wolf01 » 17 Sep 2017 16:33

I seem to like the way you implemented it, but I feel also the timetable view a bit confusing, I can't explain you why... maybe I'm too used to tabular display of the details.
I know the problem is to keep the window the smallest possible, but there is something missing, also the UI is too much cluttered with buttons now...

ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 » 17 Sep 2017 17:30

You are right with the buttons - I just realized that I missed implementing some code recognizing the needed width of the (currently not displayed) other dropdown options. So, e.g. a Non-Stop dropdown completely displaying also the other options needs some more space.

Maybe this is code that wasn't necessary before, because some other option of the SELECTION occupied more space anyway.
I seem to like the way you implemented it, but I feel also the timetable view a bit confusing, I can't explain you why... maybe I'm too used to tabular display of the details.
Dou you mean the upper view (Start Offset Lenght etc.), or the lower one? As for the lower one, that one actually is tabular (if you choose "Time" at the right). Or do I miss what you mean with "tabular"?
I know the problem is to keep the window the smallest possible, but there is something missing, also the UI is too much cluttered with buttons now...
Maybe one should distinguish minimum, and default size. As far as I get it, I can specify a constant default size near the nested tree, and the user can specify a default size of that window using the button (second from right) in the title bar.

So, the default size the window has when it opens is not necessarily the minimum possible size, though (as far as I get it) the OpenTTD window engine seems to very much think in minimum sizes.

User avatar
Wolf01
Tycoon
Tycoon
Posts: 2013
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: Timetable Improvement Patch

Post by Wolf01 » 17 Sep 2017 18:08

ic111 wrote:Dou you mean the upper view (Start Offset Lenght etc.), or the lower one? As for the lower one, that one actually is tabular (if you choose "Time" at the right). Or do I miss what you mean with "tabular"?
The bottom part, with tabular I mean something like this, where the content is aligned in colums where possible:
electronic-departures-board-displaying-train-times-at-railway-station-dxrer1.jpg
electronic-departures-board-displaying-train-times-at-railway-station-dxrer1.jpg (104.5 KiB) Viewed 2167 times
About the sizes and the layout of the UI elements I found myself thinking about a different way to get it, maybe it makes the UI more complex to handle via code, but the finished result should be more user friendly, but this break the old TT style for the UIs.
I'm talking about tree views, tabs, and accordions to have a lot of content in a single window but hiding the parts which aren't of interest in a specific moment.
Some of the latest UIs have a different style wrt the TT one, see the multiplayer or the online content ones, which allow even to put some space to separate the controls, along with different colours to make the buttons different than labels.

Feel free to prod me with a stick in the chat if you want to discuss about some UI changes I'm working on, so I can show you what I've done (and about all with the SELECTION)

ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 » 17 Sep 2017 19:15

Wolf01 wrote:
ic111 wrote:Dou you mean the upper view (Start Offset Lenght etc.), or the lower one? As for the lower one, that one actually is tabular (if you choose "Time" at the right). Or do I miss what you mean with "tabular"?
The bottom part, with tabular I mean something like this, where the content is aligned in colums where possible:
Hm, but I see just one real difference to mine: In your image, the departure time is left, and the destination station is right of the departure time, whereas I (following OpenTTDs order window style) display the destination left (though right-aligned) and the arrival/departure time right of it.
To be more specific: What I do is: Calculate the length of the longest station name. Reserve that much space for the station names. Display them right-aligned within that space. Then right of that, display columns for arrival, departure time, and for speed limit.

Maybe I should have chosen an example with more filled arrival/departure times...
EDIT: See also this one: download/file.php?id=199618

BTW, today I actually thought about displaying the arrival / departure time left. Would have the advantage, that then the important information is always visible, whereas if some too long station name sometimes doesn't completely fit into the window, you often know which one is meant nevertheless (e.g., if you instead of "Exeter St David's" only see "Exeter St D...", you will probably know what's meant).
About the sizes and the layout of the UI elements I found myself thinking about a different way to get it, maybe it makes the UI more complex to handle via code, but the finished result should be more user friendly, but this break the old TT style for the UIs.
I'm talking about tree views, tabs, and accordions to have a lot of content in a single window but hiding the parts which aren't of interest in a specific moment.
Do you see senseful opportunities to actually use these patterns in the order / timetable view?

I think, for a timetable, a tabular view is quite straightforward. Furthermore, in orders/timetable view, my feeling is that you probably mostly want to hide or show some kind of information for all orders, i.e. something I do with the Full/Dest/Time button in the upper right section of the window. Maybe one might extend that concept to having some row or column of icons, where each icon can toggle some particular piece of information (similar to the transparency GUI).
Feel free to prod me with a stick in the chat if you want to discuss about some UI changes I'm working on, so I can show you what I've done (and about all with the SELECTION)
Thanks, I will probably do so, but today some technical problems with my internet provider make using a chat not the best option...

ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 » 19 Sep 2017 21:08

Changes this time:

- Dropdowns like NonStop, FullLoad, etc. now have a calculated minimum size that ensures that all labels are completely visible. Thus, the timetable now has become somewhat larger again.
- The SetLength windows now also have a working calculated minimum size. Actually, that code existed before as well, but wasn't effective since class inheritance combined with a wrong way to implement things prevented UpdateWidgetSize from being called. This is fixed now.
- In detail, the latter one fixed the windows for setting the timetable length, for setting the vehicle offset, and the wizard for moving a selected subset of the orders by a specified amount of time (either measured in days, months, or years).

(that wizard is accessible by using the "<<" and ">>" buttons, and works by subsequently clicking the first and the last order to shift, guided by yellow hints in the top region of the window)
stip_v26.zip
(164.53 KiB) Downloaded 52 times
EDIT: Current screenshot:
Timetable.png
(54.41 KiB) Not downloaded yet
.

User avatar
BeSt-Com
Traffic Manager
Traffic Manager
Posts: 167
Joined: 25 May 2005 18:19
Location: Berlin/Germany
Contact:

Re: Timetable Improvement Patch

Post by BeSt-Com » 05 Feb 2019 09:26

Sorry for bumping this up.
Is there anybody who has got a playable windows binary with this timetable-patch, preferably in the last version (v26)?

User avatar
BeSt-Com
Traffic Manager
Traffic Manager
Posts: 167
Joined: 25 May 2005 18:19
Location: Berlin/Germany
Contact:

Re: Timetable Improvement Patch

Post by BeSt-Com » 12 Feb 2019 07:50

Truespace did it again :bow:
Patch SV26

McZapkie
Tycoon
Tycoon
Posts: 1176
Joined: 18 Jan 2014 18:10

Re: Timetable Improvement Patch

Post by McZapkie » 17 Apr 2019 11:15

This patch is awesome, but I'm afraid it is much too complicated for most of the openttd users thus there is little chance to have it implemented in trunk or even some popular patch pack.

My proposal is to make simple patch: graph for veicle timetable, which can show graphs of all other vehicles which share same stations.
Such patch can be implemented only on the client side, because it change only graphic interface,
without bothering different client/server/save versions.

Of course such chart would be simplified: time on X axis, and station/wp. names on Y, without real distance, and without information about detours - but even with these restrictions, it would be something very convenient.
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

Vanderbildt
Engineer
Engineer
Posts: 16
Joined: 24 Feb 2016 16:40

Re: Timetable Improvement Patch

Post by Vanderbildt » 23 Aug 2019 21:54

i love to play with TIP but i have a request
is it posible to add:
a split for the waitingtime for Staiton / Waypoint? with the shift click i change both but theWaypionts are mostly only for the Staion entrance.
and another or second starttime/ returntime
example start: at staition A at 12:00 go to staiton Z and start/ return at 20:00?
and that all for JGR`s Patch Pack!!

thanks

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests