Announcement

Collapse
No announcement yet.

Skynet: An IADS for Mission Builders

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Skynet: An IADS for Mission Builders

    Hi Guys,

    After almost 10 years of absence from software development, I put on my old coding gloves an wrote an IADS script!

    Have a look at the extensive documentation over on the GitHub repo:
    https://github.com/walder/Skynet-IADS

    Highlights:
    • EW radars scan for targets, pass them on to SAM Sites. SAM sites in general stay off.
    • You can add command centers, connection nodes and power sources. Damage to these elements will degenerate the IADS.
    • Optional jamming (within the limits of the scripting engine), will be more effective for older radars.
    • HARM Defence: SAM sites that cannot shoot down HARMs will go dark if they detect a HARM.
    • SAM sites can act as EW radars and SAM sites at the same time
    • SAM sites will shut down if out of ammo
    • Nice debug information on what the IADS can see and how it reacts.
    • Understandable object oriented architecture, unit tests.


    Full backlog of features to be added:
    https://github.com/walder/Skynet-IADS/projects/1


    Questions regarding mission building and scripting? Join the Skynet discord Group:
    https://discord.gg/pz8wcQs


    Updates:

    Update 21.11.2020
    https://github.com/walder/Skynet-IAD...ses/tag/v1.2.0
    This release features a rewrite of the radar mesh code. Previously when a single unit in the IADS was destroyed the complete radar mesh was rebuilt. In missions with a large number of SAM sites this could lead the script to conduct radar units * radar units of comparisons. In a mission with 100 SAM sites this would result in 10'000 comparisons, possibly causing micro stutters.

    Due to this update some SAM sites may now show up as autonomous when adding the new version of Skynet. This is based on the improved radar mesh code. Previously these SAM sites where incorrectly interpreted as being in range of an EW radar.

    The script now only builds the radar mesh once when the IADS is activated or when a new unit is added at runtime. When an existing radar unit is destroyed only its parents and children are informed, therefore reducing the number of loops in the code.

    New features:
    • command centers now support connection nodes, think of this as being an up stream to all connected radars
    • updated debug output for command centers
    • added latest mist script (4.4.90)

    Bug Fixes
    • function name in readme.md corrected to masterArmSafe()
    • updated readme.md better explaining why SAM site must be in single group with no other units that don't belong to the SAM site
    • AWACS no longer causes stutters when first position update has been conducted. Will now update after it has moved 10 nm. Previously update occurred at 1/10th of detection distance of AWACS.
    • SAM site that had a missile in the air would not go dark if it lost its power source
    • potential nil call error messages fixed when debug tried to access name or type of radar unit

    Update 30.09.2020
    https://github.com/walder/Skynet-IAD...ses/tag/v1.1.3
    removed weapons.dll workaround, since ED fixed the underlying bug.

    Update 27.09.2020
    https://github.com/walder/Skynet-IAD...ses/tag/v1.1.2
    Fix for weapons.dll crash.

    Update 31.07.2020
    https://github.com/walder/Skynet-IAD...ses/tag/v1.1.1
    Point Defence Bugfixes

    Update 11.07.2020
    https://github.com/walder/Skynet-IAD...ses/tag/v1.1.0
    Added MOOSE AI_A2A_DISPATCHER support.

    Update 08.07.2020
    From now on updates will be posted in the releases section on GitHub:
    https://github.com/walder/Skynet-IADS/releases/


    Update 01.07.2020
    • Added a set up function to get SAM sites in to a red state at mission start -> redIADS:setupSAMSitesAndThenActivate()
    • SAM sites now retain their red state when going dark, resulting in a faster reaction time when they are awoken by the IADS
    • Due to above changes SAM sites will only rearm when fully out of ammo, they will not rearm if going dark and ammo is left.


    Update 26.04.2020
    • Improved performance of Skynet when may units are involved (aircraft and radar sites)
    • Added iads:setUpdateInterval(5) -> so mission builders can set whatever update they like
    • Added earlyWarningRadarStatusEnvOutput and samSiteStatusEnvOutput will output detailed early warning radar info to the dcs.log file. Intended for multiplayer test debug. Setting these var to true may result in the game lagging.
    • Added a stress test mission with 50+ AI planes and lots of SAM sites.
    • Added new method to access a sub group of SAM sites by prefix (redIADS:getSAMSitesByPrefix('SAM-SECTOR-A')), makes configuration of the IADS easier.
    • Fixed a bug in the harm detection code when one radar in the SAM site is destroyed
    • Fixed Bug in setting maximum jammer distance


    Update 10.04.2020
    • Fixed a bug where units acting as EW radars would not detect incoming harms


    Update 08.04.2020
    • All types of SAM search radars can now be used as single unit EW radars, previously this resulted in errors
    • SAM sites with no working radar are no longer updated with target information by the IADS


    Update 03.04.2020
    • Fixed an annoying go live / do dark output introduced with the go autonomous code in last release
    • Added blue IADS in demo mission


    Update: 01.04.2020
    • SAM sites will go autonomous if they are outside of EW radar coverage and revert back to their default behaviour if they are within EW radar coverage again
    • SAM sites will rejoin the IADS if the loose a connection node and a new one is added
    • Fixed radio menu bug when removing either IADS or jammer


    Update 23.03.2020
    • Finished work on the first release of the jammer, added a unit in the test mission, select 'Hornet SA-11-2 jammer support' fly against an SA-11 protected by an F4 jamming
    • Updated docs on the jammer

    Let me know what you think of the jammer feature and how you think it can be improved

    Update 22.03.2020
    • Tested on 2.5.6.45317
    • Radar unit with point defence set to ingore harms will eventually go dark if a saturation point is reached.
    • Updated documentation, wrote more unit tests
    • Added code to clean up state of IADS internally over longer period of time
    • Worked on jammer to make it compatible with all the changes in the last few weeks, still WIP


    Update 21.03.2020
    • tested all blue SAM and EW sites with Skynet. Also added HQ-7 (chinese SAM)
    • fixed bug where EW radar would not wake up after HARM shutdown
    • Ships can now be added to the IADS as EW radars
    • EW radar will go dark by default if connection to IADS is lost
    • updated unit tests.


    Update 19.03.2020
    • Added option so a radar unit with point defence support will not go dark when HARM is inbound and point defence has ammo left
    • Blue side: Hawk and Patriot tested, added default HARM Defence chance for these systems
    • Updated documentation on GitHub, added potential mission editor bug note in the FAQ section including workaround
    • Updated IADS output based on side its on


    Update 18.03.2020

    Update 17.03.2020
    • Fixed prefix adding error in unit name or group name when the prefix contains a special char
    • SAMs now are able to rearm ammo (controller setOnOff may not be false for this, but setOnOff false ist better for HARM evasion, script handles both correctly)
    • Any kind of aircraft with air to air radar can now act as AWACS when added to the IADS.


    Update 16.03.2020
    • Added deactivate() method to clean up an IADS instance, so no dereferenced background tasks keep running
    • all IADS methods with the word SAM -> SAM is now always in upper case e.g.:addSAMSitesByPrefix, this will have to be updated in existing scripts
    • loading units by prefix in to the IADS is now case sensitive to reflect how mission editor behaves
    • Updated documentation, added unit tests


    Update 15.03.2020
    • Rewrote (for the 3rd time) internal structure of SAM sites, range data is now all taken from in game, this way the script should be future proof
    • SAM and AAA sites shut down if they are out of ammo, but only after their last missile is no longer in the air
    • AWACS support for EW radars: currently only the A-50 Mainstay and the J-2000 Mainring are supported, more will follow
    • Updated documentation with detailed setup example and updated Demo Mission
    • Updated unit tests, currently there are 60 tests, with 324 assertions to make sure everything works as intended


    Update 13.03.2020
    • Added radio menu option to toggle IADS status output
    • updated method to add power source for command center, see documentation on GitHub
    • Updated documentation on GitHub
    • Updated unit tests


    Update 12.03.2020
    • Added HARM Defence, see the HARM Defence section in the documentation for details
    • Updated documentation on GitHub
    • Updated compiled script
    • Added Units Tests, fixed bugs


    Update: 10.03.2020
    • Updated the interface to set SAM site and EW radar options
    • Updated the documentation
    • Added go live ranges for SAM sites (kill zone or max radar range)
    • Added the option to set a SAM site as EW radar
    • Harm defence is still broken
    • Updated IADS debug output
    • Added even more unit tests
    • squashed lots of bugs


    Update: 06.03.2020
    • Fixed bug when connection node / power source is a unit or static ground vehicle
    • Added lots of unit tests, and fixed other small bugs
    • HARM Defence is currently broken, will fix it with the next update


    Update: 04.03.2020
    • Fixed bugs, wrote Unittests, thanks for reporting!


    Update: 03.03.2020
    • Added build time stamp to the compiled script, if you run in to an issue check that with the current one on GitHub
    • added more unit tests, found a bug thanks to them


    Update: 02.03.2020
    • Added unit tests, because a good developer writes the test before he writes the code, right?
    • Updated the list of SAM Sites that will react to HARMs
    • Updated the compiled script


    Update: 01.03.2020:
    • Added HARM Defence. Currently only for the SA-6 and 1L13 EWR, more will come soon
    • SAM Sites can now act as EW radar and SAM site a the same time (see updated documentation on GitHub)
    • IADS has a track file of all contacts, keeps them up to 30 sec even with no new radar information
    • Refactored large parts of the code, now more readable, will allow for faster development


    It's generic and all written in lua so you can easily add it to your missions. Just 4 lines of code needed. No silly triggers and hardcoded garbage, I swear! I tried to make the integration as easy as possible, I understand not all mission builders want to code.

    Download this simple demo mission to see the IADS in action:
    https://github.com/walder/Skynet-IAD...rsian-gulf.miz
    Just place your plane near the iranian coast and see how the SAMs react.

    Let me know what you think of it. Depending on your feedback I will add more features.

    A special thanks to Spearzone and Coranthia for researching public available information on IADS networks and getting me up to speed on how such a system works. Also I shamelessly incorporated Grimes SAM DB from his IADS script, he is ok with it.

    Here's a quick overview of what's supported:
    Last edited 09-30-2020, 07:33 PM.
    Skynet: an Integrated Air Defence System for DCS. Download here!

    The best flying school in Switzerland mfgz.ch

    Follow my flying adventures on YouTube

    #2
    This is Great thanks so much for this.
    sigpic

    Comment


      #3
      Thanks for your efforts I will defo try it out!

      Comment


        #4
        Seems a great design, I need to try her out, thanks for your work!
        ___________________________________________________________________________
        SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING * PLAYLIST

        Comment


          #5
          Fantastic, thank you .
          Just spend most of the afternoon tying it into a big dedicated server sandbox mission used in the community I fly in. Looking forward to try this on a large scale.
          - Jack of many DCS modules, master of none.
          - Personal wishlist: F-15A, F-4S Phantom II, JAS 39A Gripen, SAAB 35 Draken, F-104 Starfighter, Panavia Tornado IDS.


          | MSI Z87-G45 Gaming | i5-4670K @ 4.3Ghz | 16Gb DDR3 1600 | Asus GTX 1070 Strix OC | Samsung 850 Evo 250 & 500Gb | 40" Sony FullHD | Oculus Rift CV1 | Thrustmaster Warthog Stick (19.5cm extension) & Throttle | MFG Crosswind | Windows 7-64 |

          Comment


            #6
            Originally posted by Knock-Knock View Post
            Fantastic, thank you .
            Just spend most of the afternoon tying it into a big dedicated server sandbox mission used in the community I fly in. Looking forward to try this on a large scale.
            Cool!

            If you need any help let me know. Also there might still be some bugs in the code. Feel free to drop me a message or Post an issue on Github:
            https://github.com/walder/Skynet-IADS/issues

            To all the others:
            Thanks for looking in to the script. I really appreciate your feedback. My goal is to create the best IADS script for DCS.
            Last edited 02-24-2020, 08:34 AM.
            Skynet: an Integrated Air Defence System for DCS. Download here!

            The best flying school in Switzerland mfgz.ch

            Follow my flying adventures on YouTube

            Comment


              #7
              I set this up last night.

              The command center, power and connection mode features will not work as the current DCS version is randomly renaming statics to ammo #<number>

              Also, I accidentally had a group with my SAM prefix that was not a database SAM. This caused an error of comparing a nil to a nil.

              This needs to be trapped.
              475th Fighter Group Discord https://discord.gg/xkKsApD
              sigpic

              Comment


                #8
                Just tried it out... It's very effective and promising.
                One thing I did notice, tho was I kept getting the same error over and over in the logs. It didn't seem to affect the script, tho.
                Code:
                2020-02-25 00:13:58.136 ERROR   SCRIPTING: MIST|doScheduledFunctions|1019: Error in scheduled function: $1[string "F:/Data/Under Development/IADS/skynet-iads-compiled.lua"]:1665: attempt to get length of field 'iadsContacts' (a nil value)
                Hope this helps!
                Wayz Out


                Intel Core i9 9900K | ASUS ROG Strix Z390E Gaming MB | G.Skill Ripjaws V 32gb DDR4-3200 | GeForce RTX 2080 Ti | Samsung 970 EVO Plus NVMe
                HTC Vive Pro VR | Logitech G x56 HOTAS | Logitech G PRO Pedals

                Comment


                  #9
                  do sam sites switch their radars on if no ew radars are in range?

                  Comment


                    #10
                    Originally posted by pmiceli View Post
                    I set this up last night.

                    The command center, power and connection mode features will not work as the current DCS version is randomly renaming statics to ammo #<number>
                    I hope Eagle Dynamics will fix that with the next update. In the meantime try adding a Unit as command center or power source, it should work just the same.

                    Originally posted by pmiceli View Post
                    Also, I accidentally had a group with my SAM prefix that was not a database SAM. This caused an error of comparing a nil to a nil.

                    This needs to be trapped.
                    I mentioned this limitation here:
                    https://github.com/walder/Skynet-IAD...ing-a-sam-site

                    I will refactor the sam site class code and optimise the internal structure. At the least I will able to add debug information if a SAM site has inconsistent elements in it.

                    Let me know what you think of the script in a mission, feedback is welcome!
                    Skynet: an Integrated Air Defence System for DCS. Download here!

                    The best flying school in Switzerland mfgz.ch

                    Follow my flying adventures on YouTube

                    Comment


                      #11
                      Originally posted by Lord of War View Post
                      do sam sites switch their radars on if no ew radars are in range?
                      At the moment no, since they would get no information about targets in their area. I will most likely add an option for a SAM site to always be on, so it can act as an EW radar and SAM site at the same time. I believe the S-300 is used that way. I also have visual spotting on my list, so if a sam site would visually spot a target it would go live.

                      There's also a fallback mode when SAM sites loose connection to the IADS, see:
                      https://github.com/walder/Skynet-IAD...de-options-are
                      Skynet: an Integrated Air Defence System for DCS. Download here!

                      The best flying school in Switzerland mfgz.ch

                      Follow my flying adventures on YouTube

                      Comment


                        #12
                        Originally posted by A101Wayz View Post
                        Just tried it out... It's very effective and promising.
                        One thing I did notice, tho was I kept getting the same error over and over in the logs. It didn't seem to affect the script, tho.
                        Code:
                        2020-02-25 00:13:58.136 ERROR   SCRIPTING: MIST|doScheduledFunctions|1019: Error in scheduled function: $1[string "F:/Data/Under Development/IADS/skynet-iads-compiled.lua"]:1665: attempt to get length of field 'iadsContacts' (a nil value)
                        Hope this helps!
                        Thanks'

                        Put it on the bug list, will fix it:
                        https://github.com/walder/Skynet-IADS/issues/3
                        Skynet: an Integrated Air Defence System for DCS. Download here!

                        The best flying school in Switzerland mfgz.ch

                        Follow my flying adventures on YouTube

                        Comment


                          #13
                          GG my enthusiasm to not update my own script. Took long enough for someone to make another IADS script. Good job and cheers.

                          The more the merrier.
                          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


                            #14
                            Originally posted by Grimes View Post
                            GG my enthusiasm to not update my own script. Took long enough for someone to make another IADS script. Good job and cheers.

                            The more the merrier.
                            Well I'm standing on the shoulders of giants . Your SAM DB has been a really good basis.
                            Skynet: an Integrated Air Defence System for DCS. Download here!

                            The best flying school in Switzerland mfgz.ch

                            Follow my flying adventures on YouTube

                            Comment


                              #15
                              Hi tigair.

                              You think this is something that could get implemented in the future, so that we can use map objects too (for command center, power source, connection node), simply by using their Object ID?
                              https://forums.eagle.ru/showthread.php?t=264623
                              - Jack of many DCS modules, master of none.
                              - Personal wishlist: F-15A, F-4S Phantom II, JAS 39A Gripen, SAAB 35 Draken, F-104 Starfighter, Panavia Tornado IDS.


                              | MSI Z87-G45 Gaming | i5-4670K @ 4.3Ghz | 16Gb DDR3 1600 | Asus GTX 1070 Strix OC | Samsung 850 Evo 250 & 500Gb | 40" Sony FullHD | Oculus Rift CV1 | Thrustmaster Warthog Stick (19.5cm extension) & Throttle | MFG Crosswind | Windows 7-64 |

                              Comment


                                #16
                                Originally posted by Knock-Knock View Post
                                Hi tigair.

                                You think this is something that could get implemented in the future, so that we can use map objects too (for command center, power source, connection node), simply by using their Object ID?
                                https://forums.eagle.ru/showthread.php?t=264623
                                Interesting I will look in to it. Did you try:
                                StaticObject.getByName('03949944') -> where the number is the number presented in the context menu of the mission editor? If you can access an Object this way, you can just pass it to the IADS then it should work.
                                Skynet: an Integrated Air Defence System for DCS. Download here!

                                The best flying school in Switzerland mfgz.ch

                                Follow my flying adventures on YouTube

                                Comment


                                  #17
                                  Originally posted by tigair View Post
                                  I hope Eagle Dynamics will fix that with the next update. In the meantime try adding a Unit as command center or power source, it should work just the same.



                                  I mentioned this limitation here:
                                  https://github.com/walder/Skynet-IAD...ing-a-sam-site

                                  I will refactor the sam site class code and optimise the internal structure. At the least I will able to add debug information if a SAM site has inconsistent elements in it.

                                  Let me know what you think of the script in a mission, feedback is welcome!
                                  I tried using a ground unit instead of a static for command center or power and that did not work. I didn't look at the code to see why.

                                  My fix for the error thrown by a non-database SAM prefix is the following code change

                                  Code:
                                  function SkynetIADSSamSite:isLauncherWithinFiringParameters(aircraft, samLauncherUnit, launcherData)
                                  	local isInRange = false
                                  	local distance = mist.utils.get2DDist(aircraft:getPosition().p, samLauncherUnit:getPosition().p)
                                  	local maxFiringRange = launcherData['range']
                                  	--trigger.action.outText("Launcher Range: "..maxFiringRange,1)
                                  	--trigger.action.outText("current distance: "..distance,1)
                                  	--pmiceli fix to error message
                                  	if maxFiringRange == nil then
                                  	 isInRange =false
                                  	elseif distance <= maxFiringRange then
                                  		isInRange = true
                                  		--trigger.action.outText(aircraft:getTypeName().." in range of:"..samLauncherUnit:getTypeName(),1)
                                  	end
                                  	--pmiceli end fix
                                  	return isInRange
                                  end
                                  475th Fighter Group Discord https://discord.gg/xkKsApD
                                  sigpic

                                  Comment


                                    #18
                                    Originally posted by A101Wayz View Post
                                    Just tried it out... It's very effective and promising.
                                    One thing I did notice, tho was I kept getting the same error over and over in the logs. It didn't seem to affect the script, tho.
                                    Code:
                                    2020-02-25 00:13:58.136 ERROR   SCRIPTING: MIST|doScheduledFunctions|1019: Error in scheduled function: $1[string "F:/Data/Under Development/IADS/skynet-iads-compiled.lua"]:1665: attempt to get length of field 'iadsContacts' (a nil value)
                                    Hope this helps!
                                    To stop this error you need to remark out the block that is causing it.

                                    Code:
                                    	-- special case if no contacts are found by the EW radars, then shut down all the sams, this needs to be tested
                                    	--[[-- pmiceli REMARK out this block to stop iadsContact error
                                    	if #self.iadsContacts == 0 then
                                    		for i= 1, #self.samSites do
                                    			local samSite = self.samSites[i]
                                    			samSite:clearTargetsInRange()
                                    			samSite:goDark()
                                    		end
                                    	end--]]--pmiceli end of error block
                                    475th Fighter Group Discord https://discord.gg/xkKsApD
                                    sigpic

                                    Comment


                                      #19
                                      @pmiceli:

                                      Thanks, these are the areas I need to improve in the code.
                                      The IADS shouldn't try to create a Sam instance from a unit that is not a sam.
                                      Will update that in the next few days.
                                      Skynet: an Integrated Air Defence System for DCS. Download here!

                                      The best flying school in Switzerland mfgz.ch

                                      Follow my flying adventures on YouTube

                                      Comment


                                        #20
                                        Originally posted by tigair View Post
                                        @pmiceli:

                                        Thanks, these are the areas I need to improve in the code.
                                        The IADS shouldn't try to create a Sam instance from a unit that is not a sam.
                                        Will update that in the next few days.
                                        Those were my quick fixes to get rid of the errors. I have no clue how it affects the totality of the code.

                                        I do hope to look into it more and tweak it to do things I would like.

                                        At the moment the IADS seems a bit passive. I would like SAM radars to come up more than they do. I flew within 10 miles of an SA10 without it making a peep but I will have to check and make sure there isn't an error there.
                                        475th Fighter Group Discord https://discord.gg/xkKsApD
                                        sigpic

                                        Comment

                                        Working...
                                        X