FS#5401 - Visualisation of aircraft range

Attached to Project: OpenTTD
Opened by David Dallaston (Pikka) - Saturday, 22 December 2012, 02:51 GMT
Last edited by andythenorth (andythenorth) - Friday, 18 August 2017, 21:28 GMT
Type Feature Request
Category Vehicles
Status Closed
Assigned To andythenorth (andythenorth)
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No


Several people have pointed out, quite rightly, that it's difficult to tell whether an airport will be within an aircraft's range. Could we perhaps have some sort of visualisation when giving aircraft orders, showing the range from the previous airport?

Possible methods:

1) a highlighted "circle" of tiles on the world showing the aircraft's maximum range from the previous order.
2) the distance from the previous order to the mouse pointer, shown above/beside/below the mouse pointer.
3) the distance from the previous order to the mouse pointer, shown in the "Go To" button (eg "Go To (134)").

Additionally, could the distance between orders be displayed in the order list? This would be a useful quick reference, if players want to replace an old aircraft with a new aircraft with a shorter range, as to whether the new aircraft's range is sufficient.


Go to A Airport (Full load any cargo) (85)
Go to B Airport (Full load any cargo) (85)

where "85" is the distance between the airports. I assume this range data is already collected, cached, and refreshed when appropriate, because the game is already capable of displaying "(next order out of range)" there.
This task depends upon

Closed by  andythenorth (andythenorth)
Friday, 18 August 2017, 21:28 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Mass closure of patch tickets with no commentary for >5 years. Goal is to reduce patch queue as an experiment to see if it aids faster reviewing and rejection/acceptance (it may not). If this offends you and the patch is maintained and compiles with current trunk, discuss with andythenorth in irc. (andythenorth has no ability to review patches but can re-open tickets).
Comment by Nico Schmoigl (Eagle_rainbow) - Tuesday, 25 December 2012, 21:20 GMT
I personally would not like to see option 1: My reasoning there is that ranges of aircrafts can be very large while your zoom level might be very narrow. You then cannot decide whether the position of the airport still is in range or not, because you need to scroll back and forth (or change the zoom level) to see "where the border of the range" is. Yet, I could imagine (once you are in "go to" mode) that all the tiles visible in the viewport are coloured in red/green transparently to indicate if it is (un)reachable. However, I am not a friend of such screens either as they are "just red" (for instance) all over the place. It will make scrolling and seeking for details much more complicated.
Option 2 sounds much better to me, whilst I (currently) wouldn't have an idea how to implement it (which should not mean anything, as I am quite a newbie :) )
Option 3 sounds quite artificial to me and I would wonder, if everyone understood immediately what was meant (well, if playing around a bit, you could learn such things very fast). Thus, I would take it as "second best" alternative.

Just my initial $0.02 on it...
Cheers, ER
Comment by Nico Schmoigl (Eagle_rainbow) - Tuesday, 25 December 2012, 23:14 GMT
Concerning your second request, I have tried to implement it with the attached patch. I also attached a screenshot how it looks afterwards.
@planetmaker: please consider it on some next commit ;)

Cheers, ER
PS@all: Feedback appreciated as usual...
Comment by Nico Schmoigl (Eagle_rainbow) - Tuesday, 25 December 2012, 23:47 GMT
improved version of the patch (feedback by michi_cc added on math->cmath with std namespace)
Comment by David Dallaston (Pikka) - Wednesday, 26 December 2012, 04:01 GMT
FWIW I agree with you that the second option is the preferable one. :)
Comment by frosch (frosch) - Wednesday, 26 December 2012, 11:52 GMT
Maybe the goto cursor could display the distance in a measurement tooltip similiar as for construction actions.
Comment by Ingo von Borstel (planetmaker) - Wednesday, 26 December 2012, 21:25 GMT
One thing to consider: how does it work with conditional orders:
1: Goto Airfield A
2: Goto Airfield B
3: if load_percentage > 50 goto order 1
4: Goto Airfield C
5: if load_percentage > 50 goto order 1
6: Goto Airfield D
7: goto order 4
Comment by Nico Schmoigl (Eagle_rainbow) - Wednesday, 26 December 2012, 21:36 GMT
@planetmaker: I hope this is already covered by the distance checking coding in order_gui.cpp:211 (function DrawOrderString()) resp. order_cmd.cpp:592 (function GetOrderDistance()). If not, we have a problem in any case. Showing it in a tooltip or not then should be the least problem :p (BTW: I am currently having a look how frosch's idea could be realized - to me it sounds easier than it really is :( )
But you are right in that sense that we really need to "emulate" the situation as if the order list had been extended already. I.e. in your case it makes a lot of a difference before/after which line you add a new goto order.

This then reveals the question *which* distance should be shown in the tooltip:
Consider that someone is editing pm's order list. Line 1 shall be selected, i.e. the user wants to add a new station (N) at the beginning of the list.
Which distance value should be shown in the tooltip now? The distance from D to N (because it's just the last station mentioned in the list, although that route will never be flown by the plane?)? Or from B to N (because it's the first station from where the plane could come back)? Why not the distance from C to N which could also occur?
Comment by Nico Schmoigl (Eagle_rainbow) - Wednesday, 26 December 2012, 22:36 GMT
we are in trouble :( - see  FS#5409 
Trouble is smaller than I thought: It's just hard to understand in such complex cases what is happening. => the algorithm for calculating the distance for a given order seems to be correct (according to specs).