Patch: Fix "select bridge" dialog

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
benc
Engineer
Engineer
Posts: 62
Joined: 30 Apr 2007 01:57

Patch: Fix "select bridge" dialog

Post 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.
Attachments
bridge_build_fastest.diff
(5.03 KiB) Downloaded 386 times
Last edited by benc on 11 May 2007 22:43, edited 2 times in total.
l_Blue_l
Transport Coordinator
Transport Coordinator
Posts: 285
Joined: 29 Mar 2006 22:42
Contact:

Post 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.
User avatar
benc
Engineer
Engineer
Posts: 62
Joined: 30 Apr 2007 01:57

Post 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.
Attachments
bridge_type_reverse.diff
(739 Bytes) Downloaded 342 times
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post 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.
boekabart
Transport Coordinator
Transport Coordinator
Posts: 333
Joined: 25 Aug 2005 09:44
Location: Eindhoven, Netherlands

Post 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)
sc79
Director
Director
Posts: 586
Joined: 22 Feb 2005 09:51

Post 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.
User avatar
benc
Engineer
Engineer
Posts: 62
Joined: 30 Apr 2007 01:57

Post 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.
DSHammer
Engineer
Engineer
Posts: 3
Joined: 03 May 2007 14:30

Post 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.
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Post 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).
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post 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!
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post 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.
boekabart
Transport Coordinator
Transport Coordinator
Posts: 333
Joined: 25 Aug 2005 09:44
Location: Eindhoven, Netherlands

Post 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.
User avatar
benc
Engineer
Engineer
Posts: 62
Joined: 30 Apr 2007 01:57

Post 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.)
Attachments
bridge_type_learn.diff
(4.4 KiB) Downloaded 307 times
User avatar
benc
Engineer
Engineer
Posts: 62
Joined: 30 Apr 2007 01:57

Post 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.
Attachments
bridge_longest_dialog.png
bridge_longest_dialog.png (39.18 KiB) Viewed 16078 times
bridge_resize_dialog.diff
(3.84 KiB) Downloaded 349 times
Red.xiii
Engineer
Engineer
Posts: 93
Joined: 11 Jan 2005 13:33

Post 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?
Image
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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)
Attachments
mockup.png
mockup.png (61.71 KiB) Viewed 15830 times
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
nzhook
Engineer
Engineer
Posts: 115
Joined: 02 Jul 2004 13:15
Location: NZ
Contact:

Post 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)
DeletedUser21
Tycoon
Tycoon
Posts: 11501
Joined: 20 Sep 2004 22:45

Post 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: )
User avatar
benc
Engineer
Engineer
Posts: 62
Joined: 30 Apr 2007 01:57

Post 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?
Antropod
Engineer
Engineer
Posts: 1
Joined: 14 May 2007 20:38

Post 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...
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests