Jump to content

Skynet: An IADS for Mission Builders


Recommended Posts

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:

Latest release:

Releases · walder/Skynet-IADS (github.com)

 

Update 28.07.2021:

Added NASAMS support

Update 03.01.2021:

https://github.com/walder/Skynet-IADS/releases/tag/2.0.0

HighDigitSAMs support
Updated debug options

 

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 :noexpression:

 

Update: 02.03.2020

  • Added unit tests, because a good developer writes the test before he writes the code, right? :smartass:
  • 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:

skynet-overview.jpeg


Edited by flywaldair (Skynet dev.)
  • Like 7
  • Thanks 3
Link to comment
Share on other sites

Fantastic, thank you :thumbup:.

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.

 

| Windows 11 | i5-12400 | 64Gb DDR4 | RTX 3080 | 2x M.2 | 27" 1440p | Rift CV1 | Thrustmaster Warthog HOTAS | MFG Crosswind pedals |

Link to comment
Share on other sites

Fantastic, thank you :thumbup:.

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! :pilotfly:

 

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.


Edited by tigair
Link to comment
Share on other sites

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.

 

 

 

 

EDsignaturefleet.jpg

Link to comment
Share on other sites

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.

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

Link to comment
Share on other sites

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.

 

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-IADS#preparing-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!

Link to comment
Share on other sites

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-IADS#the-autonomous-mode-options-are

Link to comment
Share on other sites

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.

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' :smilewink:

 

Put it on the bug list, will fix it:

https://github.com/walder/Skynet-IADS/issues/3

Link to comment
Share on other sites

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

 

The more the merrier.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

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

 

The more the merrier.

 

Well I'm standing on the shoulders of giants :). Your SAM DB has been a really good basis.

Link to comment
Share on other sites

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.

 

| Windows 11 | i5-12400 | 64Gb DDR4 | RTX 3080 | 2x M.2 | 27" 1440p | Rift CV1 | Thrustmaster Warthog HOTAS | MFG Crosswind pedals |

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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-IADS#preparing-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

 

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

 

 

 

 

EDsignaturefleet.jpg

Link to comment
Share on other sites

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.

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.

 

	-- 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

 

 

 

 

EDsignaturefleet.jpg

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

@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.

 

 

 

 

EDsignaturefleet.jpg

Link to comment
Share on other sites

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.

 

Feel free to join the development ;-).

In case you haven't seen it the single class source files are located here:

https://github.com/walder/Skynet-IADS/tree/master/skynet-iads-source

 

This mission contains a build of the single class files:

https://github.com/walder/Skynet-IADS/blob/master/demo-missions/in%20development%20dont%20use/skynet-test-persian-gulf-iads-developer.miz

 

 

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.

 

Could it bee that you were notching in redards to the EW radar? Or that you where in a valley? I nocticed that the EW radars can't see you in such situations, so they can't inform the SAM site. You can add debug information on what contacts the EW radar sees:

https://github.com/walder/Skynet-IADS#debug-information

 

In general the SAM site will become live when a target is within firing range.

 

I fixed the log error, thanks for letting me know.


Edited by tigair
Link to comment
Share on other sites

Feel free to join the development ;-).

In case you haven't seen it the single class source files are located here:

https://github.com/walder/Skynet-IADS/tree/master/skynet-iads-source

 

This mission contains a build of the single class files:

https://github.com/walder/Skynet-IADS/blob/master/demo-missions/in%20development%20dont%20use/skynet-test-persian-gulf-iads-developer.miz

 

 

 

 

Could it bee that you were notching in redards to the EW radar? Or that you where in a valley? I nocticed that the EW radars can't see you in such situations, so they can't inform the SAM site. You can add debug information on what contacts the EW radar sees:

https://github.com/walder/Skynet-IADS#debug-information

 

In general the SAM site will become live when a target is within firing range.

 

I fixed the log error, thanks for letting me know.

 

I will be sharing anything I may tweak. Thanks for the references.

 

I was in a dogfight with 4 Mig-29's over Qeshm Island about 10 miles from an SA-10 battery. After the bandits were dead, I was wondering why the SA10 wasn't interested. I still have not looked to see if I named the battery wrong. More testing required.

 

 

 

 

EDsignaturefleet.jpg

Link to comment
Share on other sites

IADS for Persian gulf

 

@tigair

 

this is so great for the Persian Gulf Aggressors vs Defenders missions that i love building using Mig's and 60's usa stuff

 

With CTLD and IADS all that is missing now is GCI for the Mig's

i know voice GCI would be a huge pain but how about text GCI?

 

any way THNX for this and i'll be using it for sure and will give you feedback

as it comes

 

 

Best Regards,

prefetch

 

[sIGPIC][/sIGPIC]

 

i7 7700K, Win-8.1(wufuc), DCSW OB, FC3, CA, PG-map, Syria-map, Normandy-map, WWII-assetspack, Bf 109 K-4, MiG-21bis, MiG-19P, Mi-8MTV2, BS2,

Link to comment
Share on other sites

@tigair

 

this is so great for the Persian Gulf Aggressors vs Defenders missions that i love building using Mig's and 60's usa stuff

 

With CTLD and IADS all that is missing now is GCI for the Mig's

i know voice GCI would be a huge pain but how about text GCI?

 

any way THNX for this and i'll be using it for sure and will give you feedback

as it comes

 

 

Best Regards,

 

Currently I have no plans for GCI, bu who knows. I will try and put together a new build on the weekend. Fixed a few bugs, and Harm defence is almost finished.

 

I'm looking forward to your feedback!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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