Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Conditional Orders and Aircraft Ranges work more clearly #5409

Closed
DorpsGek opened this issue Dec 26, 2012 · 4 comments
Closed

Make Conditional Orders and Aircraft Ranges work more clearly #5409

DorpsGek opened this issue Dec 26, 2012 · 4 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Eagle_rainbow opened the ticket and wrote:

Motivated by #5401 I had a closer look at aircraft ranges in combination with conditional orders. Making use of the patch available there, you also get to see the ranges which the system "thinks" to have for each order (as requested).
I have now created a edge-case situation to test the algorithm.
Find attached a screenshot plus a corresponding savegame for you to analyze.

Situation there is as follows:

* There are three airfields: A, B, C (located west to east on the map)
* d(A,B) = 146 tiles
* d(B,C) = 53 tiles
* d(A,C) = 193.7 tiles (e.g. out of range)
* The range of the aircraft is 192 tiles

The order list is as follows:

  1. goto A
  2. goto B
  3. if load >= 50%, jump to 1
  4. goto C
  5. if load >= 50%, jump to 1
  6. goto B
  7. jump to 1

Distances from the order list algorithm are reported as follows:
1: 146 tiles
2: 146 tiles
3: (not reported)
4: out of range
5: (not reported)
6: 146 tiles

Looking at the the order list closer, you'll get to the following distances that may occur:
1->2 takes 146 tiles
2->3 takes none
3->1 (sic!) takes 146 tiles
3->4 takes 53 tiles
4->5 takes none
5->1 (sic!) takes 193 tiles (i.e. it is out of range)
5->6 takes 53 tiles
6->7 takes none
7->1 takes 146 tiles

If you "unroll" this knowledge and condense it to showing the distances based on the second pair of a transition (which seems to be the intention based on looking at the code), I would get to the following distances per order manually:

1: max(146, 193) = 193 (reported to be out of range)
2: max(146, 146) = 146
3: none
4: 53
5: none
6: 53
7: none

Furthermore, if you exchange order no. 6 with "goto A" (which does not make sense business-wise, I know), then you'll get a reported distance of "0 tiles" (!). Apparently, the order list distance algorithm "thinks" that the plane is located at A!

I think that algorithm needs another round :'-(

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5409
@DorpsGek
Copy link
Member Author

Eagle_rainbow wrote:

The major difference between the current implementation and my calculus above is the fact, that the implementation is "forward-looking" (e.g. for a given order n, it tries to look at the orders n+1, n+2, ..., n+m to determine what will be the distances for the upcoming orders), whilst my variant is "backward-looking" (e.g for a given order n, it tries to find out which distances need to be flown to get to this order). As such, both approaches appear to me being valid.

Here's how the logic currently (r24869) works in the case above:
1: lookup order 2 - find B; calculate d(A,B) = 146 tiles
2: lookup order 3 - find conditional, look both at order 1 and order 3; calculate max(d(B,A), d(B, C)) = max(146, 53) = 146 tiles
3: no "goto order" - no distance calculated
4: lookup order 5 - find conditional, look both at order 1 and order 5; calculate max(d(C,B), d(C, A)) = max(53, 193) = 193 tiles (i. e. out of range)
5: no "goto order" - no distance calculated
6: lookup order 7 - find conditional; look both at order 1 and order 1; calculate max(d(B,A), d(B, A)) = max(146, 146) = 146 tiles
7: no "goto order" - no distance calculated

This also solves my statement

"Apparently, the order list distance algorithm "thinks" that the plane is located at A!"

before: It does not think that plane is at A, but it detects that if you exchange order 6 with A, that it has to fly to A, which is the same airport.

I looked up the manual in the wiki; there is nothing said about this feature yet. So at least, we should enhance the documentation on how ranges are calculated and how the distance values shown (or at least the statement "out of range") are being calculated. Otherwise others might also fall into the same pit and will not know how to fix a complex order list which says "out of range" somewhere.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5409#comment11823

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 3, 2013

Rubidium wrote:

What is exactly wrong here? It says that the "next destination is out of range", for exactly the order where the next destination would be out of range.

With backward looking you only make things more complex for the end user because with those conditional orders you could "arrive" at the goto from dozens of locations, whereas with forward looking you leave from one goto order and you could follow the conditional orders.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5409#comment11960

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 5, 2013

Eagle_rainbow wrote:

Yes, you are totally right.
The problem for me was that the UI does not state what "out of range" means. I understood that my order list does not work, but I was not able to understand how to fix it :) Also looking at the wiki manual did not help me either.

So, in short words:
* No, my backward looking approach is not a good idea and the current algorithm should not be changed.
* On the other hand, no, I do not like the current way of presenting the information :) it's "out of range" for order X - but that is not enough for me, as it does not state which order Y is causing it.
* As I do not have a magnificant idea how to improve the screen short-term, my request (partly also to myself :) ) would be to add some words in the wiki manual describing how the algorithm works. Ideally, it would also give some hints on how to determine which destination is causing the "out of range" message. The idea would be to enable the player to fix his order list on his own.

Sorry to leave this ticket in quite an unclear state before, but for the last couple of weeks I did not find time neither to work on OTTD topics nor to update this comment :-| Hope this will become better soon...


This comment was imported from FlySpray: https://bugs.openttd.org/task/5409#comment11972

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Won't implement

Flyspray clean up: nearly 5 years old, and not obvious what should be done with this next, so closing. If this offends, discuss with andythenorth in irc. Thanks.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5409

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant