Page 1 of 3

Patch: Fix "select bridge" dialog

Posted: 03 May 2007 04:24
by benc
For me, one of TT's minor annoyances has always been the number of unnecessary clicks involved in bridge building. The "select bridge" dialog only shows 4 bridges at a time, and the faster types are at the bottom.

EDIT: Lots of ideas for fixing this annoyance have been tossed around, several of which I've made patches for. The one I think would work the best is this one... what do you think?

----

I don't know about you, but I always (always!) build the fastest type, and so I have to scroll down in the dialog every single time.

This first patch allows users to skip the "select bridge" dialog entirely. As soon as the initial click-and-drag is complete, the fastest available bridge type is automatically chosen and built.

Shift-drag shows a cost estimate.

Ctrl-drag reverts to the old behavior, showing the "select bridge" dialog. After all, wooden bridges do have a certain rustic charm... :) Alternately, the user can disable the patch entirely.

Thoughts? This is my first attempt at a patch. As a long-time TT addict and a programmer, I'd love to start contributing to the OpenTTD project.

Posted: 03 May 2007 05:18
by l_Blue_l
i think a possible better solution would be to have it automatically scroll down to the last bridge you can afford. This removes some of the extra clicking while still giving you a choice (every time). It also would then not need to be a patch option then as i think we have enough of them already as it is.

Posted: 03 May 2007 05:35
by benc
Good points, thanks for the feedback. I agree, the sheer number of patch options is already overwhelming.

Actually, my first stab at the problem was to simply reverse the order of the bridge types in the dialog box. Here's that patch, too.

Posted: 03 May 2007 07:17
by chrissicom
I like that second patch to reverse the list, I will try it later today. I usually don't simply build the best bridge available but rather build realistic tracks and also use bridges which are necessary for my trains and not just the best offered by the game. I always play with the DB XL Set as well to get realistic trains.

Posted: 04 May 2007 07:18
by boekabart
I also think the reverse order patch is the best option; Another option would be a self-learning dialog that learns what bridge type is selected most often and puts that one on top. (this goes for vehicle buying dialogs too, by the way)

Posted: 04 May 2007 08:23
by sc79
Due to my grf list and play style (dont use maglev, and cantilever/girder bridges look better, so no use for tubular), Id much rather a simple patch where ctrl-drag would build the last-built bridge type again. Reversing the list doesnt do much for me, with the 3 tubular bridges at the end.
It also would then not need to be a patch option then as i think we have enough of them already as it is.
Not to start this arguement again, but Id rather have 10 times the configuration options (which can simply be a line in the config file, doesnt have to be part of the ingame list), than have patches added with the assumption that everyone will like the hard-coded design. And since you need to atleast have an on/off option, you could (fairly easily im assuming) make it an On -> behavior1 -> behavior2 -> etc setup.

Posted: 08 May 2007 22:11
by benc
Thanks again for all the feedback. It looks like everyone agrees that the "select bridge" dialog is an annoyance in its current form. I'd really like to see it fixed. Here's my current take:

Option 1: No dialog, just build the fastest bridge type
My initial idea, not really suitable. Due to different playing styles and GRFs, fastest != best.

Option 2: Simply reverse the list of bridge types
I don't really like this because it needlessly breaks symmetry. In the "build train" dialog, cheaper and slower engines are generally listed first.

Option 3: Make the dialog larger to eliminate scrolling
Not suggested yet, but I'm not keen on it anyway. There are currently 13 bridge types, which would make for an unwieldy dialog.

Option 4: A self-learning dialog that learns what bridge type is selected most often and puts that one on top (boekabart)
I like this idea a lot. Although I'd interpret "puts that one on top" to mean "automatically scroll there" instead of reordering everything. (Reordering everything would confuse the heck out me, I think.) I'll see if I can't put together a patch to play around with.

Posted: 08 May 2007 22:52
by DSHammer
Thats a great idea, I also tend to always build the fastest bridge.

It would be even better, imo, to balance bridge prices to the degree that there exists a real trade off between bridges. Maybe even introduce different maintenance costs as additional statistics.

Posted: 08 May 2007 23:06
by fabca2
and

Option 5 : keep list as it is, but open the list automatically scrolled down.
it does not have disadvantage of option 1 and 2 (and 3 with a long list).
and the goal is reached (to need to scroll down for most of time).

Posted: 09 May 2007 04:37
by Zojj
Don't forget that bridges have hotkeys. Press 9 to build tubular steel. The fastest bridge doesn't have a key tho... fix that too in your patch!

Posted: 09 May 2007 08:12
by hertogjan
Zojj wrote:Don't forget that bridges have hotkeys. Press 9 to build tubular steel. The fastest bridge doesn't have a key tho... fix that too in your patch!
Why not make a hotkey for the fastest bridge available*? For instance, '0'.


*The actual type may differ depending on the current year and the length of the bridge.

Posted: 09 May 2007 08:21
by boekabart
Zojj wrote:Don't forget that bridges have hotkeys. Press 9 to build tubular steel. The fastest bridge doesn't have a key tho... fix that too in your patch!
How does that work with newGrf, how do they get shortcut keys assigned?

