1012 Commits

Author SHA1 Message Date
RndName
344d4e31b7 Migrate generators to templats
- added all new templates
- deleted the generators
- added documentation
2022-02-21 20:45:41 +01:00
RndName
60c8c80480 Decoupling and generalization of templates
Improvement for factions and templates which will allow decoupling of the templates from the actual units
- Implement UnitGroup class which matches unit_types and possible templates as the needed abstraction layer for decoupling.
- Refactor UnitType, Add ShipUnitType and all ships we currently use
- Remove serialized template.json and migrated to multiple yaml templates (one for each template) and multiple .miz
- Reorganized a lot of templates and started with generalization of many types (AAA, Flak, SHORAD, Navy)
- Fixed a lot of bugs from the previous reworks (group name generation, strike targets...)
- Reorganized the faction file completly. removed redundant lists, added presets for complex groups / families of units like sams
- Reworked the building template handling. Some templates are unused like "village"
- Reworked how groups from templates can be merged again for the dcs group creation (e.g. the skynet plugin requires them to be in the same group)
- Allow to define alternative tasks
2022-02-21 20:45:41 +01:00
RndName
daf4704fe7 Rotate ground-units as in the campaign miz
This implements a logic to rotate groups which are generated from templates like the origin (ground unit) which was placed by the campaign designer
2022-02-21 20:45:41 +01:00
RndName
5febcdd4e4 Implement Template System for ground objects
- Factored out the current generators to use a better approach with Templates build from the dcs mission editor.
- This information is extended with a template-mapping in a json file which allows to logically group together multiple dcs groups and even statics to one template
- The combination of mapping and miz will be serialized to a template.json which is only used for loading.
- Factions now load templates during initialization and hold all the templates they can really use. This is based around the faction file.
- Implemented a template randomizer which allows to add some randomization to templates
- Each Template Group can have 1 randomizer which randomizes unit_type and size based on the mapping definition. Larger groups need to be devided in more fine detailed groups as we can now handle them better due to the change from dcs group types to our own classes.
- Rewritten the ArmorGroup, Naval and EWR template handling

Rework GroundObjectBuyMenu to support templates
2022-02-21 20:45:41 +01:00
RndName
d154069877 Refactor ground objects and prepare template system
- completly refactored the way TGO handles groups and replaced the usage of the pydcs ground groups (vehicle, ship, static) with an own Group and Unit class.
- this allows us to only take care of dcs group generation during miz generation, where it should have always been.
- We can now have any type of unit (even statics) in the same logic ground group we handle in liberation. this is independent from the dcs group handling. the dcs group will only be genarted when takeoff is pressed.
- Refactored the unitmap and the scenery object handling to adopt to changes that now TGOs can hold all Units we want.
- Cleaned up many many many lines of uneeded hacks to build stuff around dcs groups.
- Removed IDs for TGOs as the names we generate are unique and for liberation to work we need no ids. Unique IDs for dcs will be generated for the units and groups only.
2022-02-21 20:45:41 +01:00
RndName
6baf36c587 Prepare the generators for template migration
adopt armor and ship generators for randomization
2022-02-21 20:45:41 +01:00
Dan Albert
b4742ad54c Move faction cache out of db.py. 2022-02-18 17:58:34 -08:00
MetalStormGhost
33ed127cba
UH-60L mod support
Resolves #1964 but adding CTLD will require the use of Liberation plugins and thus are not included in this pull request.

- Implemented support for the UH-60L mod by =X51= Kinkkujuustovoileipa, Cubeboy, Jonas, JinxxDCS, Dorian, =X51= Parzival & =X51= Lawson.
- Because the standard DCS tankers will not fly below 160ish knots, the UH-60L mod team have included a modified version of the KC-130 tanker designed for refueling at speeds of 120-130kts.
2022-02-13 15:56:51 +01:00
Dan Albert
2e901f3586 Replace some isinstance calls with TypeGuard.
These aren't as ergonomic as I'd hoped because of
https://www.python.org/dev/peps/pep-0647/#narrowing-of-implicit-self-and-cls-parameters.

I added a decorator `@self_type_guard` so we can avoid needing to import
the descendent types in the typeguard implementation (which wouldn't fix
any circular imports, just move them).
2022-02-12 14:59:44 -08:00
Dan Albert
011d8a4e12 Export airfield data to yaml, switch to ID keys.
This exports all the old AIRFIELD_DATA to yaml files. It's easier for
users to send fixes if it's defined this way, and they can also fix it
in their install without having to wait for a new release.

