115 Commits

Author SHA1 Message Date
Dan Albert
132ba905c7 Generalize commit range display for all patrols.
Fixes https://github.com/Khopa/dcs_liberation/issues/890
2021-04-22 17:55:14 -07:00
Dan Albert
6cffc47f3c Clean up convoy code. 2021-04-20 22:21:42 -07:00
Dan Albert
2b06d8a096 Convert front line segments to proper class.
Needed so we can add context menus to the lines.
2021-04-19 21:41:56 -07:00
Dan Albert
2a5b37b9ad Show convoys on the map. 2021-04-19 20:37:15 -07:00
Khopa
5bd4c00257 Merge branch 'develop_2_4_x' into develop
# Conflicts:
#	changelog.md
#	game/db.py
#	game/navmesh.py
#	game/operation/operation.py
#	game/theater/conflicttheater.py
#	game/theater/controlpoint.py
#	game/theater/start_generator.py
#	game/theater/theatergroundobject.py
#	game/threatzones.py
#	game/version.py
#	gen/aircraft.py
#	gen/airsupportgen.py
#	gen/fleet/carrier_group.py
#	gen/flights/ai_flight_planner.py
#	gen/flights/ai_flight_planner_db.py
#	gen/flights/flightplan.py
#	gen/flights/waypointbuilder.py
#	gen/groundobjectsgen.py
#	gen/kneeboard.py
#	pydcs
#	pydcs_extensions/f22a/f22a.py
#	qt_ui/uiconstants.py
#	qt_ui/widgets/combos/QAircraftTypeSelector.py
#	qt_ui/widgets/map/QLiberationMap.py
#	qt_ui/windows/QUnitInfoWindow.py
#	qt_ui/windows/mission/flight/payload/QPylonEditor.py
#	qt_ui/windows/settings/QSettingsWindow.py
2021-03-21 18:50:50 +01:00
Dan Albert
b2fafc22dd Fix flight path debugging. 2021-03-13 13:34:49 -08:00
Khopa
f314c08216 Improved map scale display 2021-02-27 00:29:23 +01:00
Khopa
523ef08697 Ran black reformater on 2.4x branch 2021-02-22 20:55:51 +01:00
Dan Albert
a47bef1f13 Blacken. 2021-02-12 20:10:45 -08:00
Simon Clark
6a0e18c0e9 Change the logic for culling missile sites.
Missile sites now generate a 2.5km culling circle around themselves, rather than using the standard full culling zone size.

Fixes #850.
2021-02-06 22:20:02 +00:00
Dan Albert
1a2475dc25 Add display option for BARCAP commit range. 2021-01-16 15:15:40 -08:00
Dan Albert
a6dc3d2aff Handle threat/detection per group.
Some SAMs have multiple groups (such as an SA-10 group with its
accompanying SA-15 and SA-19 groups). This shows each group's threat and
detection separately on the map, and also makes it so that an SA-10 with
dead radars will no longer contribute to the threat zone just because
the shilka next to it still has a functioning radar.

https://github.com/Khopa/dcs_liberation/issues/647
Fixes https://github.com/Khopa/dcs_liberation/issues/672
2020-12-26 15:52:36 -08:00
Dan Albert
17dd1b193e Remove aa_ranges in favor of using the TGO data. 2020-12-26 15:25:23 -08:00
Dan Albert
b9138acbc8 Use shapely projection instead of brute force.
Converts the landmap to use MultiPolygon instead of a collection of
polygons, since Shapely has explicit support for this.

Because we've done that, we can use a single projection from a line
instead of brute forcing the extent of the front line.

This makes turn processing ~66% faster (3 seconds to 1.8).

There are probably other places this should be used.
2020-12-24 01:20:15 -08:00
Dan Albert
8c1ebfda02 Show ASAP TOT for debug view flights. 2020-12-23 21:42:13 -08:00
Dan Albert
91d9bbdc97 Add visual debugging for other fligth plans. 2020-12-23 17:31:04 -08:00
Dan Albert
575f4e1786 Clean up debug display options. 2020-12-23 17:19:57 -08:00
Dan Albert
bff905fae5 Use navmeshes to improve TARCAP flight plans.
Started with TARCAP because they're simple, but will follow and extend
this to the other flight plans next.

