32 Commits

Author SHA1 Message Date
Raffson
d4eefd0b55
Streamlining 2023-10-01 21:56:30 +02:00
Dan Albert
279572ae09
Add tests for LaserCodeRegistry, clean up.
* Store a deque rather than an iterator so it can be pickled
* Remove mangling from staticmethod (and rename now that it's no longer
  a generator)
* Rename "get" to "alloc" to make the mutation clear
* Move to its own package (the changes I'm working on make this no
  longer mission generator specific)
* Remove useless exception class. It's never caught so the unique type
  isn't needed
2023-10-01 20:11:37 +02:00
Raffson
167d048232
Fix bug in reserve freqs & tacan 2023-09-17 14:25:46 +02:00
MetalStormGhost
115bd8b22a Convert OPFOR untasked flights into Client slots
Added a new option in settings: Convert untasked OPFOR aircraft into client slots. This option will essentially convert the campaign into a sort of team vs. team engagement. There is still no way to plan the OPFOR missions, and there are no guarantees that there even will be any untasked aircraft available for players.

Split the Disable idle aircraft at airfields setting into Disable untasked BLUFOR aircraft at airfields and Disable untasked OPFOR aircraft at airfields.
2023-08-06 12:43:34 +02:00
Raffson
e86fc60b41
Spawn idle aircraft at helipads
Applicable for helicopters at airbases & both helicopters and LHA-capable aircraft at FOBs
2023-07-09 15:14:46 +02:00
Raffson
51fc0215d6
Link landing wpt to pad in flightgroupspawner
Fixes a bug where helipads would try to pop from an empty list
2023-06-25 03:21:58 +02:00
MetalStormGhost
e273e93012
Roadbase and ground spawn support (#132)
* Roadbase and ground spawn support

Implemented support for roadbases and ground spawn slots at airfields and FOBs. The ground spawn slots can be inserted in campaigns by placing either an A-10A or an AJS37 at a runway or ramp. This will cause an invisible FARP, an ammo dump and a fuel dump to be placed (behind the slot in case of A-10A, to the side in case of AJS37) in the generated campaigns. The ground spawn slot can be used by human controlled aircraft in generated missions. Also allowed the use of the four-slot FARP and the single helipad in campaigns, in addition to the invisible FARP. The first waypoint of the placed aircraft will be the center of a Remove Statics trigger zone (which might or might not work in multiplayer due to a DCS limitation).

Also implemented three new options in settings:
 - AI fixed-wing aircraft can use roadbases / bases with only ground spawns
   - This setting will allow the AI to use the roadbases for flights and transfers. AI flights will air-start from these bases, since the AI in DCS is not currently able to take off from ground spawns.
 - Spawn trucks at ground spawns in airbases instead of FARP statics
 - Spawn trucks at ground spawns in roadbases instead of FARP statics
   - These settings will replace the FARP statics with refueler and ammo trucks at roadbases. Enabling them might have a negative performance impact.

* Modified calculate_parking_slots() so it now takes into account also helicopter slots on FARPs and also ground start slots (but only if the aircraft is flyable or the "AI fixed-wing aircraft can use roadbases / bases with only ground spawns" option is enabled in settings).

* Improved the way parking slots are communicated on the basemenu window.

* Refactored helipad and ground spawn appends to static methods _add_helipad and _add_ground_spawn in mizcampaignloader.py
Added missing changelog entries.
Fixed tgogenerator.py imports.
Cleaned up ParkingType() construction.

* Added test_control_point_parking for testing that the correct number of parking slots are returned for control point in test_controlpoint.py

* Added test_parking_type_from_squadron to test the correct ParkingType object is returned for a squadron of Viggens in test_controlpoint.py

* Added test_parking_type_from_aircraft to test the correct ParkingType object is returned for Viggen aircraft type in test_controlpoint.py

---------

Co-authored-by: Raffson <Raffson@users.noreply.github.com>
2023-06-19 00:02:08 +03:00
Raffson
e677a1e910
Add EWR Jammer plugin 2023-06-16 22:42:53 +02:00
Raffson
da109146c9
Fixing issues after using actual Country in Faction 2023-05-18 16:24:49 +02:00
Dan Albert
0608089eb0
Use the actual Country type instead of the name.
We want other pieces of country information (in particular the short
names). This cleans up a lot of code anyway.

As an added bonus, this now catches squadrons that used invalid names
which would previously be passed through to pydcs and... then I don't
know what would happen.
2023-05-14 21:04:09 +02:00
Raffson
b4b19d3ad5
Avoid claiming unused aircraft
Probably the final Fix #97
Unused aircraft (assigned upon takeoff) would get claimed but since it's not possible to delete those flights after aborting, these flights wouldn't get released anymore. This should fix that issue, including a migrator change to correct the number of claimed aircraft per squadron.
2023-05-01 18:12:17 +02:00
Raffson
efd2c40cfc
Avoid generating/planning flights without an operational runway 2023-04-10 14:38:06 +02:00
Raffson
843bb30b99
Improve (SEAD) Escort tasking
- Always use holding point when it's a formation attack FP
- More accurate index for SPLIT wpt in triggered action

cleanup
2023-03-05 23:44:30 +01:00
Raffson
f979a0c23d
Fix heli spawn/landing at FOB/FARP
Resolves #45
2023-02-05 23:32:36 +01:00
Raffson
88f984b0a8
Configurable RF/TCN/ICLS/LINK4 with UI feedback
Resolves #70

Freq/Channel will turn orange when double booked.
Freq will turn red if GUARD freq was assigned.
2023-01-17 18:32:20 +01:00
Raffson
7bae6cd562
Add package frequency
Part of #70
2023-01-13 22:26:58 +01:00
Raffson
989562b90f
Avoid appending triggers without actions
Resolves #67

The problem turned out to be split-triggers with no actions, which occurs when a STRIKE flight has no escorts in its package. Added a guard for this so the trigger isn't pushed to the mission in such a case.
2023-01-05 19:06:31 +01:00
Raffson
6d0ac603f2
Generate packages according to TOT order (latest first, earliest last)
This makes sure that aircraft spawning in the air due to a shortage of parking spots, will have the earliest TOT possible. Flights with later TOTs should be generated first so that they remain at the airfield as OCA target.
2023-01-01 16:56:05 +01:00
Raffson
9ddaf50ad4
Refactor logic wrt "disable idle aircraft" 2023-01-01 16:06:36 +01:00
Raffson
d5de5b3a78
Stack aircraft when spawning right above CP
Should prevent mid-air collisions in most cases, though I'm still worried about "off map" spawns that can possibly collide, though an easy fix would be to manually use time-spacing.
Alternatively we need to treat it as a special case, assigning different altitudes to avoid collisions during the first leg of the flight if that turns out to be the case...
2022-12-18 16:42:38 +01:00
MetalStormGhost
15f6c8dd85
Add new performance option: Disable idle aircraft at airfields (#37) 2022-12-16 18:59:21 +01:00
Raffson
b9c62bc44a
primary flight dead => escort RTB
Make sure trigger isn't activated when split flag was already set to true
2022-12-02 23:08:45 +01:00
Raffson
5f10154000
Add triggered waypoint switch to strike escorts 2022-11-13 22:38:21 +01:00
Raffson
a736bf9b09
"Optimize Imports" in game & qt-ui
Adjustments made by PyCharm
2022-10-24 18:54:41 +02:00
RndName
aa77cfe4b9 Add AirAssault and Airlift mission types with CTLD support
- Add the new airassault mission type and special flightplans for it
- Add the mission type to airbase and FOB
- Add Layout for the UH-1H
- Add mission type to capable squadrons
- Allow the auto planner to task air assault missions when preconditions are met
- Improve Airlift mission type and improve the flightplan (Stopover and Helo landing)
- Allow Slingload and spawnable crates for airlift
- Rework airsupport to a general missiondata class
- Added Carrier Information to mission data
- Allow to define CTLD specific capabilities in the unit yaml
- Allow inflight preload and fixed wing support for air assault
2022-06-09 22:45:29 +02:00
Dan Albert
005090fbcd Support display of dead flights. 2022-03-07 19:34:51 -08:00
RndName
ad0d3412fb
Cleanup helipad creation and heli spawn 2022-02-24 23:21:17 +01:00
Dan Albert
ac80c4adc1 Finish moving gen into game. 2022-02-22 00:10:31 -08:00
Dan Albert
cba68549d8 Add a UUID -> Flight database to Game.
This will be expanded with other types as needed.
2022-02-19 12:57:41 -08: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
Dan Albert
c8f30b3289 Split aircraft spawning into its own class. 2021-10-23 20:51:39 -07:00
Dan Albert
88b4039e47 Clean up AircraftGenerator.
This class does far too many things and the file is huge. Split it up
into a few more classes.
2021-10-23 20:18:40 -07:00