Jump to content

Autonomous CAP and GCI AI fighter script


SNAFU

Recommended Posts

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Ok that's interesting, possibly it is a side effect of me making the reset task interval so long. There is an interceptor RTB routine already that is supposed to send them home/back to zones if no border violations are in progress or if no borders then no hostiles on radar and there is similar to your code snippet Hijack in the reset task routine. All I can think is that either DCS internal logic has taken over - ie they have spotted something enemy so hang around - or there is a problem in the code although I've no idea what at this point in time.

 

There is an intermittent problem with CAP fighters getting seemingly lost and flying right off the map and returning much later presumably low on fuel but as I said it only happens occasionally and I've never been able to figure out whether it is a script error or a DCS error like the landing in pairs close formation issue.

 

By the way the CAP and GCI aircraft will hit ground targets or aircraft on the ground so potentially that is what they are seeing????

 

I will try to see if I can see something like you describe while testing the new version and if found try to correct it. It may also be tied up with the ROE changes that happen when they are assigned an intercept.

 

 

<edit> Greyl, I can't remember off the top of my head and I'm on a 5 min loo break between pouring loads of concrete so can't spend time checking but if the red radar coverage encapsulates the blue bases or comes near you may reduce the CAP camping issue by moving them rearwards a bit so that incoming intruders are picked up closer to the border and intercepted later leaving the CAPs further away from nice snacks.


Edited by Stonehouse
Link to comment
Share on other sites

Hi Stonehouse. Thanks for your script.

 

I am having a little trouble getting things working. I have tracked it down to the following Debug message:

 

C:\Users\...\Appdata\Local\Temp\DCS\/~mis00003088:295 attempts to access global 'mist' (a nil value)

 

here's the line 295

if mist.DBs.zonesByName[redAFids:getName()] then

 

I have used the Mission Start trigger to call up MIST.lua (I renamed the version title to generic MIST in case the version changes).

 

Can you tell me what may be wrong? I'm attaching the .miz, file and lua's in case they help.

Korea_Late_51_GCICAP.miz

Korea_Late_51_GCICAP.lua

MIST.lua

klem

56 RAF 'Firebirds'

ASUS ROG Strix Z390-F mobo, i7 8086A @ 5.0 GHz with Corsair H115i watercooling, Gigabyte 2080Ti GAMING OC 11Gb GPU , 32Gb DDR4 RAM, 500Gb and 256Gb SSD SATA III 6Gb/s + 2TB , Pimax 8k Plus VR, TM Warthog Throttle, TM F18 Grip on Virpil WarBRD base, Windows 10 Home 64bit

Link to comment
Share on other sites

No worries Klem, the error seems to indicate that mist is not loaded prior to GCICAP running but will look at the mission and let you know what I find.

 

Cheers,

Stonehouse

 

PS I am just the latest custodian there have been quite a few hands involved in getting GCICAP to this point ;D It definitely is not all me lol

Link to comment
Share on other sites

Hi Klem,

Ok looked through your mission and found the following things for you to look at.

 

I think your main problem is you've somehow got some files misnamed and so got tangled up.

 

First up in your posted mission file the file you've named MIST.lua is actually a out of date copy of the GCICAP script so will straight away be responsible for the error you are seeing. I suggest you replace this with a fresh copy of Mist 3.6.44 (https://github.com/mrSkortch/MissionScriptingTools/releases/tag/3.6.44)

 

Second the version of GCICAP you are using is out of date please go to http://457stonehouse.github.io/GCICAP/ and get the latest which will also give you a comprehensive manual for the script.

 

