[patch] "transfer" with shift, "go via" with ctrl+shift

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

User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

[patch] "transfer" with shift, "go via" with ctrl+shift

Post by adf88 »

Make non-construction commands insensible to shift key:
free_shift_key_r23663.diff
(1.33 KiB) Downloaded 256 times
Faster orders creation - "transfer" with shift key, "go via" with ctrl+shift keys:
faster_goto_orders_creation_r23663.diff
(1.26 KiB) Downloaded 237 times
Apply the first one, then the second.

For OpenTTD 1.1.4 (booth):
free_shift_and_faster_goto_1.1.4.diff
(2.59 KiB) Downloaded 230 times
Last edited by adf88 on 23 Dec 2011 22:16, edited 4 times in total.
:] don't worry, be happy and checkout my patches
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Terkhen »

User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Leanden »

A note from devs with reply with "won't implement"

Is this because they disagree with the concept or the dirty method used to write this patch?
Image
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Zuu »

Leanden wrote:A note from devs with reply with "won't implement"

Is this because they disagree with the concept or the dirty method used to write this patch?
I think the answer is quite clear if you read the comments to the task.

(the answer is: both)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by adf88 »

Please, see the code, understand it and discuss about this certain patch (at least in this thread).

// EDIT
As suggested by Rubidium in FS#3127 ("Transfers are now "leave empty" by default.") I removed the line with "no unload" flag.
:] don't worry, be happy and checkout my patches
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Leanden »

Well perhaps instead of forcing transfer to shift and via to ctrl+shift, you could do a patch with the original concept which was to add go via to the hotkey hook list.
Image
User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by adf88 »

Patch updated.
:] don't worry, be happy and checkout my patches
Eagle_rainbow
Engineer
Engineer
Posts: 59
Joined: 13 Oct 2012 20:27
Location: Germany

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Eagle_rainbow »

Hi everyone,

recently a discussion on this topic came up in-game (at the [DE] servers). I am a player who is using the transfer feature frequently. I think being able to set the "transfer" mode with a special key while clicking would really be a benefit. Being able to issue the "full load any cargo" option via special key, but not being able to do so for "transfer", already feels inconsistent to me by itself. Also two other players in that discussion were in favor of such a function whilst nobody else was objecting fundamentally. IMO although you may define a hotkey for the transfer mode, it still remains somewhat cumbersome, as you have to select your latest order item before you may issue the hotkey.

I understand the argument of using SHIFT for this case could be somewhat misleading for some users, as in other screens it is used for cost estimates. However, I disagree in such a sense that we should avoid it totally - we already have other cases where overloading of hotkeys has already taken place (example: hotkey '4' in road mode compared to rail mode). Thus, different semantics for the same key in different contexts is already known to the end user. Furthermore, I argue that hotkeys are mainly used by intermediate or expert users, whilst novice users are only making use of the GUI features using the mouse.
Nevertheless, I played around a bit with the other proposal as depicted in FS#3127 by Terkhen, namely using the ALT key instead. That would be the cleanest way out in my mind. However, this does not work on Linux, as the combination ALT+left-click may be a window manager's function, for example to move the current window on the desktop. If you hold CTRL and ALT at the same time (and then left-click), then it will work and the application is being informed properly (at least on my box). I did not check the behavior on Windows (due to lack of win dev environment). After all, having "full load any cargo" on CTRL and putting "transfer" to CTRL+ALT does not look to me being that intuitive as well. :?

What about using a double-click instead? Did anyone check on this already? Or does that give you a strange feeling on usability?
Any other ideas which are not documented here so far?
Cheers,
Eagle_Rainbow

My Wiki Home (incl. overview of patches)
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Eddi »

i'd rather be able to configure which order modifier(s) are created with simple click and ctrl click, instead of having a dozen different key combination to satisfy everybody's needs.

most users probably never need transfer. either because they build point-to-point connections or they use cargodist.

the only thing that currently can be configured is the non-stop flag, but only for both key combinations simultaneously.
User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by adf88 »

