2943 Commits

Author SHA1 Message Date
Dan Albert
3c90a92641 Add fuel consumption data for the Hornet.
Will be used to calculate bingo and min remaining fuel for the
kneeboard.
2021-07-17 18:23:20 -07:00
Dan Albert
4c0a97e62f Log a warning for unknown max ranges. 2021-07-17 17:27:40 -07:00
Dan Albert
0a57bb5029 Increase airfield distance in Battle of Abu Dhabi.
Removes some of the low capacity airfields from the campaign now that
missions can plan longer ranges if needed.

This removes Khasab, Bandar Lengeh, and Qeshm from the blue side, so
blue no longer has any airfields on the peninsula.

The CVN has moved quite a ways west to make it a good platform for
attacking the area around Dubai, and to prevent it from being the
primary mission source (with a 90 aircraft limit, a *lot* of missions
can get planned there before other airbases will be used).

The LHA moves to near where the CVN was, making it a good platform for
early game missions. Once the LHA's 20 aircraft limit is exhausted, Kish
and Bandar Abbas will be the primary airfields early game. Bandar Abbas
is still close enough to source Hornet and Viper missions to most of the
area around Dubai. It's unable to reach Lar with those aircraft, but
Kish and the CVN can (as can captured airfields).
2021-07-17 16:34:13 -07:00
Dan Albert
c65ac5a7cf Move mission range data into the aircraft type.
The doctrine/task limits were capturing a reasonable average for the
era, but it did a bad job for cases like the Harrier vs the Hornet,
which perform similar missions but have drastically different max
ranges. It also forced us into limiting CAS missions (even those flown
by long range aircraft like the A-10) to 50nm since helicopters could
commonly be fragged to them.

This should allow us to design campaigns without needing airfields to be
a max of ~50-100nm apart.
2021-07-17 16:34:13 -07:00
Dan Albert
04a8040292 Prevent carriers from claiming most TGOs.
The naval CP generators will only spawn ships, so if any of the other
TGO types were closest to the CV or LHA they just would not be
generated.
2021-07-17 16:34:13 -07:00
Dan Albert
adab00bc0e Update changelog. 2021-07-17 14:31:14 -07:00
Dan Albert
9bb8e00c3d Allow configuration of the air wing at game start.
After completing the new game wizard but before initializing turn 0,
open a dialog to allow the player to customize their air wing. With this
they can remove squadrons from the game, rename them, add players, or
change allowed mission types. *Adding* squadrons is not currently
supported, nor is changing the squadron's livery (the data in pydcs is
an arbitrary class hierarchy that can't be safely indexed by country).

This only applies to the blue air wing for now.

Future improvements:

* Add squadron button.
* Collapse disable squadrons to declutter?
* Tabs on the side like the settings dialog to group by aircraft type.
* Top tab bar to switch between red and blue air wings.
2021-07-17 14:29:04 -07:00
Dan Albert
f2dc95b86d Fix typo. 2021-07-16 22:43:59 -07:00
Dan Albert
28f98aed88 Migrate pressure to a typed unit. 2021-07-16 22:38:41 -07:00
Dan Albert
d11174da21 Stop cluttering the kneeboard with empty notes. 2021-07-16 22:25:40 -07:00
Dan Albert
8e977f994f Remove LGBs from degraded loadouts without TGPs.
This only takes effect for default loadouts. Custom loadouts set from
the UI will allow LGBs. In the default case there will not be buddy-lase
coordination so we should take iron bombs instead.

Also adds single/double Mk 83 and Mk 82 weapon data to accomodate this.
2021-07-16 18:34:41 -07:00
Dan Albert
11c2d4ab25 Add JDAMs and their fallbacks.
Hornet should be compatible with 1990 campaigns now. Air-to-ground
weapon restrictions are less interesting for AI aircraft so I haven't
covered *all* the variants here (the >2 variants of each carried by the
B1 and such).
2021-07-16 16:23:22 -07:00
Dan Albert
b733e6855b Add SLAM/SLAM-ER weapon data. 2021-07-16 15:48:12 -07:00
Dan Albert
aa3d644f97 Prevent empty cheek stations for the Hornet.
This is a bit of a hack that makes the TGPs fall back to AIM-120s. It
works okay because this only applies to a few cases:

