Author Topic: [DONE][Suggestion] display craft's estimated flight time (ETA)  (Read 2394 times)

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
[DONE][Suggestion] display craft's estimated flight time (ETA)
« on: January 02, 2024, 10:47:29 am »
It would be very useful to display the estimated flight time of crafts somehow, especially in mods which have slow crafts and missions with despawn timers counted in hours or days (and missions which despawn even if targeted).

This would make it easier to try to figure out if the craft will get there in time. (You can return to base immediately if you're not happy with the result.) This might also help if you're trying to figure out whether it's day or night on the other side of the globe when you arrive there, depending on which you prefer for the mission.

While the speed of craft is not linear due to different values of craft acceleration, for simplicity the estimate could ignore the acceleration and be based on a simpler linear calculation t=s/v (remaining distance over maximum velocity). Especially for missions where this would be most useful this would be a very good estimate.

Without bigger changes to GUI I don't see an easy way to display this information when you're selecting the destination, so I'm not proposing that - but rather an easy way to check it afterwards. So, I have two specific suggestions where to place this information.

1) in craft interception overview.  Where it now says "EN ROUTE", there's some space to add a few bits of information. This could say for example "EN ROUTE (13.7 h)". I would propose using only the hours here, and the accuracy of 0.1 or 1 hour (how it's rounded up/down doesn't really matter). I suppose the estimate is close enough so that you don't need a "~" there. Omit brackets and use just hours without decimals if you need to conserve space. So the most minimal way to display this information would be, for example, "EN ROUTE 2h".

2) in craft destination details. Where it now says "STATUS>(...)", if the craft has a destination, add a row below saying "ARRIVAL IN: 13.7 h.", with yellow and indented to the same level as DESTINATION. If you want, this could also show days, hours and minutes instead of just showing it in hours. ("ARRIVAL" or some other term instead of "FLIGHT TIME" to use a neutral term that applies to all kinds of craft.)

Instead of a new row, it might be possible to add the information at the end of the destination string like in 1), but this might lead to problems if the destination string is long. And because there is lot of free space in this dialog, I'd propose adding a more detailed information as a separate row.
« Last Edit: January 02, 2024, 10:52:35 am by psavola »

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: [Suggestion] display craft's estimated flight time
« Reply #1 on: January 02, 2024, 11:00:21 am »
Without bigger changes to GUI I don't see an easy way to display this information when you're selecting the destination...
Why not something like this? Cydonia-capable craft can have that window elongated a bit, and the vast majority of the time this won't come up.

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: [Suggestion] display craft's estimated flight time
« Reply #2 on: January 02, 2024, 11:05:25 am »
If I understood you correctly, that would require that the calculation updates all the time you move the mouse cursor (before you click anything) or that the ETA would appear in a strange place once you have clicked. The former seems difficult and unwieldy to implement, the latter unintuitive from GUI perspective.

On the other hand, after clicking you get "TARGET: Syndicate Lab" (OK or Cancel) or "TARGET: WAY POINT" dialog box. I suppose you could as 3) also add information there in either form as proposed in 1) or 2).

In the distance calculations, per Juku121's post above, I suppose you need to special-case cydonia-type missions which have no real on-globe destination or flight time. Because such missions get triggered immediately, this should not be a problem - just make sure the game doesn't crash.
« Last Edit: January 02, 2024, 11:28:58 am by psavola »

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: [Suggestion] display craft's estimated flight time
« Reply #3 on: January 02, 2024, 12:03:57 pm »
If I understood you correctly, that would require that the calculation updates all the time you move the mouse cursor (before you click anything) or that the ETA would appear in a strange place once you have clicked. The former seems difficult and unwieldy to implement, the latter unintuitive from GUI perspective.
How so? I mean, I can see it being a bit computation-intensive, similar to the abandoned 'predict UFO trajectory' option, but this time it's not in real-time. But it would be so much easier to see how long it takes to get places if the tracker updated with every mouse movement (or a couple of mouse movements).

Otherwise, the difference between doing it once at the end and displaying the result somewhere vs calculating and displaying the result there is pretty much nil.

If the calculations are too much, maybe allow middle-clicking on a spot, marking it with a temporary waypoint and displaying the result as above? With perhaps an MMB-tooltip in the box before you click anything.
« Last Edit: January 02, 2024, 12:07:51 pm by Juku121 »

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: [Suggestion] display craft's estimated flight time
« Reply #4 on: January 02, 2024, 12:46:59 pm »
My proposal was intended to give easily access to this information without a need to implement new GUI functionality (rather just add text to existing boxes).