No, you need at least two click modifiers - one for full load, one for transfer (or whatever else). Otherwise it has no sense to make it configurable - mostly you would just leave "full load" for CTRL, I would do so. Nothing would change.

"transfer with SHIFT" is actually the most useful patch to me. I can't leave without it! When new OpenTTD version comes out I always start making my custom client with applying this certain patch. I have no personal interest in having it in the trunk since I can always patch the source code, but seeing how useful it turned out to me I think other should be able to benefit from it too. It not only saves your time, it makes mistakes (while creating orders) almost impossible.

I was wondering long long time what key could be used. Like Eagle_rainbow outpointed, ALT can be an OS hook to manage windows (the X for example). SHIFT is the only option and it's a good option. I've already disagreed with counterarguments, lets do this again:
  • there is no interference with cost estimation because there is a clear division - actions that generate costs and actions that don't
  • having somehow "hidden" feature, having more usable keys can't be worse then not having it at all (OK, sometimes can, but not in this case).
There are alternate solutions I can think of, solutions that don't require new keys. But these are not so good as the SHIFT key:
  • CTRL+GOTO could open the GOTO tool in alternate mode (affecting click and ctrl+click). This solution is bad because it would make "fast GOTO order creation" almost unusable.
  • More ergonomic GUI - graphical, click-able indicators next to each order so you can change order type with just a single click, without having to select the order. Bad because you still have to point proper order on the list.
  • When setting up orders, clicking on a station and holding the button for a moment could roll down a menu (wired).
Current orders GUI is rely unpleasant. It's time consuming, it's easy to make a mistake. The most frequent mistake I do is assigning order modifiers (like "transfer") to wrong orders. Accidentally reordered orders (is this an oxymoron? ;) ) is a problem to me too.


Most users not using transfers? That could be true.
Most of entire playtime (of all users) without transfers? It can't be true...
:] don't worry, be happy and checkout my patches
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by planetmaker »

Let me go on a slight tangent here
adf88 wrote: Current orders GUI is rely unpleasant. It's time consuming, it's easy to make a mistake. The most frequent mistake I do is assigning order modifiers (like "transfer") to wrong orders. Accidentally reordered orders (is this an oxymoron? ;) ) is a problem to me too.
I can agree with this statement. While all more-or-less regular users or those who (still) know TTD will know and probably like it, it doesn't make it the best available, especially given the many hidden things, accessible via ctrl etc. Maybe there's a way to revise this GUI, to make it easier accessible, maybe to actually make it usable without the need to resort to ctrl etc? It could also improve use / port to touch devices.

So the most complicated task on this tangent is: design a good UI which makes all elements clear and accessible. No need to be shy about introducing additional or redrawn GUI buttons :-)
User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by adf88 »

I was thinking about a tabelaric layout with textless indicators/switches, something like this:
1.png
1.png (6.2 KiB) Viewed 8426 times
On narrow devices it could look similar to this:
2.png
2.png (3.44 KiB) Viewed 8426 times
// EDIT
Ignore the "non stop" text on the above mock-up, "non stop" would be an icon too.
:] don't worry, be happy and checkout my patches
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Eddi »

adf88 wrote:there is no interference with cost estimation because there is a clear division - actions that generate costs and actions that don't
i'm afraid it's not that simple, as even commands that are guaranteed to never have a "cost" other than 0 use this part to return "command successful" vs. "command failed"

and then, while from a user perspective this may seem clear, the code internals do not have this distinction, and to add it might be a big architectural change. there can be nested commands, how do you handle the case where some parts of the commands are non-cost and the others are cost?
User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by adf88 »

Eddi wrote:code internals do not have this distinction
There is such a distinction - management vs construction commands. CMDT_LANDSCAPE_CONSTRUCTION and CMDT_VEHICLE_CONSTRUCTION are commands that can cost. Other commands don't. This distinction is clear at booth sides - from user's experience point of view and the code.
:] don't worry, be happy and checkout my patches
Eagle_rainbow
Engineer
Engineer
Posts: 59
Joined: 13 Oct 2012 20:27
Location: Germany

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Eagle_rainbow »

