* Addresses #478, adding a heading class to represent headings and angles
Removed some unused code
* Fixing bad merge
* Formatting
* Fixing type issues and other merge resolution misses
It's rare with the current 5NM buffer around the origin, but if we use
the hold distance as the buffer like we maybe should it's possible for
the preferred join locations to fall entirely within the home zone. In
that case, fall back to a location within the max-turn-zone that's
outside the home zone and is nearest the IP.
Test cases:
1. Target is not threatened.
The IP should be placed on a direct heading from the origin to the
target at the max ingress distance, or very near the origin airfield
if the airfield is closer to the target than the IP distance.
2. Unthreatened home zone, max IP between origin and target, safe
locations available for IP.
The IP should be placed in LAR at the closest point to home.
3. Unthreatened home zone, origin within LAR, safe locations available
for IP.
The IP should be placed near the origin airfield to prevent
backtracking more than needed.
4. Unthreatened home zone, origin entirely nearer the target than LAR,
safe locations available for IP.
The IP should be placed in LAR as close as possible to the origin.
5. Threatened home zone, safe locations available for IP.
The IP should be placed in LAR as close as possible to the origin.
6. No safe IP.
The IP should be placed in LAR at the point nearest the threat
boundary.
This places the split point based on the best path from the IP to home,
rather than the best path from home to the target. The outcome is that
the planner might choose an alternate route out of a threatened area
based on the safest escape from the IP, which is where the aircraft
should be when it releases its weapons, rather than at the target.
That's of course not always perfect since the IP distance is not based
on the carried weapon, but it's a better choice when it matters more
(when carrying standoff weapons attacking a more dangerous target).
Try all the nav points between the origin and the target rather than
just the first non-threatened point. This prevents us from using the
fallback behavior for any target that's sufficiently far from the
package airfield.
This is as much as we can do until pydcs actually adds the py.typed
file. Once that's added there are a few ugly monkey patching corners
that will just need `# type: ignore` for now, but we can't pre-add those
since we have mypy warning us about superfluous ignore comments.
The loadout case actually could (and previously did) hide bugs from the
type checker, since mypy was smart enough to see that we were removing
None from the input it assumed that the member was non-optional, but
later modifications could cause null values, and since those came from
the UI mypy couldn't reason about this. This meant that mypy assumed the
type could not be optional and wouldn't check that case.
This Pull Request lets users plan Tanker flights.
Features:
- Introduction of `Refueling` flight type.
- Tankers can be purchased at airbases and carriers.
- Tankers get planned by AI.
- Tankers are planned from airbases and at aircraft carriers.
- Tankers aim to be at high, fast, and 70 miles from the nearest threat.
(A10s won't be able to tank)
- Tankers racetrack orbit for one hour.
- Optional Tickbox to enable legacy tankers.
- S-3B Tanker added to factions.
- KC-130 MPRS added to factions.
- Kneeboard shows planned tankers, their tacans, and radios.
Limitations:
- AI doesn't know whether to plan probe and drogue or boom refueling
tankers.
- User can't choose tanker speed. Heavily loaded aircraft may have
trouble.
- User can't choose tanker altitude. A-10s will not make it to high
altitude.
Problems:
- Tanker callsigns do not increment, see attached image. (Investigated:
Need to use `FlyingType.callsign_dict`, instead of just
`FlyingType.callsign`. This seems like it might be significant work
to do.).
- Having a flight of two or more tankers only spawns one tanker.
- Let me know if you have a solution, or feel free to commit one.
https://user-images.githubusercontent.com/74509817/120909602-d7bc3680-c633-11eb-80d7-eccd4e095770.png
The usual symptom here was the game breaking when a carrier is
destroyed. The carrier would no longer be operational but missions would
be assigned there that could not generate flight plans.
We shouldn't consider the non-escorted parts of the flight path when
checking for threats to determine if escorts should be used or not,
since escorts can't help in those areas anyway. This was causing escorts
to be overly requested since the bullseye is now a part of the
"flight plan", but could have also triggered for divert waypoints, or
for aircraft taking off in a retreat from a threatened location.
A was intended to be the blue point and B was intended to be the red
point. Make this a part of the name so that's clear, and clean up
related code to keep that reliable.
UI isn't finished. Bulk transfers where the player doesn't care what
aircraft get used work (though they're chosen with no thought at all),
but being able to plan your own airlift flight isn't here yet.
Cargo planes are not implemented yet.
No way to view the cargo of a flight (will come with the cargo flight
planning UI).
The airlift flight/package creation should probably be moved out of the
UI and into the game code.
AI doesn't use these yet.
https://github.com/Khopa/dcs_liberation/issues/825
The previous flight plan only makes sense if the convoy will make it a
significant distance from its starting point. At road speeds over the
typical mission duration this is not true, so we can actually plan this
as if it was a strike mission near the origin point and that's close
enough.
There's some cleanup work to do here that I've added todos for.
Fixes https://github.com/Khopa/dcs_liberation/issues/996
This currently is only supported for player flights. I have no idea how
to create an AI flight plan that won't just get them killed. AI-only BAI
missions against supply routes will warn the player on mission creation.
The tradeoff is that any flights that might have previously routed
_around_ a threat near the edge of the map may no longer do so as the
zones at the edge are significantly larger now.
Fixes https://github.com/Khopa/dcs_liberation/issues/903
Still a work in progress (the missions don't actually perform their task, just orbit). Currently:
* AEW&C aircraft can be bought.
* AEW&C missions can be planned at any control point and at front lines.
* AEW&C will return after 4H or Bingo.