Jump to content

Detection Script Released


MBot

Recommended Posts

Detection Script Released

 

DCS is currently featuring a rather simplistic visual detection model for ground units with instantaneous detection on good visual conditions. This makes air defense system that depend on visual target acquisition, such as MANPADS, SA-9/13 or Chaparral, overly effective by effectively not modeling their biggest weakness. The Detection Script aims to improve this situation by over imposing a custom written visual detection model over selected groups of ground units. This custom visual detection model controls the weapon hold/free status of the group and therefore inhibits the engagement of a target until it is determined as being visually detected by more realistic standards. The Detection Script visual detection is based on a probability model, adjusted by multiple situation depended factors, and tuned according the real world US Army test data wherever available.

 

The Detection Script models the following factors:

-Range to target

-Line of sight to target

-Target elevation angle

-Artificial ground clutter terrain masking on low elevation angles to compensate lack of DCS simulating vegetation

-Target background (sky or terrain)

-Target angular speed

-Number of units (pair of eyes) in searching group

-Target offset from the direction the searching group is facing

-Target cuing received by external search radar, either over fast datalink or slow voice communication

 

The script includes an option that lets moving ground units stop and leave the road upon detecting a hostile aircraft. This is a improvement over default DCS behavior where a member of the group needs to be hit in order for the group to disperse.

 

By default the groups search all 360° of sky around them evenly, which can result in very late detection of approaching aircraft (do not be fooled by the orientation of the 3d model in game). This is in line with real world test data. The script has the option to let groups concentrate on their frontal quarter at the expense of detectability on their rear quarter. This is very useful to simulate air defense units covering a certain sector or moving vehicles, which tend to weight their attention forward.

 

By default the groups search the sky on their own but the script allows to define units that can provide radar early warning. This dramatically increases the chances for searching groups to detect targets early. A group will have an increased probability of detection for all targets that are being provided externally, while retaining the lower probability of detection for all other targets that are not being down linked by EWR. Target cuing by EWR is not instantly either. The search radar first has to build a target track and depending on whether the radar is configured to have an automatic datalink or not, a time delay is imposed until the target data can be utilized in the visual search. This means that even ground defenses with EWR can be overcome with surprise if the approach is masked from radar long enough.

 

Therefore the Detection Script is flexible enough to simulate various common SHORAD setups:

-US Army Stinger, Chaparral and Vulcan organized in air defense units with early warning radar access

-US Army Stinger organized in artillery and HQ units for self defense without early warning radar access

-Soviet SA-9/13 in air defense batteries with attached Dog Ear radar

-Soviet Igla teams in SAM platoons without early warning radar access

-Insurgent MANPADS teams without early warning radar access

 

 

 

How does this affect gameplay?

 

Aircraft can increase their survivability in a heavy SHORAD environment by applying certain tactics to achieve tactical surprise. Flying fast and minimizing time spend in the target area will decrease the time that an aircraft is exposed to the chance of being detected. Second attack runs are to be absolutely avoided, as aircraft that are already detected will be engaged head-on at the earliest time possible. Chances can also be enhanced by attacking in a steep angle from high altitude (visual observers tend to concentrate on the horizon) or from very low level to utilize ground clutter masking (an artificial bonus when flying below 1° elevation to simulate objects and vegetation blocking line of sight). Additional gains are achieved by positioning yourself in front of a terrain background or approaching moving columns from behind (if they are configured accordingly).

 

It is important to remember that the Detection Script is probability based. While applying the right tactics will generally improve your chance of survival, it is entirely possible that you are either detected extremely early or extremely late. You can do everything right and still be shot down or everything wrong and still survive. C'est la guerre.

 

It is also important to note that while the Detection Script can calculate the detection of each aircraft individually, the engagement of specific aircraft by the AI cannot be controlled by script. As soon as the first aircraft is detected the AI is set to weapons free and will engage every target it determines suitable, regardless if this is the actual target that is detected by the script or not. It is something to keep in mind when multiple aircraft operate together.

 

 

 

How is the Detection Script applied to a mission?

 

1. Run the Detection Script either by a "do script" or "do script file" trigger.

 

2. Run the following functions in a "do script" trigger for each individual group that should utilize the Detection Script:

 

a) For each group that should utilize the visual detection model of the Detection Script:

 

AddOP(arg1, arg2, arg3, arg4, arg5)

 