This works by building navigation meshes (navmeshes) of the theater
based on the threat regions. A navmesh is created for each faction to
allow the unique pathing around each side's threats. Navmeshes are built
such that there are nav edges around threat zones to allow the planner
to pick waypoints that (slightly) route around threats before
approaching the target.

Using the navmesh, routes are found using A*. Performance appears
adequate, and could probably be improved with a cache if needed since
the small number of origin points means many flights will share portions
of their flight paths.

This adds a few visual debugging tools to the map. They're disabled by
default, but changing the local `debug` variable in `DisplayOptions` to
`True` will make them appear in the display options menu. These are:

* Display navmeshes (red and blue). Displaying either navmesh will draw
  each navmesh polygon on the map view and highlight the mesh that
  contains the cursor. Neighbors are indicated by a small yellow line
  pointing from the center of the polygon's edge/vertext that is shared
  with its neighbor toward the centroid of the zone.
* Shortest path from control point to mouse location. The first control
  point for the selected faction is arbitrarily selected, and the
  shortest path from that control point to the mouse cursor will be
  drawn on the map.
* TARCAP plan near mouse location. A TARCAP will be planned from the
  faction's first control point to the target nearest the mouse cursor.

https://github.com/Khopa/dcs_liberation/issues/292
2020-12-23 17:09:34 -08:00
Dan Albert
56d7993c8f Improve threat zone display options. 2020-12-22 13:57:05 -08:00
Dan Albert
86558bdef6 Add threat zone modeling.
Creates threat zones around airfields and non-trivial air defenses (it's
not worth dodging anything with a threat range under 3nm). These threat
zones can be used to aid mission planning and waypoint placement.

https://github.com/Khopa/dcs_liberation/issues/292
2020-12-22 13:12:04 -08:00
Dan Albert
2ac818dcdd Convert to new unit APIs, remove old APIs.
There are probably plenty of raw ints around that never used the old
conversion APIs, but we'll just need to fix those when we see them.

Fixes https://github.com/Khopa/dcs_liberation/issues/558
2020-12-19 22:08:57 -08:00
Dan Albert
113947b9f0 Add types for distance and speed.
Not converting all at once so I can prove the concept. After that we'll
want to cover all the cases where an int distance or speed is a part of
the save game (I've done one of them here with `Flight.alt`) so further
cleanups don't break save compat.

https://github.com/Khopa/dcs_liberation/issues/558
2020-12-19 21:07:55 -08:00
Khopa
feed55186f Migrated "polygon" code to shapely 2020-12-12 02:31:43 +01:00
Khopa
9d774eaad8 Fixed culling display distance. Allowed smaller distance for culling (useful for WW2 maps) 2020-12-11 22:39:09 +01:00
Dan Albert
f659dc1f76 Reference point rework.
* Introduce a real type.
* Rewrite _transform_point to make use of Point.
* Add shift modifier for large (10 pixel) adjustements to reference
  points. Unmodified behavior is now single pixel.
* Use WASD for moving the second point (shift modified numpad keys don't
  seem to work).
* Add a debug option to draw transformed reference points to check for
  errors. If they don't overlap, something is wrong.
* Cleaned up all the existing reference points. Caucasus in particular
  is now *much* better.

As an added bonus, the cleanup for carrier movement projection now also
shows an invalid destination when the destination is on land.
2020-12-10 21:08:38 -08:00
Khopa
8137d57cdf Dev : Improved Reference point setup mode, made it easier to setup point with polygon map appearing as transparent overlay, and displaying reference points on the map [Press Shift+R to toggle the mode]) 2020-12-11 00:08:08 +01:00
Khopa
1258f3e17c Carrier and Tarawa are now fully moveable 2020-12-10 00:13:34 +01:00
Khopa
c74e18e449 Target positions for ship movement are now properly projected on DCS game X,Y plane 2020-12-09 22:55:11 +01:00
Dan Albert
e0223ded54 Fix display of AA ranges for most ship types.
Fixes https://github.com/Khopa/dcs_liberation/issues/390
2020-12-06 14:22:33 -08:00
Khopa
72ac806cb8 Possible to plan ships movements on the map (UI only) 2020-12-03 01:01:15 +01:00
walterroach
4e12a1cdad Rework frontline vector
Ensures frontline stays outside of exclusion zones by adjusting its
position and width

