dcs-liberation / dcs_liberation

DCS World dynamic campaign.
GNU Lesser General Public License v3.0
718 stars 184 forks source link

Have autoplanner consider control point spacing for BARCAPs #1997

Open SnappyComebacks opened 2 years ago

SnappyComebacks commented 2 years ago

Is your feature request related to a problem? Please describe. The autoplanner will attempt to create BARCAPs for every friendly control point. If two control points are very close together, the BARCAPs will have significant overlap.

Describe the solution you'd like Either:

Starfire13 commented 2 years ago

If there are two control points close together, wouldn't they also in theory attract twice the amount of A2G activity to the area, and therefore need more CAP to handle it?

SnappyComebacks commented 2 years ago

If there are two control points close together, wouldn't they also in theory attract twice the amount of A2G activity to the area, and therefore need more CAP to handle it?

I think that depends on how the autoplanner works. And twice as many opposing objectives does not necessarily mean that there are twice as many aircraft available to attack.

DanAlbert commented 2 years ago

The fact that BARCAPs are assigned to CPs is sort of the problem here. They're not supposed to guard an airfield, they're supposed to create a barrier. The fix here should be to assign BARCAPs to arbitrary locations along the red/blue border.

SnappyComebacks commented 1 year ago

The fact that BARCAPs are assigned to CPs is sort of the problem here. They're not supposed to guard an airfield, they're supposed to create a barrier. The fix here should be to assign BARCAPs to arbitrary locations along the red/blue border.

Dredging up an old topic here, but a few questions:

  1. Do CAPs over friendly bases deep within friendly lines make sense? Are there targets so important that they demand a CAP over them always?
  2. How would the user make a new BARCAP? Right click any point on the map and see Plan BARCAP at closest border?
  3. Is it presently possible to have a flight be untied to any base at the moment, code wise?
DanAlbert commented 1 year ago

tbh, I think this FR is best left ignored until intercept missions are in place. BARCAP is going to be a lot less relevant once the turnless stuff makes intercept viable.

Do CAPs over friendly bases deep within friendly lines make sense? Are there targets so important that they demand a CAP over them always?

BARCAP? No. HAVCAP? Yes. That's not really a meaningful distinction in terms of AI behavior though, just a name.

I think when this is properly fixed (BARCAPs are assigned to positions to create a barrier around friendly airspace), it will still sometimes (not always) be worthwhile to assign a patrol to defend a factory, important resource node, or C4I node.

How would the user make a new BARCAP? Right click any point on the map and see Plan BARCAP at closest border?

If you plan BARCAP on a border the border moves though. The "borders" are defined by BARCAP and air defense engagement areas.

This is the part of this that's hard. Someone needs to figure out how to autogenerate the "border" that should be defended, and assign the BARCAPs to protect that. In a lot of campaigns (many are very, very cramped) there is no reasonable place for BARCAPs to be because the AI is not good at that. Instead of defending, they'll attack the enemy BARCAP, which will leave the area that they were supposed to protect undefended.

It's actually really trivially easy for campaigns where there's some room between the objectives like Black Sea or Abu Dhabi (the latter only in the initial stages), because the two "home" territories have a ton of space between them. You can create a good sized bubble around the space you want to protect that doesn't include enemy bases. That's not my experience with most other campaigns.

Is it presently possible to have a flight be untied to any base at the moment, code wise?

Eh, kind of. There must be a MissionTarget, which is something with a name and a position. It was never really meant to refer to something that isn't persistent, and I'm not confident that using it for arbitrary locations won't expose bugs.

SnappyComebacks commented 1 year ago

tbh, I think this FR is best left ignored until intercept missions are in place. BARCAP is going to be a lot less relevant once the turnless stuff makes intercept viable.

I'm curious why you think this? As I understand it, intercepts can only be planned against enemy flights you know about, and BARCAPs are for the flights that you don't know about. Or is there more to it that I don't see/understand?

If you plan BARCAP on a border the border moves though. The "borders" are defined by BARCAP and air defense engagement areas.

Do you feel like the border for BARCAP is not where the friendly navmesh transitions from green to red? Granted, this makes some interesting conflicts as Blue's navmesh is quite different from Red's navmesh. (An alternative would be using intersection and complements to get something like the purple area attached, because saying red's red navmesh intersecting blue's red navmesh complement and vise versa is confusing)

image

(Paraphrased) Good placement is hard to do.

I agree, I don't know if I'd be able to come up with a good solution.

DanAlbert commented 1 year ago

tbh, I think this FR is best left ignored until intercept missions are in place. BARCAP is going to be a lot less relevant once the turnless stuff makes intercept viable.

I'm curious why you think this? As I understand it, intercepts can only be planned against enemy flights you know about, and BARCAPs are for the flights that you don't know about. Or is there more to it that I don't see/understand?

Maybe I've misunderstood the motivation here. Usually folks seem to want BARCAPs to work differently because of the quantity of planes it uses. Once intercept works we can probably stop planning all but a few BARCAP targets. Maybe that assumption is wrong though.

Do you feel like the border for BARCAP is not where the friendly navmesh transitions from green to red?

That's based on the threat zone, which is based on where BARCAPs are planned. That's a circular dependency.

I agree with the general principle of the image you have, FWIW. There just isn't any way to make DCS AI defend against enemies that cross a line, afaik. The only limit we can given them is to engage stuff within a circle. If you define a circle where it's circumference roughly guards that line, you end up with a BARCAP that's flying over the carrier, which is basically what we have today :(

(This is one of few places where MOOSE might offer functionality we can't provide simply, but idr if that's in MOOSE, and idk the performance cost of doing so.)

Starfire13 commented 1 year ago

Right now, the BARCAP behaviour is like there's a forest on fire and the fire department sends two firefighters to each house in the area, instead of to some spot between the houses and the forest. Trouble is getting the autoplanner to determine where that barrier ought to be. I'm concerned that even though the current implementation is hardly realistic and resource-heavy (in terms of aircraft needed), the alternative may end up being less effective. This also highlights the issue with frontline TARCAP oftentimes doubling as both anti-CAS as well as BARCAP (and ending up inadequate for the task) because it is quite common for a significant portion of ingressing enemy flights to fly over or near the frontline, entering the frontline TARCAP's engagement zone.

DanAlbert commented 1 year ago

I don't really have any good ideas for how to reduce the BARCAP spam in the short term that won't result in opfor putting up less of a fight (the game's already too damn easy, we don't need to make it easier). The plan in the OP might be a step in the right direction, but like @Starfire13 says, them being closer together means there will probably also be more missions in the area that need to be countered.

Campaign designers have a lot of tools to avoid this though. Use fewer airfields and more FOBs. The game is balanced around that anyway.