495 Commits

Author SHA1 Message Date
Khopa
7d07faa5fb Fix last commit error 2020-12-10 21:09:19 +01:00
Khopa
fd70f0fc4a Pydcs extensions and db info added for C-130 Hercules mod ✈️ 2020-12-10 21:07:04 +01:00
walterroach
c54f6ba4d2 Use set instead of dict 2020-12-09 18:25:24 -06:00
walterroach
61ecdfc48c Merge branch 'develop' into you_won 2020-12-09 18:12:18 -06:00
Khopa
1258f3e17c Carrier and Tarawa are now fully moveable 2020-12-10 00:13:34 +01:00
Khopa
44ed895277 Merge remote-tracking branch 'khopa/develop' into develop 2020-12-09 22:55:24 +01:00
walterroach
2ea3f914f0 You Won message #419 2020-12-09 14:37:17 -06:00
Khopa
d6e4a50064 QOL : On launch, auto load the latest saved game. 2020-12-09 21:01:32 +01:00
walterroach
473cda971a Fix typing mistake 2020-12-08 17:16:09 -06:00
Dan Albert
edfaaacd04 Determine player vs enemy early in debriefing.
This way the results of committing the debriefing can't alter the view
of the debriefing. It looks like it was probably that case that
debriefing information displays (but not the committed results) would be
incorrect after a base capture because the results might be shown after
the results were committed.

Maybe fixes https://github.com/Khopa/dcs_liberation/issues/513
2020-12-06 20:20:08 -08:00
Dan Albert
84b8613cf5 Cleanup debriefing signals.
We don't need most of this information.
2020-12-06 20:20:08 -08:00
Dan Albert
e0223ded54 Fix display of AA ranges for most ship types.
Fixes https://github.com/Khopa/dcs_liberation/issues/390
2020-12-06 14:22:33 -08:00
Dan Albert
8f30e60e1b Use unplanned missions to guide aircraft purchase.
AI aircraft purchase decisions are now driven by the missions that the
flight planner was unable to fulfill. This way we're buying the aircraft
we actually need instead of buying them at random, in the locations we
need them, in the order they're needed.

There's a bit more that could be improved here:

* Unused aircraft could be ferried to where they would be more useful.
* Partial squadrons could be completed rather than buying a whole flight
  at a time.
* Aircraft could be ranked by their usefulness so we're not buying so
  many Hueys when a Hornet would do better.
* Purchase a buffer of CAP capable aircraft in case too many are shot
  down and they are not available next turn.

https://github.com/Khopa/dcs_liberation/issues/361
2020-12-06 00:59:04 -08:00
Dan Albert
ce977ac937 Remove the enemy forces multiplier option.
This didn't do what it claimed to (it actually just determines the
threshold for whether a control point shoudl be a *preferred* canidate
for purchasing ground units), and the income multipliers offer the
intended behavior.
2020-12-05 23:55:33 -08:00
Dan Albert
aa9ffa0855 Obey parking limits when auto-buying aircraft.
Fixes https://github.com/Khopa/dcs_liberation/issues/137
2020-12-05 23:36:51 -08:00
Dan Albert
f2d2fd7014 Add automation options to the new game wizard.
To have an effect on turn zero these need to be enabled in the wizard.
Since the last page was getting quite full I've split it into two pages:
one for the objective generation options and a second for the difficulty
and player assist options.

I also added an option to set the inital budget for opfor.
2020-12-05 23:16:17 -08:00
Dan Albert
d519aa1dad Move the AI to the normal procurement system.
The procurement AI now uses the same system as the players. Orders are
placed and take a turn to fulfill.

This has a few advantages:

* We no longer need special case purchase logic for the turn 0
  population of opfor airbases.
* Players using auto-purchase can cancel orders they don't like.
2020-12-05 22:41:05 -08:00
Dan Albert
7226359e64 Avoid negative AI produrement budgets.
This also fixes the double charging that the AI was suffering from, so
they have a much better chance of actually affording planes now.