arg1: group name of group that does visual search; string. Example: "StingerTeam 001"

arg2: unit name of unit that provides radar early warning to group above; string. Example: "EWRadar 001". Write inexisting unit name if no ewr should be used. Example: "blabla"

arg3: boolean; sets if detection script should control the ROE of the applied group. Example: true. If set to true, group will only open fire when an aircraft is detected, it will not detect hostile ground units!

arg4: boolean; sets if applied group should stop and get off the road when aircraft are detected. Example: true. If set to true, group will always stop moving when hostile aircraft are detected!

arg5: boolean; sets if group should concentrate aircraft search on the front sector. Example: true. If set to true, group will more likely detect aircraft approaching from the front and less likely detect aircraft approaching from the rear.

 

Complete example script line: AddOP("Group1", "Unit1", true, false, false)

This lets Group1 search for aircraft with the detection script, Unit1 will provide radar early warning for Group1, Group1 will only fire when aircraft are detected, it will not stop when aircraft are detected, it will evenly search the sky 360°

 

Shortcut: You can use AddOP("GroupName") as a shortcut. This will use the default options of no radar early warning, ROE controlled, no dispersing and 360° search

 

 

b) For each unit that should provide radar early warning for groups that use the visual detection model of the Detection Script:

 

AddEWR(arg1, arg2)

 

arg1: unit name of unit that provides radar early warning; string. Example: "SearchRadar 001"

arg2: boolean; sets if radar passes on target data with an automatic datalink or over voice radio. Example: true. If set to true target data is provided over datalink with a short time delay. If set to false target data is provided over voice radio with a longer time delay.

 

Complete example script line: AddEWR("Unit1", true)

This lets Unit1 provide radar early warning with datalink for groups using the Detection Script

 

Shortcut: You can use AddEWR("UnitName") as a shortcut. This will use the default options of no datalink.

 

 

 

Attached is a short demo mission that will demonstrate how the Detection Script works in various scenarios (a debug mode is activated to provide additional info). This mission might also serve to show how the script is set-up correctly.

DetectionScriptDemo.miz

DetectionScript.lua


Edited by MBot
  • Like 3
Link to comment
Share on other sites

Thanks MBot!

 

Do you think that this script could be run on a large amount of group (i.e. 200) with some EWR units (i.e. 10) whitout expecting performance loss? or it's better to run it on a smaller amount of groups? thanks :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

I haven't done any performance testing yet, but I expect that this will cause problems on a large scale. Aside from pure computing power, I had difficulties with larger scripts causing synchronization and connection problems in multiplayer with my ASW missions. I would suggest to start on a small scale with applying the script to key groups and then include more and see if this has negative effects.

Link to comment
Share on other sites

thanks for the answer :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Would this best be used with the unit skill set to excellent so that the script limits fire and not DCS additionally?

 