Lastly three other points some minor and one major:

 

 


  1. You have one of your border helicopters not set as late activation so it appears in mission
  2. You have one of your blue cap zones named bluCAPzone1 (or 2 sorry can't remember which it was) rather than blueCAPzone1
  3. When you have edited the GCICAP script you have gone down into the part which is normally not edited (circa line 279 in your copy of the script) and changed things so there is:

 

 

local redCAPzone1 = 'redCAPzone1'

local redCAPzone2 = 'redCAPzone2'

local blueCAPzone1 = 'blueCAPzone1'

local blueCAPzone2 = 'blueCAPzone2'

 

 

 

This isn't something you want to do as what the script actually does is append the string 'redCAPzone' to the number 1 up to the max number of red cap zones you have defined and go looking for the trigger zone with the constructed name (ditto for the blue ones). What you have done will break the script entirely unless you follow through and update all the relevant code portions.

 

Have a read of the manual when you download the new version of GCICAP and if you have questions then post them up and either myself or one of the others experienced in using the script will happily help you out.

 

I did get a version of your mission running the GCICAP script after taking care of all the above but didn't attach it as I basically removed everything that wasn't GCICAP related to make it easier to figure out the issues. I strongly recommend to everyone using GCICAP to make that the very first thing you put in your mission and verify it is working before adding additional layers as going back and trying to find the issues later is much harder.

 

Cheers,

Stonehouse


Edited by Stonehouse
Link to comment
Share on other sites

Hi Klem,

Ok looked through your mission and found the following things for you to look at.

 

I think your main problem is you've somehow got some files misnamed and so got tangled up.

 

First up in your posted mission file the file you've named MIST.lua is actually a out of date copy of the GCICAP script so will straight away be responsible for the error you are seeing. I suggest you replace this with a fresh copy of Mist 3.6.44 (https://github.com/mrSkortch/MissionScriptingTools/releases/tag/3.6.44)

 

Second the version of GCICAP you are using is out of date please go to http://457stonehouse.github.io/GCICAP/ and get the latest which will also give you a comprehensive manual for the script.

 

Lastly three other points some minor and one major:

 

 

  1. You have one of your border helicopters not set as late activation so it appears in mission
  2. You have one of your blue cap zones named bluCAPzone1 (or 2 sorry can't remember which it was) rather than blueCAPzone1
  3. When you have edited the GCICAP script you have gone down into the part which is normally not edited (circa line 279 in your copy of the script) and changed things so there is:

 

 

local redCAPzone1 = 'redCAPzone1'

local redCAPzone2 = 'redCAPzone2'

local blueCAPzone1 = 'blueCAPzone1'

local blueCAPzone2 = 'blueCAPzone2'

 

 

 

This isn't something you want to do as what the script actually does is append the string 'redCAPzone' to the number 1 up to the max number of red cap zones you have defined and go looking for the trigger zone with the constructed name (ditto for the blue ones). What you have done will break the script entirely unless you follow through and update all the relevant code portions.

 

Have a read of the manual when you download the new version of GCICAP and if you have questions then post them up and either myself or one of the others experienced in using the script will happily help you out.

 

I did get a version of your mission running the GCICAP script after taking care of all the above but didn't attach it as I basically removed everything that wasn't GCICAP related to make it easier to figure out the issues. I strongly recommend to everyone using GCICAP to make that the very first thing you put in your mission and verify it is working before adding additional layers as going back and trying to find the issues later is much harder.

 

Cheers,

Stonehouse

 

Many thanks Stonehouse. I did follow the manual but it looks like a lot of finger trouble on my part!

 

I have it working now. One thing surprised me, the enemy GCI a/c spawn and take off as soon as I leave the ground but before I enter their Radar coverage. Same with my GCIs when their GCIs leave the ground outside my radar coverage. Is that correct?

 

Also, do you know of a way to get the GCI messages to have pauses in them to let other messages come through? At the moment they are continuous and hog the message box.

 

Thanks again.

klem

56 RAF 'Firebirds'

ASUS ROG Strix Z390-F mobo, i7 8086A @ 5.0 GHz with Corsair H115i watercooling, Gigabyte 2080Ti GAMING OC 11Gb GPU , 32Gb DDR4 RAM, 500Gb and 256Gb SSD SATA III 6Gb/s + 2TB , Pimax 8k Plus VR, TM Warthog Throttle, TM F18 Grip on Virpil WarBRD base, Windows 10 Home 64bit

Link to comment
Share on other sites

Not sure, you have noborders = 1 so as soon as the ground radars detect an enemy aircraft they will order GCIs to launch. Perhaps double check the radar ranges rings on the map they may see further than you realise - if you are getting GCI messages then the targets have been picked up by radar.

 

To be honest these days I find Ajax's AWAC's script to be much better than my simple GCI messages and I am using the GCI messages almost as a debug message to tell me when something gets detected and turn them off for the finished mission. You are right though and they do hog the message box particularly if there are a lot of intercepts happening.

 

Don't have a link handy but if you do a search you should find it.

 

Cheers,

Stonehouse

 

PS actually do have a link http://www.159thgar.com/forums/viewtopic.php?p=75796&sid=fed0e9563766f3c802019398a141e04b but please be sure to credit Ajax if you use it


Edited by Stonehouse
Link to comment
Share on other sites

Not sure, you have noborders = 1 so as soon as the ground radars detect an enemy aircraft they will order GCIs to launch. Perhaps double check the radar ranges rings on the map they may see further than you realise - if you are getting GCI messages then the targets have been picked up by radar.

 

To be honest these days I find Ajax's AWAC's script to be much better than my simple GCI messages and I am using the GCI messages almost as a debug message to tell me when something gets detected and turn them off for the finished mission. You are right though and they do hog the message box particularly if there are a lot of intercepts happening.

 

Don't have a link handy but if you do a search you should find it.

 

Cheers,

Stonehouse

 

PS actually do have a link http://www.159thgar.com/forums/viewtopic.php?p=75796&sid=fed0e9563766f3c802019398a141e04b but please be sure to credit Ajax if you use it

 

 

Thanks Stonehouse. I've a Korea mission and I think for now I'll stick with GCICAP because it's simple and is nearer to the radar systems of the time (no AWACS).

 

EDIT: CRACKED IT!

GCICAP is working now. I just had that problem with the message timings. The mist messages timings were mostly set at a fixed value of 1. In particular around line 4270 was

if #clientDisplay > 0 then

trigger.action.outTextForGroup(clientData.groupId, table.concat(clientDisplay),1)

now reads

if #clientDisplay > 0 then

trigger.action.outTextForGroup(clientData.groupId, table.concat(clientDisplay), displayTime)

 

I changed all the likely cockpit messages to displayTime.

 

Thanks for all your help.


Edited by klem

klem

56 RAF 'Firebirds'

ASUS ROG Strix Z390-F mobo, i7 8086A @ 5.0 GHz with Corsair H115i watercooling, Gigabyte 2080Ti GAMING OC 11Gb GPU , 32Gb DDR4 RAM, 500Gb and 256Gb SSD SATA III 6Gb/s + 2TB , Pimax 8k Plus VR, TM Warthog Throttle, TM F18 Grip on Virpil WarBRD base, Windows 10 Home 64bit

Link to comment
Share on other sites

  • 1 month later...

Hi there......

 

 

I have made so much tries to get this working.....but guess what?

 

Yep, it didnt !!! :mad:

 

I have no clue what went wrong....maybe someon of you can help me...

 

I've added the mission

 

Thx

 

QUAX WW2 v2.0a_test.miz

My Rig: Windows 11 Pro, Intel i7-13700k@5.4GHz, 64GB DDR5 5200 RAM, Gigabyte Z790 AORUS Elite AX, 1TB Samsung EVO 970, RTX4080, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals, LG 32" 4K 60FPS, ACER 30" 4K 60FPS GSync Display, HP Reverb G2 V2

Link to comment
Share on other sites

Hi Quax,

Sorry for lack of response I've been away for the last couple of weeks and couldn't access the internet much where we were. Anyway just got back this afternoon so will check out your test mission as soon as we're unpacked and back to normal. Should get back to you in the next day or so.

 

Cheers,

Stonehouse

Link to comment
Share on other sites

Hi Quax,

Ok downloaded your mission and went through it and the issue is actually only small but unfortunately as I know too well myself is sometimes hard to spot. The problem is that the script is expecting the CAP and GCI templates to have __CAP__ and __GCI__ prefixes but you have only a single underscore ie _CAP_.

 

That's all that is stopping it from working. As an FYI I did my test runs of your mission with MIST 3.7.48 where you are using 3.6.44 so you may want to upgrade the version you are using as there was a particular release of MIST that had some problems in the 3.6 series. Can't remember the exact one sorry. Only other thing to perhaps suggest is that I feel sorry for the P51s trying to intercept the Tu95s as they don't have much chance considering they are slower and have to climb to the Tu95s height. Maybe give the Tu95s a lower height and speed. On the other hand the 109s have a much happier time with the B29s lol ;D

 

Also if you turn off the alert messages (which I understand as they do tend to spam things a bit) you may want to look at Ajax's AWACs script which works very nicely to act like a ground controlled radar intercept system for players.

 

Cheers,

Stonehouse

Link to comment
Share on other sites

What shall I say other like a MINION "Whaaaaaaat"

 

Dow, shame on me......thats it.....double underline.....grmpf.....

 

Thx a lot my dear friend :D

 

May the force be with you ^^

 

Regards

My Rig: Windows 11 Pro, Intel i7-13700k@5.4GHz, 64GB DDR5 5200 RAM, Gigabyte Z790 AORUS Elite AX, 1TB Samsung EVO 970, RTX4080, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals, LG 32" 4K 60FPS, ACER 30" 4K 60FPS GSync Display, HP Reverb G2 V2

Link to comment
Share on other sites

Short Feedback.......it works :lol:

My Rig: Windows 11 Pro, Intel i7-13700k@5.4GHz, 64GB DDR5 5200 RAM, Gigabyte Z790 AORUS Elite AX, 1TB Samsung EVO 970, RTX4080, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals, LG 32" 4K 60FPS, ACER 30" 4K 60FPS GSync Display, HP Reverb G2 V2

Link to comment
Share on other sites

Well.....

 

I have to say BIG BIG THX to "MR. Stonehouse". This script is such a good thing. Now it's so easy to create a living mission...... :thumbup:

 

But a little question I still have. Sometimes some units do warping like hell. I don't know if the reason is this script, but I don't have it in other missions....

 

Would be nice to here what others say and if the developer is able to fix it or EAGLE DYNAMICS can do something. Maybe programming an stable online Engine :D ???

 

Joke.....

 

However.......great Job Stonehouse

My Rig: Windows 11 Pro, Intel i7-13700k@5.4GHz, 64GB DDR5 5200 RAM, Gigabyte Z790 AORUS Elite AX, 1TB Samsung EVO 970, RTX4080, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals, LG 32" 4K 60FPS, ACER 30" 4K 60FPS GSync Display, HP Reverb G2 V2

Link to comment
Share on other sites

Yeah we've had discussions about micro stutters and such previously and basically it appears that it is getting to be too much happening under the covers. Unfortunately of all the people who have been involved in getting it to this point none of us are sufficiently good at lua to rewrite it for better performance. Which is a shame as one of my long term hopes was to add recon and auto generated ground strikes against targets the recon flights spot but even the last wip version which was to fix up some logistic issues has bogged down due to real life work and home pressures. Maybe my next vacation will help it get finished lol.

 

Cheers,

Stonehouse

Cheers,

Link to comment
Share on other sites

Wonderful script!

What sizes do you recommend for the cap zones? Does the size of them even matter? And how far should they be from the borders / enemy zones for a cold war scenario? My scenario will turn hot during the mission though..

I have f-15c, f-16blk52 and f/a-18 on blue and mig-21, 31, 29s and su-27 on red


Edited by MasterZelgadis

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Link to comment
Share on other sites

There are not really any hard and fast rules and you can change size of zones and whether they are right on the border or further back and whether the airbases where the CAP flights launch are within the zone to help balance and control the pace of the mission ie how fast it turns into a furball. Usually I would say at least 20kms though unless your mission needs to have them smaller. That's really just to give the guys on patrol some room to fly around in.

 

Also how close to the border you place the radar units has a reasonably high impact as well. ie the sooner intruders are detected the sooner flights will launch to intercept. This is particularly the case when you have borders turned off. If you have a look on the github site (link in post #1 in thread) you'll see a pdf manual to download which does go over some of this sort of thing. Realistically though you need to think about what you would like to see happen, place the zones and radars etc accordingly and then play test and tweak until you get the mission you want. I usually start with the border, then the airbases and objectives and go from there trying to come up with a plausible deployment that also gives me the pace of mission I want.

 

Hope that helps a bit.

 

Cheers,

Stonehouse

Link to comment
Share on other sites

That helps, thanks. Already saw the pdf and used it for the setup.

Though a lot of testing will be needed.. My situation is, that red has only 1 ewr relatively close to the borders and blue should be able to sneak through some valleys to avoid early detection. When blue is detected inside red borders the war turns hot and blue caps should somehow support the attack by taking care of the red cap flights. On the other hand red flights should not be a too high threat to the A-10s destroying the red ewr.

 

One last question, if I may: when there is no ewr on one side, will it still spawn cas flights and only stop spawning gci? Or will it spawn nothing anymore?


Edited by MasterZelgadis

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Link to comment
Share on other sites

Ok you will need to tweak that quite a bit to get the balance right. At the moment if the borders are present intercepts will only be launched against intruders ie blue will launch against detected red aircraft in blue airspace and vice versa.

 

So you will get red launching on the intruding blue aircraft but you will not get blue launching across the border to help the blue aircraft under attack in red airspace. To get something like that you would have to go for no borders and position the radars very carefully or perhaps place some near the border but have them off until a trigger turns them on and some at the rear to cover the general centre of the sides airspace. It would take some experimentation. Additionally at present the script doesn't really handle airbase captures (in case that is in your mind) although that plus making the border be able to be switched on and off during the mission is on the dream list for enhancements. Radar detection is pure DCS and the script just uses the features. I believe terrain masking is part of the DCS ground radar model but could be wrong.

Link to comment
Share on other sites

Switching the border should not be a big problem, I changed your script so the noborders variable is not local. With a trigger I switched it from 0 to 1 during the mission. That seemed to work.

No, my mission is not about capturing an airbase, it's an attack on a FARP. But Capturing should not be a problem either, you could delete the trigger zone after capture, so no flights will start there. Or does the script initialize the zones only in the beginning? But even then it should be doable.

Blue flights starting from a fresh captured red airbase would be unrealistic anyway.


Edited by MasterZelgadis

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Link to comment
Share on other sites

That's really interesting it was so easy although I'm so bogged down with work at the moment I haven't really been thinking about the script much except to support people asking questions. Yes the script initialises the tables for the airbases for each side at the start only but agree it is definitely doable even for me - not new to programming but only really began looking at lua very recently so struggle with it at times as it is quite different to what I normally work in. I'd be very interested in seeing your mission and version of the script when you are done if you are willing to share.


Edited by Stonehouse
Link to comment
Share on other sites

Of course I am.

Currently there are even 2 more "bigger" scripts in it, the CTLD script and the medevac script. Still running without any performance problems, even with noborders on :D

 

Short recap what the mission currently is about:

- Fly troops to a red FARP using the mountains as cover from the enemy EWR. (2x Mi-8 )

- Provide CAS for the Helos and detroying the EWR early (2x A-10C)

- After capturing the FARP fly in more troops, vehicles and/or a HAWK site to prepare for a counterattack. It will be up to the players what units they will fly in, time is not enough to fly in everything, so they must decide which units and where they place them. For vehicles and HAWK of course you need more crates. This is already in the CTLD script. (the 2 Mi-8 flights)

- The counterattack will consist of random units, maybe 3-4 templates, a random trigger will decide which "template" will do the counter attack. Maybe the Mi-8 flights will get some hints during the build phase which units they could expect, so they can adapt their strategy

- Still providing CAS during the counterattack. A-10s will have to refuel either in air or by returning to base (2x A-10C)

- Medevac flights on standby to extract shot down pilots and vehicle crew (2x Huey)

- CAP to support the blue forces, no complex scripting or triggering here, your script gives them enough to do ^^ (2x F-15C)

- Essential for the mission will be only the Mi-8 and A-10C flights, so you won't need to use all slots

 

Maybe I get some aditional ideas for the CAP and Medevac flights though..

 

After beginning to create some missions without completing them this time it looks really good that I can complete this. Would be my second released mission then ^^


Edited by MasterZelgadis

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...