Adds a DisplayOption for viewing the frontline vector on the map
2020-11-27 13:46:53 -06:00
Khopa
fcf45554ef Fixed culling display and added setting to include/exclude carriers from culling area. 2020-11-21 17:01:50 +01:00
Dan Albert
ae68a35a1a Remove save compat since it's breaking anyway.
Removal of old paths/names for things that no longer exist.
2020-11-20 17:06:01 -08:00
Dan Albert
a9fcfe60f4 Add arrival/divert airfield selection.
Breaks save compat because it adds new fields to `Flight` that have no
constant default. Removing all of our other save compat at the same
time.

Note that player flights with a divert point will have a nav point for
their actual landing point. This is because we place the divert point
last, and DCS won't let us have a land point anywhere but the final
waypoint. It would allow a LandingReFuAr point, but they're only
generated for player flights anyway so it doesn't really matter.

Fixes https://github.com/Khopa/dcs_liberation/issues/342
2020-11-20 16:16:00 -08:00
Dan Albert
8345063e84 Move theater into game. 2020-11-17 18:11:33 -08:00
walterroach
ecd073e31d typing and comment cleanup 2020-11-16 22:01:49 -06:00
walterroach
87afc2fcef bezier frontline display
Start on refactoring and cleanup of QLiberationMap.py
2020-11-15 22:08:30 -06:00
walterroach
33b92423d8 cleanup comments
remove unnecessary method call
2020-11-13 09:12:08 -06:00
walterroach
0b4e2d3b6b Merge branch 'develop' into new_frontline 2020-11-13 08:58:43 -06:00
Dan Albert
c4d08fa7b7 Fix handling of non-AA units in AA groups.
Some units in pydcs have detection_range and threat_range
defined, but explicitly set to None.
2020-11-13 02:57:51 -08:00
walterroach
33885e2216 initial multi segment frontline implementation 2020-11-12 21:47:13 -06:00
Dan Albert
a63bac8826 Don't display scud sites as SAM threat range. 2020-11-09 21:51:55 -08:00
Dan Albert
73998dbde0 Show EWRs as detection range, not threat range. 2020-11-08 19:03:47 -08:00
Dan Albert
e8feded4c3 Add EWR generation.
Fixes https://github.com/Khopa/dcs_liberation/issues/66
2020-11-07 16:20:58 -08:00
Dan Albert
ee113d080e Merge branch 'theater-refactor' into develop 2020-11-07 13:39:35 -08:00
Dan Albert
4cf406aefa Defer game load to after UI initialization.
This removes both the double load that happens on startup and also
makes it possible to get the UI to create a new game if the existing
default.liberation is not compatible.
2020-11-07 13:03:25 -08:00
Khopa
e0153cfa6a Added Freya EWR sites to WW2 german factions 2020-11-07 03:21:53 +01:00
Dan Albert
de3ba5908f Round waypoint TOTs in the UI. 2020-11-05 15:17:45 -08:00
Dan Albert
ab67a38ca5 Remove rounding from waypoint timing in the UI.
This is behaving strangely on some machines. Stop hiding the details
in the UI while we debug.
2020-11-01 01:42:58 -08:00
Dan Albert
88b9ed29ba Reorganize flight planning.
Previously we were trying to make every potential flight plan look
just like a strike mission's flight plan. This led to a lot of special
case behavior in several places that was causing us to misplan TOTs.

I've reorganized this such that there's now an explicit `FlightPlan`
class, and any specialized behavior is handled by the subclasses.

I've also taken the opportunity to alter the behavior of CAS and
front-line CAP missions. These no longer involve the usual formation
waypoints. Instead the CAP will aim to be on station at the time that
the CAS mission reaches its ingress point, and leave at its egress
time. Both flights fly directly to the point with a start time
configured for a rendezvous.

It might be worth adding hold points back to every flight plan just to
ensure that non-formation flights don't end up with a very low speed
enroute to the target if they perform ground ops quicker than
expected.
2020-10-31 19:29:24 -07:00