Announcement

Collapse
No announcement yet.

Autonomous CAP and GCI AI fighter script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Autonomous CAP and GCI AI fighter script

    ---------------------------------------------------------
    Stonehouse continued the work on the script and improved it:
    please look here: http://forums.eagle.ru/showpost.php?...&postcount=372

    Originally posted by Stonehouse View Post
    In the interest of making life easier for everyone I've (with some feedback and assistance from Snafu and Rivvern) moved the script onto GitHub. As part of the move I have also finally written up a user guide and Rivvern is looking at creating a checklist/quick start/memory aid one pager for people who have used the script before but need a memory jogger to make sure they've done all the bits. Access is via this website

    http://457stonehouse.github.io/GCICAP/

    Snafu could you please update your first post when you have a spare moment? Thanks.

    This thread remains now for support and discussion use and all releases will be via Github.

    Hope this works well for everyone.

    Cheers,
    Stonehouse
    -----------------------------------------------------------------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------------------------------------------------------------

    Additionally "lukrop" is working on this idea and rewrote the script:


    You find his latest updates here:
    https://github.com/lukrop/GCICAP

    Please report feedback here:
    https://github.com/lukrop/GCICAP/issues


    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Since DCS and its Scripting Engine moved along since I last tested my latest part of this project, I simply deleted my first post in this thread and relate to "Stonehouse" and "lukrop", who continue to work on this project.
    Last edited by SNAFU; 12-15-2015, 10:02 AM.
    sigpic

    Unsere Facebook-Seite

    #2
    ... Must spread rep.
    "ENO"
    Type in anger and you will make the greatest post you will ever regret.

    "Sweetest's" Military Aviation Art

    Comment


      #3
      Originally posted by SNAFU View Post
      This is an idea I am working on since august last year and I am finally at a stage, where I can use it to my satisfaction. It runs for at least 4 hours in my missions without breaking up. Due to the complexity of these things, I can not garantee anything for long time missions, that`s why I call it 'beta'... sounds familiar huh? ..
      This is a great idea. I have just experimented with scripts in my test missions so far and do not use any script on my public server missions. I think there is just too much instability to add advanced scripts, at least if you’re not proficient in lua scripting yourself. When stability is 100% there are a lot of good scripts available and this adds a much appreciated function. I will definitely test it out on some missions.

      Rep inbound....
      Windows 7 64 bit FTW!
      My DCS Tools:
      Quick Airfield information , Better trim with the X52 Pro , Tacview Glideslopes

      Spoiler:

      ASUS Z97-PRO, Socket-1150
      Intel® Core i7-4770K Processor overclocked to @ 4.20 GHz
      32GB Corsair Dominator Platinum DDR3 2133MHz CL9 4x8GB
      Sapphire Radeon TRI-X R9 390X 8GB "OC"
      Samsung SSD 850PRO 1TB SSD
      WD 2TB Black 3,5", SATA64MB Cache, Dual Processor, 7200RPM
      Windows 7 64-bit
      Philips 40" 4K LED BDM4065UC, ASUS 27” and Dell 24” screens

      Comment


        #4
        great stuff....this with your random airtraffic for civil stuff, then Grimes' air defense network makes for a real map....I'm building a map with these three elements that I can use as a template for making little "attack insurgent camp" missions for the blackshark and yet still have a full world revolving around me...love it..


        one side question....you have hawk and patriot str as radars for blue (perfect cuz I use these alot)....anyway to get Sa-10 str added to the red side list.....i say this because i have missions with blue patriots and red sa-10s countering each other....and I'm working with a unit limit since I dont have a i7 at 5ghz....but I've managed to keep my template map down to less then 100 groups (more like 65) and 500 units.......I got about 40 groups of 10 for the air defense systems for the map, I'm hoping that the patriots for blue working under Grimes iads script will still function with your GCI.....

        ok...two questions....is there a limit to how many different radar groups are in the script....can sa-10, sa-6, sa-3, ect, ect, ect.......be added to make it so all search/track radars report to a higher power....

        i did notice the....
        if possibleEWRunittype == "55G6 EWR" or possibleEWRunittype == "1L13 EWR" --or possibleEWRunittype == "A-50"

        am I free to pick and choose whatever I want....I'm guessing it has to have a radar function...

        such a great idea...i just got too many questions....I'm off to see if this and iads step on each other...
        It only takes two things to fly, Airspeed and Money.

        Comment


          #5
          Good job! Will try it out when I have the chance! I am sure its 100 times better than my unfinished work. Your script is on the list now too: http://forums.eagle.ru/showthread.ph...02#post1964602

          (I would appreciate help keeping the list updated!)
          DCS AJS37 HACKERMAN

          There will always be bugs. If everything is a priority nothing is.

          Comment


            #6
            Originally posted by HiJack View Post
            I think there is just too much instability to add advanced scripts, at least if you’re not proficient in lua scripting yourself. When stability is 100% there are a lot of good scripts available and this adds a much appreciated function. I will definitely test it out on some missions.
            Currently the dynamically adding of objects is problematic, as I understood.
            In my DCS World installation I feel that crashing planes cause the most of my DCS software issues. So everything enhancing the frequency of planes hitting the ground - and that is what the script is doing. So I would recommend for every missions, which is designed for larger client numbers and longer runtimes - as it is necessary for public servers - to keep it simple and not use any script at all or anything on the map, which is not strictly necessary. But who likes to play in a DCS VOID? So please report back your experience, when you find some time for testing the script in bigger missions.

            Originally posted by Davis0079 View Post
            one side question....you have hawk and patriot str as radars for blue (perfect cuz I use these alot)....anyway to get Sa-10 str added to the red side list.....i say this because i have missions with blue patriots and red sa-10s countering each other....and I'm working with a unit limit since I dont have a i7 at 5ghz....but I've managed to keep my template map down to less then 100 groups (more like 65) and 500 units.......I got about 40 groups of 10 for the air defense systems for the map, I'm hoping that the patriots for blue working under Grimes iads script will still function with your GCI.....

            ok...two questions....is there a limit to how many different radar groups are in the script....can sa-10, sa-6, sa-3, ect, ect, ect.......be added to make it so all search/track radars report to a higher power....

            i did notice the....
            if possibleEWRunittype == "55G6 EWR" or possibleEWRunittype == "1L13 EWR" --or possibleEWRunittype == "A-50"

            am I free to pick and choose whatever I want....I'm guessing it has to have a radar function...
            I didn´t test it with Grimes`IADS script yet, but I see no reason they should interfere. My script just makes a table of all units of a certain type and checks every aircraft, if it is detected by these units. If the IADS script switches of the EWR radars it might be interesting to find out, if the script function still detects the intruders.

            The scripting function "...TargetIsDetected(...)" does only seem to work for ground units. I didn´t get any useful results trying to use AWACS as EWR system, that`s why I used the patriot SR and HAWK SR for the blue side. But if you add the unit-type string of any unit, which has a radar, which can detect aircraft, to the line
            Code:
            if possibleEWRunittype == "55G6 EWR" or possibleEWRunittype == "1L13 EWR" or possibleEWRunittype == "unit-type string"
            it should also add every unit of this type on the map to the EWR system. You just need to find out the exact name of the Sa-10 radar. You can do this by placing such a unit on a map and extract the *.miz file and take a look into the mission file and look for the string in the unit table ...["type"] = 'something'.

            Originally posted by RagnarDa View Post
            Good job! Will try it out when I have the chance! I am sure its 100 times better than my unfinished work. Your script is on the list now too: http://forums.eagle.ru/showthread.ph...02#post1964602

            (I would appreciate help keeping the list updated!)
            Tack Tack
            sigpic

            Unsere Facebook-Seite

            Comment


              #7
              Originally posted by SNAFU View Post
              I didn´t test it with Grimes`IADS script yet, but I see no reason they should interfere. My script just makes a table of all units of a certain type and checks every aircraft, if it is detected by these units. If the IADS script switches of the EWR radars it might be interesting to find out, if the script function still detects the intruders.

              The IADScript typically keeps EWRs operational, but there is a chance they can shut down for short periods of time of 60 to 200 seconds. I was looking through my code to see how you could access all of the tracks shared by the network, but it seems I have a few functions that sort of do that, but act as a filter to return only tracks within a certain range of each sam site. Suppose that would be a feature worth having for an update...
              The right man in the wrong place makes all the difference in the world.
              Current Projects: Scripting Wiki, Something...
              Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD, IADScript, Mission Editing Wiki!, Mission Building Forum

              Comment


                #8
                This script works fine with Mist 3.3 also and the CAP flights attack each other so that's fine. I would like to have CAP flights that have ROE set to "Return fire" when there is no enemy aircraft threatening their borders but then change to "Free fire" if an enemy aircraft passes their border. Is this possible?
                Windows 7 64 bit FTW!
                My DCS Tools:
                Quick Airfield information , Better trim with the X52 Pro , Tacview Glideslopes

                Spoiler:

                ASUS Z97-PRO, Socket-1150
                Intel® Core i7-4770K Processor overclocked to @ 4.20 GHz
                32GB Corsair Dominator Platinum DDR3 2133MHz CL9 4x8GB
                Sapphire Radeon TRI-X R9 390X 8GB "OC"
                Samsung SSD 850PRO 1TB SSD
                WD 2TB Black 3,5", SATA64MB Cache, Dual Processor, 7200RPM
                Windows 7 64-bit
                Philips 40" 4K LED BDM4065UC, ASUS 27” and Dell 24” screens

                Comment


                  #9
                  As long as the CAP triggerzones are not overlapping and there is no violation of the airspace, the CAPs should remain in their CAP triggerzones and not engage anything... in theory, was in my testing, when I sperated the CAP zones from enemy CAP zones far enough.

                  But the ROE could be implemented and the spawned with ROE Return fire (have to check if that is not already the case). When the EWR detects an intruder the idle CAP gets the task to actively engage defined group and the ROE should be OPEN FIRE.

                  I should be easy to change, if that is not already the case.

                  Somewher in line 2728 task must be the ROE action:
                  Code:
                  {
                                                                      ["tasks"] = 
                                                                      {
                                                                          [1] = 
                                                                          {
                                                                              ["enabled"] = true,
                                                                              ["auto"] = false,
                                                                              ["id"] = "EngageTargetsInZone",
                                                                              ["number"] = 1,
                                                                              ["params"] = 
                                                                              {
                                                                                  ["targetTypes"] = 
                                                                                  {
                                                                                      [1] = "Air",
                                                                                  }, -- end of ["targetTypes"]
                                                                                  ["x"] = actualCAPzoneposx,
                                                                                  ["priority"] = 1,
                                                                                  ["y"] = actualCAPzoneposz,
                                                                                  ["zoneRadius"] = actualCAPzone.radius,
                                                                              }, -- end of ["params"]
                                                                          }, -- end of [1]
                                                                          [2] = 
                                                                          {
                                                                              ["enabled"] = true,
                                                                              ["auto"] = false,
                                                                              ["id"] = "WrappedAction",
                                                                              ["number"] = 2,
                                                                              ["params"] = 
                                                                              {
                                                                                  ["action"] = 
                                                                                  {
                                                                                      ["id"] = "Option",
                                                                                      ["params"] = 
                                                                                      {
                                                                                          ["value"] = 4,
                                                                                          ["name"] = 1,
                                                                                      }, -- end of ["params"]
                                                                                  }, -- end of ["action"]
                                                                              }, -- end of ["params"]
                                                                          }, -- end of [2]
                                                                          [3] = 
                                                                          {
                                                                              ["number"] = 3,
                                                                              ["auto"] = false,
                                                                              ["id"] = "WrappedAction",
                                                                              ["enabled"] = true,
                                                                              ["params"] = 
                                                                              {
                                                                                  ["action"] = 
                                                                                  {
                                                                                      ["id"] = "Option",
                                                                                      ["params"] = 
                                                                                      {
                                                                                          ["value"] = 2,
                                                                                          ["name"] = 3,
                                                                                      }, -- end of ["params"]
                                                                                  }, -- end of ["action"]
                                                                              }, -- end of ["params"]
                                                                          }, -- end of [3]
                                                                          [4] = 
                                                                          {
                                                                              ["number"] = 4,
                                                                              ["auto"] = false,
                                                                              ["id"] = "WrappedAction",
                                                                              ["enabled"] = true,
                                                                              ["params"] = 
                                                                              {
                                                                                  ["action"] = 
                                                                                  {
                                                                                      ["id"] = "Option",
                                                                                      ["params"] = 
                                                                                      {
                                                                                          ["value"] = 1,
                                                                                          ["name"] = 4,
                                                                                      }, -- end of ["params"]
                                                                                  }, -- end of ["action"]
                                                                              }, -- end of ["params"]
                                                                          }, -- end of [4]
                                                                          [5] = 
                                                                          {
                                                                              ["number"] = 5,
                                                                              ["auto"] = false,
                                                                              ["id"] = "WrappedAction",
                                                                              ["enabled"] = true,
                                                                              ["params"] = 
                                                                              {
                                                                                  ["action"] = 
                                                                                  {
                                                                                      ["id"] = "Option",
                                                                                      ["params"] = 
                                                                                      {
                                                                                          ["value"] = true,
                                                                                          ["name"] = 6,
                                                                                      }, -- end of ["params"]
                                                                                  }, -- end of ["action"]
                                                                              }, -- end of ["params"]
                                                                          }, -- end of [5]
                                                                          [6] = 
                                                                          {
                                                                              ["number"] = 6,
                                                                              ["auto"] = false,
                                                                              ["id"] = "WrappedAction",
                                                                              ["enabled"] = true,
                                                                              ["params"] = 
                                                                              {
                                                                                  ["action"] = 
                                                                                  {
                                                                                      ["id"] = "Option",
                                                                                      ["params"] = 
                                                                                      {
                                                                                          ["value"] = 264241152,
                                                                                          ["name"] = 10,
                                                                                      }, -- end of ["params"]
                                                                                  }, -- end of ["action"]
                                                                              }, -- end of ["params"]
                                                                          }, -- end of [6]
                                                                          [7] = 
                                                                          {
                                                                              ["number"] = 7,
                                                                              ["auto"] = false,
                                                                              ["id"] = "WrappedAction",
                                                                              ["enabled"] = true,
                                                                              ["params"] = 
                                                                              {
                                                                                  ["action"] = 
                                                                                  {
                                                                                      ["id"] = "Option",
                                                                                      ["params"] = 
                                                                                      {
                                                                                          ["variantIndex"] = 2,
                                                                                          ["name"] = 5,
                                                                                          ["formationIndex"] = 1,
                                                                                          ["value"] = 65538,
                                                                                      }, -- end of ["params"]
                                                                                  }, -- end of ["action"]
                                                                              }, -- end of ["params"]
                                                                          }, -- end of [7]
                                                                      }, -- end of ["tasks"]
                                                                  }, -- end of ["params"]
                  Or in the task of waypoint 3 and following beginning line 2829:

                  I will check and implement this in a new a version, when I find the time...

                  PS: You could try to change these task by looking for IDs and values of these... My theory is that:

                  Code:
                                                                        [3] = 
                                                                          {
                                                                              ["enabled"] = true,
                                                                              ["auto"] = false,
                                                                              ["id"] = "WrappedAction",
                                                                              ["number"] = 3,
                                                                              ["params"] = 
                                                                              {
                                                                                  ["action"] = 
                                                                                  {
                                                                                      ["id"] = "Option",
                                                                                      ["params"] = 
                                                                                      {
                                                                                          ["value"] = 4,
                                                                                          ["name"] = 1,
                                                                                      }, -- end of ["params"]
                                                                                  }, -- end of ["action"]
                                                                              }, -- end of ["params"]
                                                                          }, -- end of [3]
                  ["value"] = 4,
                  ["name"] = 1,

                  means ROE Return Fire, but I have to check.
                  Last edited by SNAFU; 02-14-2014, 12:54 PM.
                  sigpic

                  Unsere Facebook-Seite

                  Comment


                    #10
                    OK. I guess these settings is the same as in the mission file itself? If so I can check the values and add tasks on a clean mission and compare the settings.
                    Windows 7 64 bit FTW!
                    My DCS Tools:
                    Quick Airfield information , Better trim with the X52 Pro , Tacview Glideslopes

                    Spoiler:

                    ASUS Z97-PRO, Socket-1150
                    Intel® Core i7-4770K Processor overclocked to @ 4.20 GHz
                    32GB Corsair Dominator Platinum DDR3 2133MHz CL9 4x8GB
                    Sapphire Radeon TRI-X R9 390X 8GB "OC"
                    Samsung SSD 850PRO 1TB SSD
                    WD 2TB Black 3,5", SATA64MB Cache, Dual Processor, 7200RPM
                    Windows 7 64-bit
                    Philips 40" 4K LED BDM4065UC, ASUS 27” and Dell 24” screens

                    Comment


                      #11
                      Ok, got your script running on my public server. It will be gradually tweeked and the mission gradually expanded. Take a look if you like on the 138th Virtual Norway.
                      Windows 7 64 bit FTW!
                      My DCS Tools:
                      Quick Airfield information , Better trim with the X52 Pro , Tacview Glideslopes

                      Spoiler:

                      ASUS Z97-PRO, Socket-1150
                      Intel® Core i7-4770K Processor overclocked to @ 4.20 GHz
                      32GB Corsair Dominator Platinum DDR3 2133MHz CL9 4x8GB
                      Sapphire Radeon TRI-X R9 390X 8GB "OC"
                      Samsung SSD 850PRO 1TB SSD
                      WD 2TB Black 3,5", SATA64MB Cache, Dual Processor, 7200RPM
                      Windows 7 64-bit
                      Philips 40" 4K LED BDM4065UC, ASUS 27” and Dell 24” screens

                      Comment


                        #12
                        SNAFU, would it be possible to add some options like:

                        -Generate airstart bandits (Random locations inside one or many spawnzones instead of airfield)
                        -Generate a particular type of intercept, like a HVAA attack - the reason for generating this one specifically is that it tends to be very high and very fast. Think M1.6+, 40000' or more.

                        Is it possible to spawn interceptors/bandits only for one side?

                        The idea is to use this as a training tool among other things.
                        sigpic
                        Reminder: SAM = Speed Bump
                        I used to play flight sims like you, but then I took a slammer to the knee - Yoda

                        Comment


                          #13
                          I have not tested this but the script runs fine on my server. If you look at the code you can set CAP flights on the sides as you like. Try setting the CAP groups to 0 on one side and test

                          Like this:
                          Code:
                          --parameters to be worked with:
                          local numberofredcapzones = 2                            --input of numbers of defined CAP zones for Red side
                          local numberofbluecapzones = 2                        --input of numbers of defined CAP zones for Blue side
                          local numberofredCAPgroups = 2                        --input of numbers of defined CAPs for red side
                          local numberofblueCAPgroups = 0                        --input of numbers of defined CAPs blue red side
                          Windows 7 64 bit FTW!
                          My DCS Tools:
                          Quick Airfield information , Better trim with the X52 Pro , Tacview Glideslopes

                          Spoiler:

                          ASUS Z97-PRO, Socket-1150
                          Intel® Core i7-4770K Processor overclocked to @ 4.20 GHz
                          32GB Corsair Dominator Platinum DDR3 2133MHz CL9 4x8GB
                          Sapphire Radeon TRI-X R9 390X 8GB "OC"
                          Samsung SSD 850PRO 1TB SSD
                          WD 2TB Black 3,5", SATA64MB Cache, Dual Processor, 7200RPM
                          Windows 7 64-bit
                          Philips 40" 4K LED BDM4065UC, ASUS 27” and Dell 24” screens

                          Comment


                            #14
                            Yep, that's what I did.

                            This is fairly good for basic population of airspace. Could be better, as always, but right now it's working very nicely IMHO.

                            Can I disable one side completely? Ie. There's no need to have the counter running etc. I don't need it.

                            Another question: The payload is set in the script. Is it possible to reference existing payloads instead of setting it up by pylon? This way you can even randomize payload, though this isn't exactly my goal.
                            Last edited by GGTharos; 03-01-2014, 05:42 PM.
                            sigpic
                            Reminder: SAM = Speed Bump
                            I used to play flight sims like you, but then I took a slammer to the knee - Yoda

                            Comment


                              #15
                              EDIT: Sorry, wrong script

                              The script calling the mist.scheduleFunction gives the following error in dcs.log when run in multiplayer mode:

                              00033.291 INFO SCRIPTING: mist.scheduleFunction, error in scheduled function: [string "C:\Users\Jack\AppData\Local\Temp\DCS\/~mis00..."]:4254: Parameter #1 (unit name string) missed

                              Is this critical? My testing crashes the server after about one hour when running the script.
                              Last edited by HiJack; 03-03-2014, 12:03 PM.
                              Windows 7 64 bit FTW!
                              My DCS Tools:
                              Quick Airfield information , Better trim with the X52 Pro , Tacview Glideslopes

                              Spoiler:

                              ASUS Z97-PRO, Socket-1150
                              Intel® Core i7-4770K Processor overclocked to @ 4.20 GHz
                              32GB Corsair Dominator Platinum DDR3 2133MHz CL9 4x8GB
                              Sapphire Radeon TRI-X R9 390X 8GB "OC"
                              Samsung SSD 850PRO 1TB SSD
                              WD 2TB Black 3,5", SATA64MB Cache, Dual Processor, 7200RPM
                              Windows 7 64-bit
                              Philips 40" 4K LED BDM4065UC, ASUS 27” and Dell 24” screens

                              Comment

                              Working...
                              X