30 Commits

Author SHA1 Message Date
MetalStormGhost
1ebc289fb7 Added support for ground power truck types in farp_truck_types_for_country(). Aircraft which require ground power to start, when ground power trucks have been disabled for performance reasons, will now be warm started automatically. 2023-10-06 07:58:06 +02:00
Raffson
d4eefd0b55
Streamlining 2023-10-01 21:56:30 +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
8c29071d04
Fix AI RTB immediately with forced air-start 2023-06-15 03:49:32 +02:00
Raffson
7582040d41
Allow harriers to operate from FOBs/FARPs
Resolve #109
2023-05-28 21:05:17 +02:00
Raffson
f979a0c23d
Fix heli spawn/landing at FOB/FARP
Resolves #45
2023-02-05 23:32:36 +01:00
Raffson
37f2e5bf3a
Use stacking algorithm in "_generate_over_departure"
Resolves #57

"_generate_over_departure" is the method used to generate flights in the air when no more parking spots are available. Pydcs changes were required as it turned out aircraft were trying to spawn on helicopter parking spots, which forces them to start in the air by DCS itself.
2023-01-01 16:56:04 +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
0c30ce3bb3
Revert "Revert "Add support for the AI-only F-14A."" (#27)
This reverts commit 920c9b15ff815b5df08ff90c4a6b0a10cce3e169.
2022-12-03 14:31:40 +01:00
Raffson
004a99e080
Cleanup 2022-11-13 22:38:24 +01:00
Raffson
395969a371
Initial attempt at fixing escorts 2022-11-13 22:38:20 +01:00
Dan Albert
920c9b15ff
Revert "Add support for the AI-only F-14A."
AI behavior with the Heatblur F-14 has been fixed, so not needed any
more.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1927.

This reverts commit 7387c2ed8f1662686b9df63ad9e6dc4808eee8b0.
2022-10-02 19:56:49 +02:00
Raffson
746eda70ee
In-Flight spawn: Minimum AGL altitude (#2302)
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2212
2022-07-06 18:56:39 +00:00
Dan Albert
039ac9ec74 Replace CP integer ID with a UUID.
This allows unique identification across saves. The front-end needs to
be able to differentiate the first carrier in game A and the first
carrier in game B, but because carriers (and other non-airfield CPs) are
assigned IDs sequentially, collisions were to be expected. The front-end
can't tell the difference between a reloaded game and a new turn, so we
need to ensure different IDs across games.

This is a handy cleanup anyway, since callers constructing CPs no longer
need to manually track the CP ID counter.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2078.
2022-03-20 16:00:29 -07:00
RndName
ad0d3412fb
Cleanup helipad creation and heli spawn 2022-02-24 23:21:17 +01:00
RndName
6f8c30ec81
Fix helicopter spawning inside each other
Also use NoParkingSlotError for better error handling if no helipads are available
2022-02-24 21:47:37 +01:00
Dan Albert
9e2e4ffa74 Update pydcs, adapt to new Point APIs.
This is briefly moving us over to my fork of pydcs while we wait for
https://github.com/pydcs/dcs/pull/206 to be merged. The adaptation is
invasive enough that I don't want it lingering for long.
2022-02-23 01:02:48 +00:00
Dan Albert
ac80c4adc1 Finish moving gen into game. 2022-02-22 00:10:31 -08:00
Dan Albert
df7be8603b Clean up some uses of Point to prep for update. 2022-02-21 18:12:59 -08:00
Ben Birch
a70a951192 Add all helipads to single group per FARP allowing take off from parking behavour and fixes #1910 2022-01-30 15:04:53 +11:00
Dan Albert
e80851b0a1 Impose minimum altitude for mid-mission spawns.
We had this for the old style in-flight spawns, but not for mid-mission
spawns. Aircraft that were spawning soon after takeoff could potentially
be close to (or under) the ground, causing them to "crash" at game
start. The altitude is different here than for the old style in-flight
spawns to try to get closer to the intended spawn location.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1941
2022-01-24 17:43:41 -08:00
Dan Albert
2499276b2a Fix helicopters at airfields breaking generation.
Helipads at airfields don't work well right now because they are not
counted as additional parking, but we should still allow them to take
off from the airfield parking.

Follow up work would be to fix the parking problem and allow adding
helipads to airfields, or maybe to just "ground" start helicopters at
airfields so they take off from parking rather than the runway.

May fix https://github.com/dcs-liberation/dcs_liberation/issues/1890
2022-01-24 17:17:00 -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
Dan Albert
9c0f72921f Randomly offset mid-mission spawns.
This is what we do for the old in-air starts too. It's not perfect but
it's not a regression either.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1754
2021-11-18 17:07:24 -08:00
Dan Albert
dac3533654 Tone down the out-of-parking message.
There's nothing the user can do about this and it's somewhat expected,
so downgrade to a warning so users don't think it's a bug.

If we ever get around to doing more cautious parking allocation this
should become a generation-halting error, but until then we expect it to
happen somewhat often.
2021-10-30 13:12:11 -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
Dan Albert
c8f30b3289 Split aircraft spawning into its own class. 2021-10-23 20:51:39 -07:00