1279 Commits

Author SHA1 Message Date
Dan Albert
7c22f6e83b Change mach function to take altitude in meters.
All of the callers are passing altitude in meters because that's what
pydcs uses. This still returns knots which makes it extra weird, but
that's what almost all of the callers expect.

It's probably a good idea to introduce some explicit types for the
various distance and speed units to avoid these sorts of mistakes.
2020-11-20 02:19:38 -08:00
Dan Albert
18b6f7b84c Add off-map spawn locations.
The AI isn't making use of these yet, but it's not smart enough to do so
anyway.

Would benefit from an icon to differentiate it on the map.

I'm stretching the definition of "control point" quite a bit. We might
want to put a class above `ControlPoint` for `AirSpawnLocation` to
represent types of spawn locations that can't be captured and don't have
ground objectives.

Fixes https://github.com/Khopa/dcs_liberation/issues/274
2020-11-20 02:19:03 -08:00
Dan Albert
4e910c4b09 Maybe correct fishbed radios.
Maybe fixes https://github.com/Khopa/dcs_liberation/issues/377
2020-11-20 00:18:00 -08:00
Dan Albert
bc3cd50a6c Add support for required SAMs in campaigns.
"Required" SAMs (designative by redfor long range SAM launchers in the
ME) will always be spawned during campaign generation. This makes it
possible to build a semi-guaranteed IADS (the exact type of SAM is
dependent) on the choice of faction.

Requierd SAMs will consume the slots of random SAMs during generation.
Later we should differentiate between strategic SAMs like SA-10s and
tactical SAMs like SA-11s so we can fill in the medium range SAMs at
random locations among the fixed long range SAMs.
2020-11-19 23:47:07 -08:00
Dan Albert
cecf611f91 Add docs for PresetLocations. 2020-11-19 21:59:36 -08:00
Dan Albert
5e4802f05e Return base defense locations to pool on capture.
When a base is captured we clear its defenses. Those locations need to
be returned to the preset location pool so they can be used for the new
base defenses.
2020-11-19 21:50:29 -08:00
Dan Albert
1e70e654ed Don't attempt loading miz files as JSON. 2020-11-19 21:32:44 -08:00
Dan Albert
20054b9825 Update Inherent Resolve campaign presets.
None of these are placed precisely yet, but they're useful for testing.
2020-11-19 21:29:21 -08:00
Dan Albert
5fb6a53cbd Add preset configuration for offshore types. 2020-11-19 21:28:57 -08:00
Dan Albert
ff751c30f9 Add preset configuration for strike targets. 2020-11-19 21:20:40 -08:00
Dan Albert
c1614ad5a7 Add TODOs for carrier CP names. 2020-11-19 21:19:53 -08:00
Dan Albert
13e372159a Change default settings to match UI defaults.
Doesn't affect the thing players see, but corrects the defaults when
using the command line mission generator.
2020-11-19 21:19:12 -08:00
Dan Albert
1ee0aafd9a Unify TGO location selection.
We currently have three methods of choosing locations for TGOs:

1. From the campaign miz
2. From the per-CP mizdata files
3. Randomly

Move the selection among these sources into a single place and use it
everywhere that we search for a TGO location.

Longer term methods 2 and 3 will be removed.
2020-11-19 21:09:33 -08:00
Dan Albert
df80ec635f Add a new miz file based campaign generator.
Defining a campaign using a miz file instead of as JSON has a number of
advantages:

* Much easier for players to mod their campaigns.
* Easier to see the big picture of how objective locations will be laid
  out, since every control point can be seen at once.
* No need to associate objective locations to control points explicitly;
  the campaign generator can claim objectives for control points based
  on distance.
* Easier to create an IADS that performs well.
* Non-random campaigns are easier to make.

The downside is duplication across campaigns, and a less structured data
format for complex objects. The former is annoying if we have to fix a
bug that appears in a dozen campaigns. It's less an annoyance for
needing to start from scratch since the easiest way to create a campaign
will be to copy the "full" campaign for the given theater and prune it.

So far I've implemented control points, base defenses, and front lines.
Still need to add support for non-base defense TGOs.

This currently doesn't do anything for the `radials` property of the
`ControlPoint` because I'm not sure what those are.
2020-11-19 16:55:21 -08:00
Dan Albert
20f97e48a9 Update changelog for 2.2.1. 2020-11-19 00:42:54 -08:00
Dan Albert
94c5ed8bdc Fix custom waypoints.
Like with deleting waypoints, these will degrade the flight plan to the
2.1 behavior.

Ascend/descend points aren't in use any more, so I removed those.
2020-11-19 00:29:05 -08:00
Dan Albert
4b7b4bf110 Allow deleting waypoints.
In almost every case this leaves us with a flight plan we can't reason
about, so it gets degraded to `CustomFlightPlan`. The exception is when
deleting a target point when there are other target points remaining.
This probably gets people using this feature back to what they want
though, which is essentially the 2.1 behavior.