Anyway, I think self-learning would be the most flexible approach.. but if you use more than 1 bridge type often, it'd be better if the list would just group the most recently used bridges on top (no scrolling, but sorting).

By the by, I use the best looking bridges always (never cantilever), not the fastest.... unless it matters on the specific location/time.

Posted: 11 May 2007 22:30
by benc
fabca2 wrote:Option 5 : keep list as it is, but open the list automatically scrolled down.
Actually, that's what I mean by option 4. :)

I've written a such a patch (attached), and it works as advertised:

Whenever you build a bridge, TTD takes note. Next time you pull up the dialog, it will scroll down so your "favorite" bridge is as close to the top as possible.

It's not quite as simple as remembering the last bridge type built... not all bridge types can be built all the time. See the comments in the patch for details if you're interested.

Your preferences are remembered separately for road and each rail type. The settings aren't saved in openttd.cfg, yet. (Too much work for a proof-of-concept.)

Posted: 11 May 2007 22:34
by benc
benc wrote:Option 3: Make the dialog larger to eliminate scrolling
I've also created a patch (attached) for this, and actually I think it works pretty well. Using this patch, the "select bridge" dialog is automatically resized according to how many bridge types are available. No scroll bars, ever.

Worst case, the dialog is 10 long... see screenshot.

Posted: 12 May 2007 14:28
by Red.xiii
benc wrote:
benc wrote:Option 3: Make the dialog larger to eliminate scrolling
I've also created a patch (attached) for this, and actually I think it works pretty well. Using this patch, the "select bridge" dialog is automatically resized according to how many bridge types are available. No scroll bars, ever.

Worst case, the dialog is 10 long... see screenshot.
Yes!!! Just what i've been after. Go talk to the dev's to get it included in the trunk :)

Any chance you could do something about the UI for building newgrf stations?

Posted: 13 May 2007 10:31
by skidd13
I like the ideas, but a more dynamic thing would be nice. Have a look at vehicle_gui.cpp.
I attached a mockup of my thoughts.
Sort options could be:
- initial date
- price
- max. speed
- name
- personal preference
- optimal (bridge speed ~ vehicle-types max speed)

Posted: 14 May 2007 10:30
by nzhook
I have a tendancy at the start to go for a bridge that will do the job for the next few years (for money reasons) but after I have increased my cash flow quite a bit I will normally choose the fastest.

Heres my thoughts just to make things a little harder,
Treat the bridge dialog likes the plant tress one, it displays first (before any building) and the user selects the bridge they will place. Then all bridge building during activation will use the selected bridge. The user can change the brige using the dialog (which will still be open).
The default option which is selected when changing to bridge mode is the last used bridge, hence you dont need to bother with the dialog if you want to place the same bridge. (im not sure if the plant tress option does this bit, but it would be good)

Posted: 14 May 2007 12:12
by DeletedUser21
nzhook wrote:I have a tendancy at the start to go for a bridge that will do the job for the next few years (for money reasons) but after I have increased my cash flow quite a bit I will normally choose the fastest.

Heres my thoughts just to make things a little harder,
Treat the bridge dialog likes the plant tress one, it displays first (before any building) and the user selects the bridge they will place. Then all bridge building during activation will use the selected bridge. The user can change the brige using the dialog (which will still be open).
The default option which is selected when changing to bridge mode is the last used bridge, hence you dont need to bother with the dialog if you want to place the same bridge. (im not sure if the plant tress option does this bit, but it would be good)
That is a very good idea! It also solves my problem of having to replace every cantilever bridge for new tubular ones one at the time. :D

(In being the same as in tree window, I also would like the button 'place random bridges' in the map editor. :mrgreen: )

Posted: 14 May 2007 22:11
by benc
skidd13 wrote:I like the ideas, but a more dynamic thing would be nice. Have a look at vehicle_gui.cpp.
I attached a mockup of my thoughts.
I love the enhanced vehicles dialog; it's indispensable for managing hundreds of trains. But consider that MAX_BRIDGES == 13. IMHO, a resizeable, multi-sortable bridge dialog is overkill for such a small set of choices.
nzhook wrote:Treat the bridge dialog likes the plant tress one, it displays first (before any building) and the user selects the bridge they will place. Then all bridge building during activation will use the selected bridge.
Because different bridge types have different length requirements, I don't think it's really feasible to change the dialog like that. For example, what happens when the user has selected tubular silicon and then they try to build a bridge of length 1?

Posted: 15 May 2007 01:05
by Antropod
May be just reserve first slot in bridges list for last used bridge?

i.e.:

Code: Select all

[Wooden] <- Last used ( default )
[Wooden]
[Girder steel]
[Suspension Concrete]
[Suspension Steel]
[...]
when I select [Suspension Steel]:

Code: Select all

[Suspension Steel] <- Last used ( after selection )
[Wooden]
[Girder steel]
[Suspension Concrete]
[Suspension Steel]
[...]
and so on...