The A-10 gets an empty pylon. That's fine. Maybe later we can add
multiple fallback paths and depth-first-search through them so that that
pylon could carry bombs instead.

The Viper has no replacemnt for that station. The jammer goes on the
other fuselage station, the HTS isn't a replacement, and we don't have
LANTIRN for the Viper. No weapons can be fit to those stations.

What this helps is the Hornet, where any Gulf War scenario ends up with
an empty cheek station because we don't have the NITE HAWK to fall back
to. In this case we can instead fall back through the air-to-air
missiles to fill the station.
2021-07-16 15:27:32 -07:00
Dan Albert
bb46d00f22 Add weapon data for R-77, R-27, and R-24. 2021-07-16 15:22:11 -07:00
Dan Albert
771c74ee75 Fill out weapon data for AIM-9s. 2021-07-16 15:12:49 -07:00
Magnus Wolffelt
04a346678c
Add situational temperature and pressure variation.
Now varies by:

* Season
* Theater
* Weather
* Time of day
2021-07-16 14:08:14 -07:00
Dan Albert
e5c0fc92ec Don't reload weapon data if already loaded. 2021-07-16 01:06:31 -07:00
Dan Albert
1b640f40dc Fix map issues when debugging tools are disabled. 2021-07-16 00:27:11 -07:00
Mustang-25
ee77516716
Replace TGP with SPJ for JF-17 CAP/SEAD.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1422.
2021-07-16 00:17:20 -07:00
Dan Albert
82cca0a602 [3/3] Rework hold points. 2021-07-15 23:21:56 -07:00
Dan Albert
d444d716f5 [2/3] Improve join point placement. 2021-07-15 23:18:10 -07:00
Dan Albert
e03d710d53 [1/3] Rework IP placement.
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.
2021-07-15 23:18:10 -07:00
Magnus Wolffelt
2b696144e3
Add QNH and temperature to the kneeboard. 2021-07-15 15:34:58 -07:00
RndName
62036a273e allow user to set empty dcs install dir
This will allow expert users to disable the automatic MissionScripting.lua replacement. There are many warnings and errors which have to be ignored to achieve this because DCS Liberation will not work with unmodified MissionScripting.lua
2021-07-15 13:46:59 -07:00
Magnus Wolffelt
d25befabdd
Randomize mission temperature and pressure. 2021-07-15 13:34:09 -07:00
Dan Albert
56b17dfbcf Correct behavior for multi-task HTN methods.
Add tasks to the left of the deque, not the right.

Not symptomatic yet since we don't actually have any multi-task methods
currently.
2021-07-14 18:34:33 -07:00
Dan Albert
72c181a399 Fix budget mismatch in the UI.
Much of the UI was using the old budget which wasn't removed from Game
like it should have been when Coaltion was introduced. The UI displayed
(and in some cases pulled from) the starting budget rather than the real
budget.
2021-07-14 17:33:01 -07:00
Dan Albert
b1b60f4286 Add JSOW A and C weapon data and fallbacks.
Both types use JSOW -> Walleye -> Mk 84. The JSOW A should maybe fall
back to some CBU instead, but I think the standoff capability is more
important to preserve than the warhead type.
2021-07-14 01:27:00 -07:00
Dan Albert
7648716199 Make weapon groups explicit and moddable.
The only parts of the old weapon data that worked well (didn't commonly
result in empty pylons) did this implicitly, so make the grouping
explicit.

This also moves the data out of Python and into the resources, which
both makes the data moddable and isolates us from a huge amount of
effort and a save compat break whenever ED changes weapon names.