It is up to you to decide. In my oppinion MANPADS are already pretty deadly on the average setting. Unfortunately AI skill in DCS is not scaled from incompetent to excellent but from medium to excellent. So it doesn`t hurt to keep MANPADS on the lowest IMHO. AAA on the other hand can easely be upped a notch or two.

  • Like 1
Link to comment
Share on other sites

i need to take a closer look into your nice script on the WE, but do you have an option to put the radar on active and/or standby via script?

 

I like to simulate an active radar operator, who put the radar on and off, depend on the distance to the contact for guiding their missles and disturbing the SEAD aircrafts!

Playing: F-16C

Intel i7-13700KF, 64GB DDR5 @5600MHz, RTX 4080 ZOTAC Trinity, WIN 11 64Bit Prof.

Squadron "Serious Uglies" / Discord-Server: https://discord.gg/2WccwBh

Ghost0815

Link to comment
Share on other sites

MBot,

 

Is it possible to assign more than one EWR to a group? And if not can that functionality be added?

 

Spoiler

Intel 13900K (5Ghz), 64Gb 6400Mhz, MSi RTX 3090, Schiit Modi/Magi DAC/AMP, ASUS PG43UQ, Hotas Warthog, RealSimulator FSSB3, 2x TM MFDs + DCS MFDs, MFG Crosswinds, Elgato Steamdeck XL

 

Link to comment
Share on other sites

Currently not. I decided to not make the script overly complex over concerns that the configuration by the user for each mission might become too complicated. Another factor was that FAAR/TAADS, the initial ewr/datalink system used by the Army (for Vulcan, Chaparral, Redeye and Stinger) could only receive data from a single radar at once. So that seemed to be fitting as well.

 

While a more integrated SHORAD network could be programmed, I am not sure it would currently offer significant advances in gameplay.

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
  • 1 year later...

Thanks MBot for your great work, you make DCS all that much better, i couldnt give you rep for some reason but thanks for your efforts, greatly appreciated.

Regards

 

DL available skins here:

https://www.digitalcombatsimulator.com/en/files/?CREATED_BY=Strut

 

 

Pictures of my Skins here: https://imgur.com/a/bOQyQqW

 

[sIGPIC][/sIGPIC]

Win10 64bit, Intel® Core i7-5820K CPU OC @ 4.50GHz x6, X99A GAMING PRO CARBON, MSI RTX 2080 TI GAMING X TRIO 11Gb, 32GB DDR4 RAM, SSD 960 EVO250GB, SSD 850 EVO 500GB, JetSeat, MFG Crosswind Pedals, VPC Mongoose T-50, TMWH, DSD ButtonBox, Pimax 5k XR/BE

 

 

Link to comment
Share on other sites

  • 5 months later...
  • 3 years later...

Hello MBot!

 

Looking after something very similar, I stopped here for a while :)

Is your script still running on e.g. DCS 2.5.3?

 

And/or are there other sources for radar detection codes?

I am looking for a method of determining if my unit entering a trigger zone, is detected by any radar of a certain coalition.

 

Thanks if you find a second for any answer!

 

Kind regards,

TOViper

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G | NVIDIA GTX 1080 Ti OC 11GB | 32 GB 3200 MHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TPR | Rift CV1

 

Link to comment
Share on other sites

*shudder*

Thanks by the way, I used some strategies of your fantastic script!

 

My little script used as "LUA PREDICATE" in a trigger checks if:

 

  • a flying aircraft
  • of a certain coalition
  • is within a certain zone
  • and detected by AWACS

It returns true if any is detected.

This gives AWACS the opportunity to set CAPs to "WEAPONS FREE" e.g.

 

 

 

 

[size=1]AWACS_USA_Unit = Unit.getByName('Pilot_1_USA_Magic_AI')
if AWACS_USA_Unit ~= nil then
   AWACS_USA_Ctrl = AWACS_USA_Unit:getGroup():getController()
   local Targets = AWACS_USA_Ctrl:getDetectedTargets(VISUAL, RADAR, RWR)
   if #Targets > 0 then
       local InterestingTargets = 0
       for n = 1, #Targets do
           if Targets[n].object:isExist() == true and Targets[n].object:inAir() == true and Targets[n].object:getCoalition() == 1 then
               InterestingTargets = InterestingTargets + 1
               local TargetPosition = Targets[n].object:getPosition()
               local BlueZoneInfo = trigger.misc.getZone('Blue_Land')
               local DistanceToBlueZone = math.sqrt(math.pow(TargetPosition.p.x - BlueZoneInfo.point.x, 2) + math.pow(TargetPosition.p.y - BlueZoneInfo.point.y, 2))
               if DistanceToBlueZone <= BlueZoneInfo.radius then
                   return true
               end
           end
       end
   end
end[/size]

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G | NVIDIA GTX 1080 Ti OC 11GB | 32 GB 3200 MHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TPR | Rift CV1

 

Link to comment
Share on other sites

Hi TOViper

 

That little script of yours looks almost like something I have been looking for for a LONG time. Would it be possible to modify it so that if a Red EWR detects a blue unit of a specific name inside a specific zone a flag is set to a certain value? Like "If RedEWR dectects BluePlayer inside RedZone -> Flag 99 is 1.

 

Skickat från min D5503 via Tapatalk

Link to comment
Share on other sites

I have a question about this original script. Once an aircraft is detected and a ground group is set to weapons free, does the script eventually revert this state, so the element of surprise can be used again?

GPU: PALIT NVIDIA RTX 3080 10GB | CPU: Intel Core i7-9700K 4,9GHz | RAM: 64GB DDR4 3000MHz
VR: HP Reverb G2 | HOTAS: TM Warthog Throttle and Stick
OS: Windows 10 22H2

Link to comment
Share on other sites

  • Recently Browsing   0 members

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