This also switches the indexes from the unstable DCS airfield names to
airfield IDs, so this fixes another case of DCS updates occasionally
breaking Liberation.

I also ended up finding quite a few typos in airfield names, and
incorrect theater names in the process. Those have been fixed.
2022-02-11 01:39:57 -08:00
MetalStormGhost
7387c2ed8f
Add support for the AI-only F-14A.
The AI for the flyable one is having issues firing AIM-54s. This allows
working around that.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1927.
2022-01-16 13:53:05 -08:00
RndName
8df9f6989a
Update for the nevada map update
Conflicttheater and Airfields needed an update as nearly all Nevada Airports were renamed with the last map update
2022-01-06 19:50:45 +01:00
RndName
f526681f3d Update SA-5 Generator for factions without the TinShield
- added an EarlySA5Generator with the P-19 FlatFace SR which is supported by all factions
- allows factions without access to the TinShield to have a working SA-5
2022-01-05 01:08:09 +01:00
Benjamin Fischer
2d07ef717c
changed AWACS orbit to a racetrack (#1826)
* AWACS now orbits in a racetrack.

* Update AWACS racetrack length

* Increase AWACS threat spacing.
2022-01-01 19:05:28 -07:00
Starfire13
d739d830ab Fixed typo in naming.py 2021-12-23 11:19:56 +00:00
MetalStormGhost
88bc4fd852
F-104 mod support. 2021-12-22 13:01:51 -08:00
Dan Albert
f3bf9c0c3c Silence some useless generation warnings. 2021-11-21 13:55:41 -08:00
Dan Albert
ef73f712ec More Python 3.10 compat. 2021-11-21 11:28:51 -08:00
Dan Albert
12f420f50e Pre-emptive Python 3.10 compat.
Iterator is no longer exposed directly in collections, but is in
collections.abc.
2021-11-20 18:49:14 -08:00
Khopa
ea868b7079 SA5Generator : Added an ural truck to reload SA-5 sites 2021-11-14 21:14:35 +01:00
SnappyComebacks
532ac261ff
Ability to plan tanker recovery for strike like flights (#1729)
* Initial refueling definitions.

* Adding refuel definitions.

* Initial functionality changes

* Regenerate package when adding refueling flight.

* Recursively change package waypoint.

* Fix mypy errors.

* Regenerate flight plans when tanker is added to package.

* Give tanker better starting position on package recovery.

* Add TOT calculation for refueling waypoint.

* Timing changes to Strike split point and Refueling start time.

* Add correct waypoint builder for refuel in tarcap and sweep.  Remove restrict afterburner on refuel point.

* Always generate a refuel point for a package.

* Less arbitrary altitude in Refuel track start time calculation.

* Refueling waypoint no longer optional.

* Fix mypy gen error.

* Better discrimination of which tanker flight plan to make.

* Remove refuel tot calculations.

* Remove package regeneration on tanker flight addition.
2021-11-12 21:37:34 -07:00
Dan Albert
a33104d7c4 Split runway attack list from strike list.
Not all strike aircraft are capable of runway attack, so copy the strike
list into the runway attack list and remove the incompatible aircraft.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1703
2021-11-06 16:25:14 -07:00
Dan Albert
8fe805bc68 Revert use of ABC in FlightPlan.
Mypy can't handle ABC dataclasses:
https://github.com/python/mypy/issues/5374
2021-11-03 17:32:05 -07:00
Dan Albert
1944a172a3 Fix NotImplementedError for some flight plans.
Implement custom behavior for some of the flight plans but also add a
base implementation that just returns the empty set.

Use ABC for FlightPlan so that we can fail-fast on these kinds of
problems.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1711
2021-11-03 17:28:13 -07:00
ghost
92fdd0b80d Enable anti-ship missions for the Tu-142.
This is the only mission type that the Tu-142 is capable of.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1683
2021-10-30 13:25:04 -07:00
Dan Albert
1a3b8d1dd6 Reduce fuel for fast-forwarded player flights.
This only has an effect for aircraft for which we have fuel consumption
data, but that's fine.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-30 11:37:06 -07:00
Dan Albert
5db1b94ac4 Add option to fast forward to first contact.
This is the first step in a larger project to add play/pause buttons to
the Liberation UI so the mission can be generated at any point.
docs/design/turnless.md describes the plan.

This adds an option to fast forward the turn to first contact before
generating the mission. None of that is reflected in the UI (for now),
but the miz will be generated with many flights in the air.

For now "first contact" means as soon as any flight reaches its IP. I'll
follow up to add threat checking so that air-to-air combat also triggers
this, as will entering a SAM's threat zone.

This also includes an option to halt fast-forward whenever a player
flight reaches a certain mission-prep phase. This can be used to avoid
fast forwarding past the player's startup time, taxi time, or takeoff
time. By default this option is disabled so player aircraft may start in
the air (possibly even at their IP if they're the first mission to reach
IP).

Fuel states do not currently account for distance traveled during fast
forward. That will come later.

https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-24 17:40:45 -07:00
MetalStormGhost
49033f67f3
Added H-6J support for China 2010 and Iraq 1991.
Includes H-6J loadouts by @Starfire13

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1661
2021-10-23 16:58:27 -07:00
Dan Albert
74291271e3 Move mission generation code into game.
Operation has been renamed MissionGenerator and is no longer a static
class.
2021-10-22 13:48:43 -07:00
Dan Albert
b0787d9a3f Build a proper type for StartType. 2021-10-22 11:42:13 -07:00
Dan Albert
be69d17345 Move Flight and its related components out of gen. 2021-10-22 11:30:28 -07:00
Dan Albert
52b9656a1a Remove no-op code.
We won't have set late activation until after this function is called,
and that part does it correctly by checking the player preferences.
2021-10-22 11:30:27 -07:00
MetalStormGhost
79839f83a0
Change AI Su-33 carrier flights to "Takeoff from runway".
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1352
2021-10-20 19:11:22 +00:00
Dan Albert
702e29b54b Fix case of unused aircraft not spawning.
This function was exiting too early causing unused aircraft to stop
being spawned at *any* airfield as soon as the first full airfield was
found.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1566
2021-10-17 13:03:15 -07:00
MetalStormGhost
2a79e4a4e5
Force carrier planes to start at +1s (#1600)
Forces carrier planes with original start_time of zero seconds to have a start time of 1 second. This will prevent them from spawning on the 'sixpack' and functions as a workaround for a DCS problem (deadlock / traffic jam).

Fixes #1309.
2021-10-13 17:10:17 -07:00
Khopa
4399e10cef SA-5 support 🚀 2021-10-12 22:26:59 +02:00
Khopa
43a8897c28 Added MosquitoFBMkVI support (use campaign operation dynamo) 2021-09-19 02:05:08 +02:00
Khopa
e84e36fd22 Merge remote-tracking branch 'khopa/develop' into helipads
# Conflicts:
#	changelog.md
2021-09-08 21:56:45 +02:00
MetalStormGhost
b1fee9fe56
Add an option to use FC3-compatible laser codes.
FC3 aircraft don't have laser codes like all the other aircraft do, they just use 1113.
2021-09-05 02:10:24 -07:00
Starfire13
24a0211d8c Update naming.py 2021-09-02 04:06:44 -07:00
Dan Albert
9c3171f1ce Sort the animal names list.
Make it easier to figure out what's already there.
2021-09-01 18:01:53 -07:00
Dan Albert
90a8bb63dc Fix AI landing behavior.
The landing waypoints need the airdrome_id field set to actually
associate with the airfield. Without this ferry flights will take off
and immediately land at their departure airfield.
2021-08-31 23:06:20 -07:00
Dan Albert
1a4be911c0 Implement ferry flights for squadron transfers.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-31 23:03:27 -07:00
Dan Albert
f9f0b429b6 Set the flight airfields based on the Squadron. 2021-08-31 22:14:00 -07:00
Magnus Wolffelt
056e6b28da
Simplify and rename TACAN registry reserve function (#1559)
* Simplify and rename TACAN registry reserve function

* Remove unused tacan error
2021-08-18 14:46:55 +02:00
Magnus Wolffelt
34ff5fbc6a Allow operation.py to ignore TACAN rules 2021-08-18 00:06:34 +02:00
Magnus Wolffelt
f63a35b1fa
Use TACAN channels more selectively, use pytest (#1554)
* Use TACAN channels more selectively

* Increase tacan range to 126

* Use pytest and add workflow

* Skip faction tests due to outdated test data

* Run mypy on tests directory also

* Use iterators for bands AND usages, add tests
2021-08-17 23:14:54 +02:00
C. Perreau
707d13a65c
Merge branch 'develop' into helipads 2021-08-16 12:20:43 +02:00
Magnus Wolffelt
08365bcbda Simplify and enhance tarcap flight planning 2021-08-16 10:37:44 +02:00
Dan Albert
4423288a53 Assign aircraft to squadrons rather than bases.
This is needed to support the upcoming squadron transfers, since
squadrons need to bring their aircraft with them.

https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-15 17:42:56 -07:00