15 Commits

Author SHA1 Message Date
Dan Albert
ac80c4adc1 Finish moving gen into game. 2022-02-22 00:10:31 -08:00
RndName
2c17a9a52e Refactor Templates to Layouts, Review and Cleanup
- Fix tgogenerator
- Fix UI for ForceGroup and Layouts
- Fix ammo depot handling
- Split bigger files in smaller meaningful files (TGO, layouts, forces)
- Renamed Template to Layout
- Renamed GroundGroup to TheaterGroup and GroundUnit to TheaterUnit
- Reorganize Layouts and UnitGroups to a ArmedForces class and ForceGroup similar to the AirWing and Squadron
- Reworded the UnitClass, GroupRole, GroupTask (adopted to PEP8) and reworked the connection from Role and Task
- added comments
- added missing unit classes
- added temp workaround for missing classes
- add repariable property to TheaterUnit
- Review and Cleanup

Added serialization for loaded templates

Loading the templates from the .miz files takes a lot of computation time and in the future there will be more templates added to the system. Therefore a local pickle serialization for the loaded templates was re-added:
- The pickle will be created the first time the TemplateLoader will be accessed
- Pickle is stored in Liberation SaveDir
- Added UI option to (re-)import templates
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
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
SnappyComebacks
bf034e18eb
Add preset formations to different flights and waypoints. (#1948)
* Update pydcs version.
* Add formation presets for various flight types.
2022-01-16 14:49:17 -07:00
SnappyComebacks
a013d27d17
Add ECM behavior to not Air to Air flights (#1879)
* If a plane has a jammer, and it is not an air to air flight it will jam between join and split.
2022-01-01 16:49:04 -07:00
Dan Albert
66c8b96c9a Update dependencies. 2021-11-20 18:45:27 -08: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
e6fc817f49 Use uncontrolled for late shore starts.
These should be uncontrolled rather than late activation so that they
are present in the parking area as OCA targets. This bug was introduced
as a mistranslation when I was moving from strings to StartType.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1695
2021-11-06 16:40:09 -07:00
Dan Albert
7a18d160c8 Add missing NavalControlPoint case for BAI.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1702
2021-11-06 16:35: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
b2cbf4b6f4 Halt sim on A2A contact.
https://github.com/dcs-liberation/dcs_liberation/issues/1681
2021-10-30 10:18:49 -07:00
Dan Albert
cd0c0f1b01 Fix missing waypoint generation for most flights.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1693
2021-10-26 19:29:50 -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
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