Fixes https://github.com/Khopa/dcs_liberation/issues/393
2020-11-18 23:44:16 -08:00
Dan Albert
a223da8f99 Avoid cases where empty flights could be created.
Fixes https://github.com/Khopa/dcs_liberation/issues/373
2020-11-18 22:03:33 -08:00
Dan Albert
98fd707aea Add infor about delayed flights to the start page.
Fixes https://github.com/Khopa/dcs_liberation/issues/398
2020-11-18 21:26:14 -08:00
Dan Albert
5928f29f11 Delay player CV flight when their settings say so.
Fixes https://github.com/Khopa/dcs_liberation/issues/375

This also fixes a problem where we're spawning non-cold start planes in
an uncontrolled state. The ME won't let us do this, so we probably
shouldn't be doing that.
2020-11-18 19:34:38 -08:00
Dan Albert
c3ebabbe44 Don't delay player flights with short delays.
Not much point in delaying humans 8 seconds.

Fixes https://github.com/Khopa/dcs_liberation/issues/397
2020-11-18 19:27:03 -08:00
Khopa
29fd094dd0 Added F-14A support 2020-11-19 00:34:24 +01:00
walterroach
f7966b8d8c fix bug #394 2020-11-18 16:37:30 -06:00
Khopa
ee2f4ecbc8 Pydcs submodule update 2020-11-18 21:51:47 +01:00
Khopa
b08f6cad1d French translations for jinja templates, might be useful later. 2020-11-18 21:50:58 +01:00
Dan Albert
e851223733 Fix mypy. 2020-11-18 01:58:35 -08:00
Dan Albert
1f12546ff4 Add command line option to generate a new game.
Saves us a ton of clicks while developing the campaign generator.
2020-11-17 18:56:35 -08:00
Dan Albert
8345063e84 Move theater into game. 2020-11-17 18:11:33 -08:00
walterroach
482bedd739
Merge pull request #381 from foxwxl/patch-1
Create briefingtemplate_CN.j2
2020-11-17 15:47:27 -06:00
Dan Albert
7d7a334418 Fix mypy. 2020-11-17 02:04:38 -08:00
Dan Albert
69dbe62b70 Plan anti-ship missions automatically. 2020-11-17 01:08:06 -08:00
foxwxl
f61167cedf
Create briefingtemplate_CN.j2
Briefing template CN version
2020-11-17 16:52:52 +08:00
Dan Albert
2ac92a75a4 Plan BAI missions automatically. 2020-11-17 00:36:41 -08:00
Dan Albert
fe80a9fd08 Make garrisons not SAMs.
The AI planner was planning DEAD against tanks because technically they
were SAMs.
2020-11-17 00:25:45 -08:00
Dan Albert
505af7635f Include EWRs in DEAD targets. 2020-11-16 23:53:25 -08:00
Dan Albert
426dc69e1d Allow DEAD on EWRs. 2020-11-16 23:53:25 -08:00
Dan Albert
082e8c062c Add anti-ship missions.
The only practical difference between this and BAI is that the target is
floating, so this mostly shares its implementation with BAI.

Fixes https://github.com/Khopa/dcs_liberation/issues/350
2020-11-16 23:29:19 -08:00
Dan Albert
9f2409bb9e Make sweep flights actually sweep flights.
DCS group task doesn't alter behavior, but it does alter which tasks are
available to the group.
2020-11-16 22:47:32 -08:00
Dan Albert
14dd8e43a4 Improve waypoint names for BAI targets. 2020-11-16 22:37:19 -08:00
Dan Albert
9fb33526a7 Add BAI missions.
BAI is used for attacking ground vehicles as opposed to buildings like
strike does, and not air defenses like DEAD does. Unlike strike, BAI is
tolerant of moving targets.

Fixes https://github.com/Khopa/dcs_liberation/issues/216
2020-11-16 21:11:18 -08:00
Dan Albert
8bd00bf450 Move mission type compatibility to the target.
This was also needed in other parts of the UI and is easier to implement
in the target class anyway.

Note that DEAD is now properly restricted to air defense targets.

Also added error boxes to the UI for when planning fails on an invalid
target.
2020-11-16 21:11:14 -08:00
walterroach
f3553ced78
Merge pull request #366 from walterroach/new_frontline
New frontline paths.  First step in #287
2020-11-16 22:13:33 -06:00
Khopa
a52dc43c9e MAde it possible to setup liveries in faction files. 2020-11-16 22:02:30 -06:00
Khopa
0b6b40a358 Pydcs repository update : Fixed issue with clipped wing variant of the spitfire not being seen as a flyable module 2020-11-16 22:02:27 -06:00
Dan Albert
f6371d2ef1 Further improve split/join positioning. 2020-11-16 22:02:22 -06:00
walterroach
ecd073e31d typing and comment cleanup 2020-11-16 22:01:49 -06:00
Dan Albert
dc235f36c8 Further improve split/join positioning. 2020-11-16 19:15:11 -08:00
Khopa
7503c1e1e9 Pydcs repository update : Fixed issue with clipped wing variant of the spitfire not being seen as a flyable module 2020-11-17 00:06:10 +01:00
walterroach
253e8a209c fix return statement 2020-11-16 17:02:04 -06:00
Khopa
e26b692631 MAde it possible to setup liveries in faction files. 2020-11-16 23:57:12 +01:00