Fixes https://github.com/Khopa/dcs_liberation/issues/504
2020-12-05 21:50:30 -08:00
Dan Albert
f396ff7f12 Add procurement automation for players.
The allows the players to use the same auto-purchase mechanics that the
AI uses. The behavior is very bad, but it's no worse than what OPFOR
deals with.

There's a lot that needs to be improved before this is really a good
choice for the player:

* Option to adjust budget balance between front lines and airbases.
* Disallow negative budgets (which incidentally will cause more aircraft
  to be purchased, since the armor purchases currently accidentally
  spend the aircraft budget).
* Buy less randomly: https://github.com/Khopa/dcs_liberation/issues/361.
* Obey parking limits.
* Use the delivery events rather than instant delivery (also allows the
  player to cancel orders they don't want).

Fixes https://github.com/Khopa/dcs_liberation/issues/362
2020-12-05 21:18:23 -08:00
Dan Albert
1adee0af17 Factor AI purchases out of Game.
For now this is mostly behavior preserving. I slightly improved the
ability to buy units when multiple front lines exist by removing full
bases as candidates, but it should be a minor change at best. A larger
improvement will come later.

This is also written such that it will work for the player as well. The
procurer currently runs for the player but with all the options off, so
it does nothing. The next patch allows adds options for the player to
use auto-procurement.
2020-12-05 20:42:02 -08:00
Dan Albert
bac47dad83 Add settings for scaling income.
This adds both player and enemy income multiplier options. Note that
previously the AI was only getting 75% of their income. I've changed
that to give them their full income by default since the player can now
influence it.
2020-12-05 18:06:57 -08:00
Dan Albert
f1a2602cfd Move generator only settings out of Settings. 2020-12-05 16:56:14 -08:00
Dan Albert
b8e64d4369 Revert "Revert "Migrate buildings and TGOs to unit map.""
With fixed tracking for TGO groups and fortification "buildings".

Fixes https://github.com/Khopa/dcs_liberation/issues/485

This reverts commit 72ac8ca8724573efa14e5d15880b697aaaa4eacd.
2020-12-05 14:26:16 -08:00
Dan Albert
72ac8ca872 Revert "Migrate buildings and TGOs to unit map."
Not registering kills correctly. It was in my limited testing, so need
to dig deeper.

https://github.com/Khopa/dcs_liberation/issues/494

This reverts commit 90697194a1a4ca67b53eb7b4056e4f7f5416ac58.
2020-12-04 23:57:58 -08:00
Dan Albert
ccb41829c9 Mark an optional property as optional. 2020-12-04 01:10:23 -08:00
Dan Albert
90697194a1 Migrate buildings and TGOs to unit map.
Fixes https://github.com/Khopa/dcs_liberation/issues/485.
2020-12-04 01:10:18 -08:00
Khopa
76840ff5c2 Added display settings to the toolbar. 2020-12-03 22:48:28 +01:00
Khopa
72ac806cb8 Possible to plan ships movements on the map (UI only) 2020-12-03 01:01:15 +01:00
Khopa
cdf28700cf Possible to spawn manpads on frontline even if infantry squads are disabled. 2020-12-01 23:14:07 +01:00
Dan Albert
4f37610dfb Convert front line units to UnitMap.
https://github.com/Khopa/dcs_liberation/issues/485
2020-12-01 01:25:51 -08:00
walterroach
378dbf254a Remove commented code 2020-11-30 23:28:39 -06:00
walterroach
d04be4d71b Merge branch 'develop' into fob 2020-11-30 12:18:38 -06:00
walterroach
3bb08f8d30 FOB names
Remove icon
2020-11-29 16:26:08 -06:00
walterroach
d7787adddc Generators for FOBs and their defenses 2020-11-29 14:21:02 -06:00
walterroach
1f37b879b1 Add FOB ControlPoint type 2020-11-29 12:16:39 -06:00
Khopa
37e23f70d6 Put manpads in modern faction's infantry squads. And added a setting to disable it. 2020-11-29 13:11:49 +01:00
walterroach
292ac42003 Fix campaigns without frontline.
* Missions will now generate without a frontline conflict
* Bulls is now defined as the nearest opposing airfield for each side
2020-11-28 19:53:01 -06:00
walterroach
29b894f8b0 Fix odd frontline unit spawns
* Modfied frontline vector to ensure start point stays outside of
  exclusion zone.  (Previously it could be up to 100m inside)

* Change randomization in offset distance from frontline to be based
  on a percentage of the unit type's fixed offset instead of the
  width of frontline.
  (Prevents units from being far from their expected distance from
  frontline)

* Change visualgen to use the same frontline vector calculation as the
  unit spawns
2020-11-28 18:43:32 -06:00
Dan Albert
55573bf40a Clear loaded scripts before generation.
Every mission generated after the first each time Liberation was
skipping all of the plugins (including the base plugin) because they'd
already been loaded on a previous generation and the list wasn't
cleared.
2020-11-28 15:39:33 -08:00
Khopa
f2c2ef82c5 Fixed unused aircraft using the same slots as used aircrafts. 2020-11-28 22:29:09 +01:00
Khopa
d6b33d353c Now possible to get CVN-75 Harry S Truman supercarrier generated for US faction 2020-11-28 21:57:58 +01:00
Dan Albert
bd60760f9d Merge faction sams and shorads into air_defenses.
Fixes https://github.com/Khopa/dcs_liberation/issues/473. Air defenses
for bases, strike locations, and fixed IADS will now all downgrade to
lower tier systems as needed. Strike locations will still be spawned as
an equally weighted random generator from either the medium or long
range groups, but will use a short range system if none are available to
the faction.

I've made the change in a way that leaves factions compatible, but will
follow up to clean up our built-in factions.
2020-11-27 17:45:40 -08:00
Dan Albert
e8aa9839b0 Fall back to lower range SAMs when needed.
Mostly fixes https://github.com/Khopa/dcs_liberation/issues/473. The
last part of the fix is to migrate the `shorads` property of the faction
to just be in `sams` and just use the property to decide its use.
Currently factions like USA 2005 that have long range SAMs and SHORADs
only will still not spawn anything at medium sites because they have no
other SAMs declared.
2020-11-27 17:45:40 -08:00
walterroach
a9f1de13b1 Fix armor groups spawning bugs
* Prevent common cases where ground units do not spawn due to
  frontline position being in exclusion zone

* Fix case where ground units will spawn inside exclusion zone due to
  random offset from frontline center being fixed

* Remove dead code from `conflictgen.py`

* Start cleanup of `GroundConflictGenerator`
2020-11-27 16:31:52 -06:00
Dan Albert
484f1e8d51 Generate required IADS even at unconnected bases.
If the campaign designer doesn't want SAMs at unconnected bases they can
just not put them there. If they *do* put them there, generate them.
2020-11-26 22:54:50 -08:00
Dan Albert
5d4fccd438 Fix mypy regressions. 2020-11-26 20:08:24 -08:00
Dan Albert
9f078e1483 Don't generate empty groups. 2020-11-26 20:03:16 -08:00
Dan Albert
0e807d84c2 Differentiate required long and medium range SAMs.
To improve IADS design in campaigns, this differentiates required long
and medium range SAMs. SAMs that must be long range SAMs are defined by
SA-10 or Patriot launchers, while medium range SAMs are defined by SA-2,
SA-3, or Hawk launchers.

Long range SAMs positions will only be populated by long range SAMs
(Patriots and SA-10s), and not all factions have those available. Medium
range SAMs currently comprise all air defenses that are not long range
SAMs, so if the faction includes flak guns in their `sams` property then
flak guns may be spawned at medium range SAM locations.

Base defenses and random SAM locations continue to use either type of
SAM.
2020-11-26 19:48:14 -08:00
Ignacio Muñoz Fernandez
3ad57d995b feat: added timestamp to information widget log items 2020-11-26 15:48:16 -08:00
Khopa
87fdc16f9b Update to support the newest version of the Rafale mod. 2020-11-26 21:38:46 +01:00