1799 Commits

Author SHA1 Message Date
Dan Albert
61d7d5e041 Update minimum version of pyside2.
Fixes https://github.com/Khopa/dcs_liberation/issues/416
2021-01-01 15:50:01 -08:00
Dan Albert
b5278550e7 Retreat air units from captured bases.
If there are not airbases withing ferry range with available parking for
the aircraft then the aircraft will be captured and sold. Otherwise the
aircraft will retreat to the closest available airbase.

Fixes https://github.com/Khopa/dcs_liberation/issues/693
2021-01-01 15:19:16 -08:00
Dan Albert
461635c001 Note pending unit refund in changelog. 2021-01-01 14:46:51 -08:00
Dan Albert
fcb1d8e104 Retreat ground forces from captured bases.
If the captured base has no connection to other friendly objectives (the
base was encircled) then the enemy equipment will be captured and sold.
Otherwise the units will retreat toward connected bases.

Partial fix for https://github.com/Khopa/dcs_liberation/issues/693.
Still need to fix this for air units.
2021-01-01 14:45:43 -08:00
Dan Albert
6cbc2b707a Fix type of Game.budget.
This *is* a float, since the income multiplier is a float. The type
annotations were wrong.
2021-01-01 13:56:33 -08:00
Dan Albert
9671542bdf Decouple unit deliveries and conflict events.
Fixes https://github.com/Khopa/dcs_liberation/issues/692 and lets us
clean up the interface quite a bit.
2021-01-01 13:48:23 -08:00
Dan Albert
de325c1208 Refunding unfulfilled orders on capture.
Fixes https://github.com/Khopa/dcs_liberation/issues/682
2021-01-01 13:23:58 -08:00
Dan Albert
802eff1faa Fix some airfield data in Persian Gulf.
Not sure if this changed or has just always been wrong.
2021-01-01 13:22:33 -08:00
Dan Albert
5734c29312 Remove wrong precondition in aircraft procurement.
Those task types aren't correct here (that whole dict probably serves
little purpose now), and the actual unit pool is handled in
_affordable_aircraft_of_types.
2020-12-28 16:06:54 -08:00
walterroach
362caa6ac1
Merge pull request #689 from walterroach/naming
Naming
2020-12-28 17:22:42 -06:00
Dan Albert
b620976b70 Flesh out Desert War IADS, add carriers. 2020-12-28 13:16:39 -08:00
walterroach
daba4ef09e Fix aircraft group IDs not being reproducible. 2020-12-28 14:04:19 -06:00
walterroach
c697a34239 Correctly reset ANIMALS 2020-12-28 11:31:04 -06:00
walterroach
09b7cb3d85 Change naming to static class
This ensures all generators are using the same ID set.
2020-12-28 11:22:28 -06:00
walterroach
d7e48662e0 Add custom flight names
Mildly breaks save compat with 2.3; All existing flight dialogs will be
broken, passing the turn or recreating all the flights in the UI will
allow you to continue
2020-12-28 10:52:25 -06:00
walterroach
9fd5c6f230 Add package info to aircraft names
Makes it easier to identify aircraft for client flights
2020-12-28 09:51:37 -06:00
walterroach
aa7825d4aa Reproducible unit naming
Splits infantry and other unit IDs.

Resets IDs to start from zero at each press of "Takeoff"

Direct access to the the `Game` class IDs is done on the `Operation` class to
preserve save compat
2020-12-28 09:27:33 -06:00
Dan Albert
436725b38e Don't award base capture bonuses.
If anything we should be granting the loser extra income so they can
recover. For now just remove.
2020-12-27 19:52:42 -08:00
Dan Albert
922d935bc1 Tweak default budget and turn 0 allocation.
AI wasn't buying many ground vehicles. Keep the turn 0 air budget about
where it was but bump up the ground budget from ~120M to ~600M.
2020-12-27 19:48:03 -08:00
Dan Albert
69833f66e3 Don't show FOB structure as a target.
This isn't perfect because the auto planner might still target it. We
need a larger refactoring for target iteration so we don't need to
remember all the special rules at each call site. For now, this restores
the 2.3.2 behavior.

Fixes https://github.com/Khopa/dcs_liberation/issues/681
2020-12-27 19:34:10 -08:00
Dan Albert
89f313295e Use exact name matching when picking targets.
Inexact name matching targets the first group that partially matches the
given group name. aa|71 will match aa|7.

The inexact match that was here was only needed for an early attempt to
use skynet where group names were not used consistently. That's no
longer a problem so we don't need this workaround.

Fixes https://github.com/Khopa/dcs_liberation/issues/676
2020-12-27 13:45:53 -08:00
Dan Albert
317a882386 Allow managing disbanded sites in CPs.
Fixes https://github.com/Khopa/dcs_liberation/issues/679
2020-12-27 13:08:59 -08:00
Dan Albert
3a9f585b6b Plan multiple CAP rounds per turn.
On station time for CAP is only 30 minutes, so plan three cycles to give
~90 minutes of CAP coverage.

Default starting budget has increased significantly to account for the
greatly increased aircraft needs on turn 1.