While constant updates might be a nice bonus, I don't see it as essential or even particularly useful. The player is not interested in wondering 'If my guys with a van have 30 hours to spare, how far can they travel in that time". The player is only interested how long it takes to a specific target, whether a mission site or some area to patrol.

So giving the information before clicking only saves you from pressing one "Cancel" button (if proposal 3 is implemented as well) if the player thinks the flight time is not good for the craft and needs to decide on another approach.

But I'll leave this up to Meridian.

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: [Suggestion] display craft's estimated flight time
« Reply #5 on: January 02, 2024, 06:08:54 pm »
I think it can easily be added to confirmation screen with cancel/ok buttons. This would eliminate problems with trying to squeeze this into the existing table.
And player can always click cancel and return to previous screen (interception, for example) if not happy with the time.

From the other hand, I never felt this is a vital information. After launching your crafts few time one can get pretty good feel at when it arrives to destination.

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: [Suggestion] display craft's estimated flight time
« Reply #6 on: January 02, 2024, 06:41:37 pm »
From the other hand, I never felt this is a vital information. After launching your crafts few time one can get pretty good feel at when it arrives to destination.

In vanilla this may be useful to estimate the time it takes to a landed ufo and what are the chances you get there in time. But the main benefit is those mods which have much slower transports, which can take even days to travel even half the globe - and mission sites despawn even if targeted. I suppose you haven't played those (e.g. X-Com Files).

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: [Suggestion] display craft's estimated flight time
« Reply #7 on: January 02, 2024, 06:53:41 pm »
Nope. Based on your description - yes, this could be a useful feature.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9088
    • View Profile
Re: [DONE][Suggestion] display craft's estimated flight time (ETA)
« Reply #8 on: January 03, 2024, 07:24:18 pm »
Added `oxceShowETAMode` into options.cfg.

oxceShowETAMode: 0 = disabled (default)
oxceShowETAMode: 1 = show ETA for stationary targets (waypoints, bases, alien bases, mission sites, crash/landing sites)
oxceShowETAMode: 2 = additionally show ETA also for moving targets (moving UFOs, moving craft, patrolling craft)

Time is rounded to whole hours, i.e. 1h is anywhere between 0.5h and 1.5h

https://github.com/MeridianOXC/OpenXcom/commit/653b3471a0426a89132a28f7c8af85d0997e09a7
https://github.com/MeridianOXC/OpenXcom/commit/da2fc0038faa63209edbd4f8f0b7f4b08922d459
« Last Edit: January 03, 2024, 07:43:01 pm by Meridian »

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: [DONE][Suggestion] display craft's estimated flight time (ETA)
« Reply #9 on: January 03, 2024, 07:37:59 pm »
What difference moving target make? Do you account for their movement as well?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9088
    • View Profile
Re: [DONE][Suggestion] display craft's estimated flight time (ETA)
« Reply #10 on: January 03, 2024, 07:43:43 pm »
What difference moving target make? Do you account for their movement as well?

No.

UFO movement is unpredictable.

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: [DONE][Suggestion] display craft's estimated flight time (ETA)
« Reply #11 on: January 03, 2024, 07:47:15 pm »
In this case why separate them? It's not like players who want to know the ETA would NOT want to know it for moving targets. Should be no harm for them.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9088
    • View Profile
Re: [DONE][Suggestion] display craft's estimated flight time (ETA)
« Reply #12 on: January 03, 2024, 07:51:39 pm »
In this case why separate them? It's not like players who want to know the ETA would NOT want to know it for moving targets. Should be no harm for them.

Exactly because the ETA value is not true for moving targets.

Why would I want to know that a UFO is "6 hours away" if it's quicker than me and I cannot ever catch it. Or if it's moving towards me and I will catch it much sooner. Or neither.
That's why some people (like me for example) would NOT want to know it for moving targets.
Your mileage may vary.

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: [DONE][Suggestion] display craft's estimated flight time (ETA)
« Reply #13 on: January 03, 2024, 08:40:15 pm »
Excellent. Thanks a lot.

I suppose ETA for moving targets could be useful in those mods and contexts where the enemy crafts are very slow, such as most times in the first two years of XCF. But I agree that in more usual settings it might be unnecessary or some might also consider undesirable.