planetmaker wrote:Let me go on a slight tangent here
[...]
So the most complicated task on this tangent is: design a good UI which makes all elements clear and accessible. No need to be shy about introducing additional or redrawn GUI buttons :-)
In this aspect I do not agree with your opinion: You are right that the current UI for defining a time schedule is quite casual. But even if I had the world's best user interface for editing time schedules of vehicles, I still wanted to be able to create a new time schedule by just clicking where the train/bus/... should go to - modulo some modifier keys to describe how it should behave there. By that it's fast and you spare the user to have another click somewhere. Yes, you might be right, if you argue that this interaction is something you have to explain - but as already said initially: this feature is nothing that a novice player will typically start with. As long as a clickable path is also available, which the novice player can learn on, I would not see an argument against it. Otherwise, we would have to ban hotkeys altogether. Thus, for me this approach is miles ahead compared to UI approaches of many other games. So, I would hope that this UI paradigm does not change.
In many OTTD online multplayer rounds the time for building up a transportation route is the critical factor for success. Editing happens much more seldom to me than creating.
In short, for me these two tasks are quite disjoint - at least what the handling of the input devices is concerned.
Besides that you are right: the vehicle's order screen may benefit from an overhaul - especially in regards to the buttons at the bottom.
Cheers,
Eagle_Rainbow

My Wiki Home (incl. overview of patches)
3298
Traffic Manager
Traffic Manager
Posts: 143
Joined: 02 Apr 2011 12:55

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by 3298 »