I didn't auto migrate the old data since the old groups were not
explict and there's no way to infer the grouping. Besides, since most of
the weapons were *not* grouped, the old data did more harm than good in
my experience. I've handled the AIM-120 and AIM-7 for now, but will get
at least all the fox 3 missiles before we ship.
2021-07-14 01:04:03 -07:00
Dan Albert
9177588220 Don't target ammo depots at inactive front lines. 2021-07-13 20:49:31 -07:00
Dan Albert
9bbcee645e Cleanup and document some of Doctrine. 2021-07-13 20:18:30 -07:00
Dan Albert
a7d49b986d Exclude both path endpoints for joins/splits.
Without this the points would often be placed exactly on top of the
origin airfield, when in that case we actually should use the fallback
behavior.
2021-07-13 20:11:09 -07:00
Dan Albert
7c3e08050f Perturb fallback join/split points.
Otherwise they're placed exactly on top of each other, which makes the
map harder to read.
2021-07-13 20:10:29 -07:00
Dan Albert
076df7cf66 Fix placement of fallback split points.
Using the target placed the split in the threatened area.
2021-07-13 20:07:42 -07:00
Dan Albert
415b8c6317 Allow the split point to differ from the join.
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).
2021-07-13 19:59:22 -07:00
Dan Albert
c1d3c93dbb Speed up turn processing.
Run the expensive precondition check (package fulfillment) last.
2021-07-13 18:56:06 -07:00
Dan Albert
8e59c99666 Improve hold point placement for nearby joins. 2021-07-13 18:43:02 -07:00
Dan Albert
dfcd372d2d Remove egress points from most flight plans.
These don't have any function. Remove them and remove the angled attack
heading from the IP.
2021-07-13 18:36:38 -07:00
Dan Albert
f7bbe0fa94 Improve flight plan layout for untheatened IPs.
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.
2021-07-13 18:22:42 -07:00
Dan Albert
a1910f49a8 Color navmesh zones based on threat. 2021-07-13 17:49:10 -07:00
Dan Albert
5f8be5fa91 Fix type checker issue. 2021-07-13 17:08:37 -07:00
Dan Albert
587034ad03 Prioritize ammo depots when appropriate.
The AI will now prioritize targeting ammo depots if the current
deployable enemy forces outnumber the friendly cap by 50% or more.
2021-07-13 17:06:25 -07:00
Dan Albert
9568bc7ea6 Fix inversion of AI management for opfor. 2021-07-13 17:04:49 -07:00
Dan Albert
ccf6b6ef5f Check for available aircraft as task precondition.
This makes it so that the mission planning effects are applied only if
the package can be fulfilled. For example, breakthrough will be used
only if all the BAI missions were fulfilled, not if they will *attempt*
to be fulfilled.
2021-07-13 16:26:15 -07:00
Dan Albert
24f6aff8c8 Reduce mission planning dependence on Game. 2021-07-13 15:20:42 -07:00
Dan Albert
17c19d453b Factor out Coalition from Game. 2021-07-13 14:29:40 -07:00
Dan Albert
4534758c21 Account for planned missions for breakthrough.
Consider BAI missions planned this turn when determining if a control
point is still garrisioned for preventing breakthrough.

This isn't very accurate yet since the HTN isn't checking for aircraft
fulfillment yet, so it might *plan* a mission to kill the garrison, but
there's no way to know if it will be fulfilled.
2021-07-13 13:50:50 -07:00
Dan Albert
c180eb466d Use aggressive stance for similar troop counts.
Bumps the breakthrough requirement to 2x, elimination to 1.5x, and uses
agressive for 0.8-1.5x.
2021-07-12 21:28:00 -07:00
Dan Albert
0a416ab758 Let the TheaterCommander manage front line stance.
This improves the AI behavior by choosing the stances non-randomly:

* Breakthrough will be used if the base is expected to be capturable and
  the coalition outnumbers the enemy by 20%.
* Elimination will be used if the coalition has at least as many units
  as the enemy.
* Defensive will be used if the coalition has at least half as many
  units as the enemy.
* Retreat will be used if the coalition is significantly outnumbers.

This also exposes the option to the player.
2021-07-12 21:12:02 -07:00