Fixes https://github.com/Khopa/dcs_liberation/issues/673
2020-12-26 17:26:07 -08:00
Dan Albert
d3b1f6110f Don't show repaired TGOs as dead.
We were never resetting the dead state for repaired SAMs. Rather than
tracking that manually, determine liveness from the number of units left
alive.

For building objectives where the group is not assigned to the TGO until
*mission* generation time we still need manual tracking.
2020-12-26 16:19:41 -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
d946a9e526 Don't count blind SAMs as threats.
https://github.com/Khopa/dcs_liberation/issues/647
2020-12-26 15:40:38 -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
d634fd3236 Adjust income based on control point type.
* Navies and off map spawns generate no income
* FOBs generate 10 instead of 20

Fixes https://github.com/Khopa/dcs_liberation/issues/662
2020-12-26 15:08:57 -08:00
Dan Albert
e861e5b3d6 Even out player and opfor income rules.
Should help fix the anemic enemy forces after the first few turns.
2020-12-26 14:35:57 -08:00
Dan Albert
8be2841bdf Fix New Package for naval control points.
Also reordered the tasks so ship-specific tasks appear first.

Fixes https://github.com/Khopa/dcs_liberation/issues/628
2020-12-26 14:30:26 -08:00
Dan Albert
b6e37b9e67 Exclude non-AA groups from SAM threat zones.
Fixes https://github.com/Khopa/dcs_liberation/issues/666
2020-12-26 14:00:31 -08:00
walterroach
0c42227e5e Add F-14A-135-GR Icon 2020-12-26 13:23:45 -06:00
Dan Albert
98ac4bd5c8 Fix generator -> group conversion when buying SAM.
Fixes https://github.com/Khopa/dcs_liberation/issues/664
Fixes https://github.com/Khopa/dcs_liberation/issues/665
2020-12-26 02:23:15 -08:00
Dan Albert
a43b100781 Purchase reserves for CAP/CAS.
Next turn's defenses should be planned in preference to expanding
offensive capabilities.

Fixes https://github.com/Khopa/dcs_liberation/issues/511
2020-12-25 19:15:31 -08:00
Dan Albert
c7f9bfbb43 Sell off incomplete opfor squadrons.
Short term fix for https://github.com/Khopa/dcs_liberation/issues/41.
2020-12-25 18:45:58 -08:00
Dan Albert
b5f8e6925b Rank aircraft purchase preferences.
Rather than randomly selecting compatible aircraft for missions, perfer
the *best* aircraft for the job. This removes the "preferred" lists in
favor of sorting the capable lists in priority order. To maintain some
amount of variety the procurer has a 50/50 chance of buying when it
finds a match.

Fixes https://github.com/Khopa/dcs_liberation/issues/510
2020-12-25 18:22:50 -08:00
Dan Albert
993e59413a Add pretty-print for AircraftProcurementRequest. 2020-12-25 17:31:26 -08:00
Dan Albert
3bdf1377c0 Flesh out intel displays.
* Add enemy air and ground unit reports.
* Changes the summary to be a comparison of relative strengths rather
  than raw enemy numbers.

Fixes https://github.com/Khopa/dcs_liberation/issues/658
2020-12-25 16:08:02 -08:00
Dan Albert
1f4516b954 Improve layout of intel window. 2020-12-25 14:42:04 -08:00
Dan Albert
1d76ee4871 Add basic intel window.
Currently only shows the enemy's economic information.

https://github.com/Khopa/dcs_liberation/issues/658
2020-12-25 03:24:33 -08:00
Dan Albert
b53cac4c7a Add basic enemy intel widget.
https://github.com/Khopa/dcs_liberation/issues/658
2020-12-25 01:38:14 -08:00
Dan Albert
c833078e71 Never generate empty ship groups.
Fixes https://github.com/Khopa/dcs_liberation/issues/391
2020-12-25 01:32:54 -08:00
Dan Albert
e4cba8d19f Mention Skynet PD in changelog. 2020-12-24 19:32:31 -08:00
Dan Albert
cd6620712f Configure skynet point defenses.
Fixes https://github.com/Khopa/dcs_liberation/issues/470
2020-12-24 17:10:32 -08:00
Dan Albert
85619b156d Support groups for SAM templates.
It's only possible to control emissions for the group as a whole, so
Skynet needs PDs to be in separate groups from the main part of the SAM
for PD to operate correctly.

https://github.com/Khopa/dcs_liberation/issues/429
https://github.com/Khopa/dcs_liberation/issues/470
2020-12-24 16:09:42 -08:00
Dan Albert
10debbc286 Constrain front lines better.
Holes in the inclusion zone are defined by exclusion zones, not by holes
in the inclusion zone. Add a cached property for the inclusion zone that
is not also sea or exclusion zone and use that boundary instead.
2020-12-24 13:50:29 -08:00
Dan Albert
aafd09569c Fix mypy error. 2020-12-24 02:20:49 -08:00
Dan Albert
67a9df686e Add fast path for NavPoint equality.
Hot method and the FFI costs for comparing the points are not cheap.
2020-12-24 02:06:08 -08:00
Dan Albert
9a374711fd Don't access point coordinates when hashing.
For some reason this is crazy expensive. Turn time goes from 1.7 seconds
to 1 second with this change.
2020-12-24 01:49:07 -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