Just throwing out ideas: What if the order modifier buttons at the bottom would change their behavior if the goto button is pushed and the player is supposed to choose the destination - what if they affected the newly created order instead of an already existing one? So something like this would be possible: Player opens the order window of a new vehicle (and clicks goto if fast order creation is off) - player clicks full load - player clicks source station (inserts full load order at the source station) - player clicks transfer - player clicks hub station (inserts transfer order at the hub station). That would be quite close to the hotkey solution, especially because the order modifiers already have hotkeys.
And yes, I'm willing to write that as a patch if somebody is interested.
Edit: Oh crap, the depot orders make this more difficult because the modifier buttons change depending on the type of the currently selected order (not bad per se because not all modifiers make sense on all order types; you probably don't want full load at a depot or service at a waypoint), and if you choose the modifiers before clicking on the destination, you need to have all modifiers available, discarding the invalid ones on destination selection.
Eagle_rainbow
Engineer
Engineer
Posts: 59
Joined: 13 Oct 2012 20:27
Location: Germany

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Eagle_rainbow »

3298 wrote:Just throwing out ideas: What if the order modifier buttons at the bottom would change their behavior if the goto button is pushed and the player is supposed to choose the destination - what if they affected the newly created order instead of an already existing one? [...]
And yes, I'm willing to write that as a patch if somebody is interested.
Not a bad idea. Combined with the hotkeys it would also suite my requirements above.
The only thing that comes up to my mind is the question what happens if you are inserting a new order before an existing one. Say, you have order 1 and 2. You select order 2, as you want to insert a new order between them. You then click on "go to" (let's leave out the discussion of "fast order creation" yet) and "full load" afterwards. What is the semantics now? Is it "full load to order 2" (current state of implementation) or "full load to the new order to come"? To remain consistent IMHO the second variant should be the case.
If you intend to implement it that way, I would give it a try and play around with that a bit. Sounds to me like a chance for a good compromise...
Cheers,
Eagle_Rainbow

My Wiki Home (incl. overview of patches)
Eagle_rainbow
Engineer
Engineer
Posts: 59
Joined: 13 Oct 2012 20:27
Location: Germany

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Eagle_rainbow »

Alternative idea, which just comes to my mind: Having clicked "go to" and selecting a new order's station, the order is not inserted immediately. Instead, a context menu pops up at the cursor position of the target station where I can select my order modifiers, like "full load" or "transfer". A variant of this approach could be that simple clicking just adds the order without loading/unloading specialties, whilst holding down CTRL when clicking on the station triggers the context menu. This still would require another click (which I want to avoid basically :roll: ), but at least it would prevent long ways for the mouse cursor (as the buttons do today). In an extended form, the entries in the context menu could also react on the hotkeys defined for the (un)loading options of the order menu (which then would avoid my click altogether again ;) )

What do you think about that?
Edit: That would also solve 3298's problem of not knowing if you will click on a depot (the menu items could be suppressed/altered depending on the context).
Cheers,
Eagle_Rainbow

My Wiki Home (incl. overview of patches)
3298
Traffic Manager
Traffic Manager
Posts: 143
Joined: 02 Apr 2011 12:55

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by 3298 »

In my opinion the popup (I assume you mean a popup like the bridge one) is bad. adf88 expressed his concerns about that one already a few posts before, I don't need to repeat that.
Eagle_rainbow wrote:(let's leave out the discussion of "fast order creation" yet)
If I remember correctly, the fast goto order creation is simply the automatic selection of the goto tool when an order window with less than two orders is opened (or something similar). So we don't need to worry about it.
Eagle_rainbow wrote:The only thing that comes up to my mind is the question what happens if you are inserting a new order before an existing one. Say, you have order 1 and 2. You select order 2, as you want to insert a new order between them. You then click on "go to" and "full load" afterwards. What is the semantics now? Is it "full load to order 2" (current state of implementation) or "full load to the new order to come"? To remain consistent IMHO the second variant should be the case.
Yes, I meant your second option to keep it consistent within itself - modify the selected order if the goto tool is inactive, select modifiers for the new order if it's active.
The only part I'm worried about is the station/waypoint modifiers vs. depot modifiers thing. All the options need to be available if the goto tool is selected. I could squeeze all of them in one row (makes the window a lot wider), I could show both rows (which introduces another row of buttons - I don't want it to appear out of nowhere when the goto tool is activated, but showing both rows all the time adds a row which is permanently grayed out when tweaking existing orders...), I could merge the dropdowns from both rows into one row (by putting the two sets of modifiers occupying the same place in the existing rows into a common dropdown). None of these make me happy, so I don't know what to do.
Eagle_rainbow
Engineer
Engineer
Posts: 59
Joined: 13 Oct 2012 20:27
Location: Germany

Re: [patch] "transfer" with shift, "go via" with ctrl+shift

Post by Eagle_rainbow »

3298 wrote:The only part I'm worried about is the station/waypoint modifiers vs. depot modifiers thing. [...] None of these make me happy, so I don't know what to do.
I am totally with you: I also do not like to see such a huge list of buttons of which half of them don't make sense in my current game situation. And as long as we don't know where the new order should go to, I do not see much of a chance to restrict the set of choices to present to the user. Assuming that it will be just a station by default (as this would be the 80% case most likely, ignoring all the other possibilities) and "dealing with the problem afterwards", if it is the unlikely case you have selected a depot, does not sound to be a smooth idea either (it feels half-baked). That was also one of the reasons why I started struggling with the approach a bit and came back to the context menu/popup idea.
3298 wrote:In my opinion the popup (I assume you mean a popup like the bridge one) is bad. adf88 expressed his concerns about that one already a few posts before, I don't need to repeat that.
Yes, that is quite close to what I meant. However, besides the judgement that it is "wired" (by adf88), which I underline, if used with a "long click" (sounds very "tabloid"ish to me :) ), I have not heard your arguments yet why you think that way. Especially in regards that the popup/context menu is already known to the player (for selecting the bridge type for example) and combining it with the CTRL modifier key to enable it at all, I slowly start feeling comfortable with the idea again (though not being convinced altogether yet). Moreover, this paradigm is also known to the experienced user - see what happens if you want build a station directly next to another one, but it should not be a joint one. Whilst it also solves our question on which type of object the user has already clicked, the selection is not that far away from the pointer of the mouse. Also from other programs you may see such a UI paradigm, for example if you are asked to specify how you want to paste your copied data ("only text", "with formatting", ...).
Could you put a bit beef around it, why both of you dislike the approach?
Cheers,
Eagle_Rainbow

My Wiki Home (incl. overview of patches)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest