Merge pull request #324 from FlightControl-Master/FlightControl
Fixed accounting of targets in the new tasking system
@ -1,4 +1,4 @@
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Execute Combat Air Patrol (CAP).**
|
||||
--- **AI** - **Execute Combat Air Patrol (CAP).**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** --
|
||||
-- **Provide Close Air Support to friendly ground troops.**
|
||||
--- **AI** -- **Provide Close Air Support to friendly ground troops.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** --
|
||||
-- **Air Patrolling or Staging.**
|
||||
--- **AI** -- **Air Patrolling or Staging.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
|
||||
@ -1,71 +1,6 @@
|
||||
--- (SP) (MP) (FSM) Account for (Detect, count and report) DCS events occuring on DCS objects (units).
|
||||
--- **Actions** - ACT_ACCOUNT_ classes **account for** (detect, count & report) various DCS events occuring on @{Unit}s.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # @{#ACT_ACCOUNT} FSM class, extends @{Fsm#FSM_PROCESS}
|
||||
--
|
||||
-- ## ACT_ACCOUNT state machine:
|
||||
--
|
||||
-- This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
-- All derived classes from this class will start with the class name, followed by a \_. See the relevant derived class descriptions below.
|
||||
-- Each derived class follows exactly the same process, using the same events and following the same state transitions,
|
||||
-- but will have **different implementation behaviour** upon each event or state transition.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **Events**:
|
||||
--
|
||||
-- These are the events defined in this class:
|
||||
--
|
||||
-- * **Start**: The process is started. The process will go into the Report state.
|
||||
-- * **Event**: A relevant event has occured that needs to be accounted for. The process will go into the Account state.
|
||||
-- * **Report**: The process is reporting to the player the accounting status of the DCS events.
|
||||
-- * **More**: There are more DCS events that need to be accounted for. The process will go back into the Report state.
|
||||
-- * **NoMore**: There are no more DCS events that need to be accounted for. The process will go into the Success state.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **Event methods**:
|
||||
--
|
||||
-- Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process.
|
||||
-- There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:
|
||||
--
|
||||
-- * **Immediate**: The event method has exactly the name of the event.
|
||||
-- * **Delayed**: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **States**:
|
||||
--
|
||||
-- * **Assigned**: The player is assigned to the task. This is the initialization state for the process.
|
||||
-- * **Waiting**: the process is waiting for a DCS event to occur within the simulator. This state is set automatically.
|
||||
-- * **Report**: The process is Reporting to the players in the group of the unit. This state is set automatically every 30 seconds.
|
||||
-- * **Account**: The relevant DCS event has occurred, and is accounted for.
|
||||
-- * **Success (*)**: All DCS events were accounted for.
|
||||
-- * **Failed (*)**: The process has failed.
|
||||
--
|
||||
-- (*) End states of the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT state transition methods:
|
||||
--
|
||||
-- State transition functions can be set **by the mission designer** customizing or improving the behaviour of the state.
|
||||
-- There are 2 moments when state transition methods will be called by the state machine:
|
||||
--
|
||||
-- * **Before** the state transition.
|
||||
-- The state transition method needs to start with the name **OnBefore + the name of the state**.
|
||||
-- If the state transition method returns false, then the processing of the state transition will not be done!
|
||||
-- If you want to change the behaviour of the AIControllable at this event, return false,
|
||||
-- but then you'll need to specify your own logic using the AIControllable!
|
||||
--
|
||||
-- * **After** the state transition.
|
||||
-- The state transition method needs to start with the name **OnAfter + the name of the state**.
|
||||
-- These state transition methods need to provide a return value, which is specified at the function description.
|
||||
--
|
||||
-- # 1) @{#ACT_ACCOUNT_DEADS} FSM class, extends @{Fsm.Account#ACT_ACCOUNT}
|
||||
--
|
||||
-- The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.
|
||||
-- The process is given a @{Set} of units that will be tracked upon successful destruction.
|
||||
-- The process will end after each target has been successfully destroyed.
|
||||
-- Each successful dead will trigger an Account state transition that can be scored, modified or administered.
|
||||
--
|
||||
--
|
||||
-- ## ACT_ACCOUNT_DEADS constructor:
|
||||
--
|
||||
-- * @{#ACT_ACCOUNT_DEADS.New}(): Creates a new ACT_ACCOUNT_DEADS object.
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -74,7 +9,51 @@
|
||||
|
||||
do -- ACT_ACCOUNT
|
||||
|
||||
--- ACT_ACCOUNT class
|
||||
--- # @{#ACT_ACCOUNT} FSM class, extends @{Fsm#FSM_PROCESS}
|
||||
--
|
||||
-- ## ACT_ACCOUNT state machine:
|
||||
--
|
||||
-- This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
-- All derived classes from this class will start with the class name, followed by a \_. See the relevant derived class descriptions below.
|
||||
-- Each derived class follows exactly the same process, using the same events and following the same state transitions,
|
||||
-- but will have **different implementation behaviour** upon each event or state transition.
|
||||
--
|
||||
-- ### ACT_ACCOUNT States
|
||||
--
|
||||
-- * **Asigned**: The player is assigned.
|
||||
-- * **Waiting**: Waiting for an event.
|
||||
-- * **Report**: Reporting.
|
||||
-- * **Account**: Account for an event.
|
||||
-- * **Accounted**: All events have been accounted for, end of the process.
|
||||
-- * **Failed**: Failed the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT Events
|
||||
--
|
||||
-- * **Start**: Start the process.
|
||||
-- * **Wait**: Wait for an event.
|
||||
-- * **Report**: Report the status of the accounting.
|
||||
-- * **Event**: An event happened, process the event.
|
||||
-- * **More**: More targets.
|
||||
-- * **NoMore (*)**: No more targets.
|
||||
-- * **Fail (*)**: The action process has failed.
|
||||
--
|
||||
-- (*) End states of the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT state transition methods:
|
||||
--
|
||||
-- State transition functions can be set **by the mission designer** customizing or improving the behaviour of the state.
|
||||
-- There are 2 moments when state transition methods will be called by the state machine:
|
||||
--
|
||||
-- * **Before** the state transition.
|
||||
-- The state transition method needs to start with the name **OnBefore + the name of the state**.
|
||||
-- If the state transition method returns false, then the processing of the state transition will not be done!
|
||||
-- If you want to change the behaviour of the AIControllable at this event, return false,
|
||||
-- but then you'll need to specify your own logic using the AIControllable!
|
||||
--
|
||||
-- * **After** the state transition.
|
||||
-- The state transition method needs to start with the name **OnAfter + the name of the state**.
|
||||
-- These state transition methods need to provide a return value, which is specified at the function description.
|
||||
--
|
||||
-- @type ACT_ACCOUNT
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @extends Core.Fsm#FSM_PROCESS
|
||||
@ -156,7 +135,18 @@ end -- ACT_ACCOUNT
|
||||
|
||||
do -- ACT_ACCOUNT_DEADS
|
||||
|
||||
--- ACT_ACCOUNT_DEADS class
|
||||
--- # @{#ACT_ACCOUNT_DEADS} FSM class, extends @{Fsm.Account#ACT_ACCOUNT}
|
||||
--
|
||||
-- The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.
|
||||
-- The process is given a @{Set} of units that will be tracked upon successful destruction.
|
||||
-- The process will end after each target has been successfully destroyed.
|
||||
-- Each successful dead will trigger an Account state transition that can be scored, modified or administered.
|
||||
--
|
||||
--
|
||||
-- ## ACT_ACCOUNT_DEADS constructor:
|
||||
--
|
||||
-- * @{#ACT_ACCOUNT_DEADS.New}(): Creates a new ACT_ACCOUNT_DEADS object.
|
||||
--
|
||||
-- @type ACT_ACCOUNT_DEADS
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @extends #ACT_ACCOUNT
|
||||
@ -200,7 +190,7 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onenterReport( ProcessUnit, From, Event, To )
|
||||
function ACT_ACCOUNT_DEADS:onenterReport( ProcessUnit, Task, From, Event, To )
|
||||
self:E( { ProcessUnit, From, Event, To } )
|
||||
|
||||
self:Message( "Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:GetUnitTypesText() .. " targets left to be destroyed." )
|
||||
@ -213,17 +203,21 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onenterAccount( ProcessUnit, From, Event, To, EventData )
|
||||
function ACT_ACCOUNT_DEADS:onenterAccount( ProcessUnit, Task, From, Event, To, EventData )
|
||||
self:T( { ProcessUnit, EventData, From, Event, To } )
|
||||
|
||||
self:T({self.Controllable})
|
||||
|
||||
self.TargetSetUnit:Flush()
|
||||
|
||||
self:T( { "Before sending Message", EventData.IniUnitName, self.TargetSetUnit:FindUnit( EventData.IniUnitName ) } )
|
||||
if self.TargetSetUnit:FindUnit( EventData.IniUnitName ) then
|
||||
self:T( "Sending Message" )
|
||||
local TaskGroup = ProcessUnit:GetGroup()
|
||||
self.TargetSetUnit:Remove( EventData.IniUnitName )
|
||||
self:Message( "You hit a target. Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:Count() .. " targets ( " .. self.TargetSetUnit:GetUnitTypesText() .. " ) left to be destroyed." )
|
||||
end
|
||||
self:T( { "After sending Message" } )
|
||||
end
|
||||
|
||||
--- StateMachine callback function
|
||||
@ -232,9 +226,9 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onafterEvent( ProcessUnit, From, Event, To, EventData )
|
||||
function ACT_ACCOUNT_DEADS:onafterEvent( ProcessUnit, Task, From, Event, To )
|
||||
|
||||
if self.TargetSetUnit:Count() > 1 then
|
||||
if self.TargetSetUnit:Count() > 0 then
|
||||
self:__More( 1 )
|
||||
else
|
||||
self:__NoMore( 1 )
|
||||
|
||||
@ -1,238 +1,6 @@
|
||||
--- This module contains the DETECTION classes.
|
||||
--- **Functional** - DETECTION_ classes model the detection of enemy units by FACs or RECCEs and group them according various methods.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{#DETECTION_BASE} class, extends @{Fsm#FSM}
|
||||
--
|
||||
-- The @{#DETECTION_BASE} class defines the core functions to administer detected objects.
|
||||
-- The @{#DETECTION_BASE} class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
--
|
||||
-- ## 1.1) DETECTION_BASE constructor
|
||||
--
|
||||
-- Construct a new DETECTION_BASE instance using the @{#DETECTION_BASE.New}() method.
|
||||
--
|
||||
-- ## 1.2) DETECTION_BASE initialization
|
||||
--
|
||||
-- By default, detection will return detected objects with all the detection sensors available.
|
||||
-- However, you can ask how the objects were found with specific detection methods.
|
||||
-- If you use one of the below methods, the detection will work with the detection method specified.
|
||||
-- You can specify to apply multiple detection methods.
|
||||
--
|
||||
-- Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:
|
||||
--
|
||||
-- * @{#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
--
|
||||
-- ## 1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list
|
||||
--
|
||||
-- DETECTION_BASE derived classes build a list called DetectedItems[], which is essentially a first later
|
||||
-- of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains
|
||||
-- a SET_UNIT object that contains the detected units that belong to that group.
|
||||
--
|
||||
-- Derived classes will apply different methods to group the detected units.
|
||||
-- Examples are per area, per quadrant, per distance, per type.
|
||||
-- See further the derived DETECTION classes on which grouping methods are currently supported.
|
||||
--
|
||||
-- Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:
|
||||
--
|
||||
-- * The method @{Detection#DETECTION_BASE.GetDetectedItems}() retrieves the DetectedItems[] list.
|
||||
-- * A DetectedItem from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedItem}( DetectedItemIndex ).
|
||||
-- Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information
|
||||
-- about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.
|
||||
-- * A DetectedSet from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedSet}( DetectedItemIndex ).
|
||||
-- This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).
|
||||
--
|
||||
-- ## 1.4) Apply additional Filters to fine-tune the detected objects
|
||||
--
|
||||
-- By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means.
|
||||
-- That being said, the DCS World detection algorithm can sometimes be unrealistic.
|
||||
-- Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities.
|
||||
-- Additionally, trees and other obstacles are not accounted during the DCS World detection.
|
||||
--
|
||||
-- Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units.
|
||||
-- For electronic detection, this filtering is not applied, only for visually detected targets.
|
||||
--
|
||||
-- The following additional filtering can be applied for visual filtering:
|
||||
--
|
||||
-- * A probability factor per kilometer distance.
|
||||
-- * A probability factor based on the alpha angle between the detected object and the unit detecting.
|
||||
-- A detection from a higher altitude allows for better detection than when on the ground.
|
||||
-- * Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult.
|
||||
-- The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.
|
||||
--
|
||||
-- I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters.
|
||||
-- Only when you experience unrealistic behaviour in your missions, these filters could be applied.
|
||||
--
|
||||
-- ### 1.4.1 ) Distance visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the further away a detected object is, the less likely it is to be detected properly.
|
||||
-- Also, the speed of accurate detection plays a role.
|
||||
--
|
||||
-- A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.
|
||||
--
|
||||
-- For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like:
|
||||
-- 1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.
|
||||
--
|
||||
-- Note that based on this probability factor, not only the detection but also the **type** of the unit will be applied!
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetDistanceProbability}() to set the probability factor upon a 10 km distance.
|
||||
--
|
||||
-- ### 1.4.2 ) Alpha Angle visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.
|
||||
-- A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.
|
||||
--
|
||||
-- A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.
|
||||
--
|
||||
-- For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like:
|
||||
-- 0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAlphaAngleProbability}() to set the probability factor if 0°.
|
||||
--
|
||||
-- ### 1.4.3 ) Cloudy Zones detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.
|
||||
-- The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission
|
||||
-- zones that reflect cloudy areas where detected units may not be so easily visually detected.
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetZoneProbability}() to set for a defined number of zones, the probability factors.
|
||||
--
|
||||
-- Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take
|
||||
-- from the DETECTION_BASE to calculate the presence of the detected unit within each zone.
|
||||
-- Expecially for ZONE_POLYGON, try to limit the amount of nodes of the polygon!
|
||||
--
|
||||
-- Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for
|
||||
-- AI not to detect so easily targets within a forrest or village rich area.
|
||||
--
|
||||
-- ## 1.5 ) Accept / Reject detected units
|
||||
--
|
||||
-- DETECTION_BASE can accept or reject successful detections based on the location of the detected object,
|
||||
-- if it is located in range or located inside or outside of specific zones.
|
||||
--
|
||||
-- ### 1.5.1 ) Detection acceptance of within range limit
|
||||
--
|
||||
-- A range can be set that will limit a successful detection for a unit.
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptRange}() to apply a range in meters till where detected units will be accepted.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units if the range is below 5000 meters.
|
||||
-- Detection:SetAcceptRange( 5000 )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
--
|
||||
-- ### 1.5.2 ) Detection acceptance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptZones}() will accept detected units if they are within the specified zones.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be accepted.
|
||||
-- local ZoneAccept1 = ZONE:New( "AcceptZone1" )
|
||||
-- local ZoneAccept2 = ZONE:New( "AcceptZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
|
||||
-- Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ### 1.5.3 ) Detection rejectance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetRejectZones}() will reject detected units if they are within the specified zones.
|
||||
-- An example of how to use the method is shown below.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be rejected.
|
||||
-- local ZoneReject1 = ZONE:New( "RejectZone1" )
|
||||
-- local ZoneReject2 = ZONE:New( "RejectZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
|
||||
-- Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ## 1.6) DETECTION_BASE is a Finite State Machine
|
||||
--
|
||||
-- Various Events and State Transitions can be tailored using DETECTION_BASE.
|
||||
--
|
||||
-- ### 1.6.1) DETECTION_BASE States
|
||||
--
|
||||
-- * **Detecting**: The detection is running.
|
||||
-- * **Stopped**: The detection is stopped.
|
||||
--
|
||||
-- ### 1.6.2) DETECTION_BASE Events
|
||||
--
|
||||
-- * **Start**: Start the detection process.
|
||||
-- * **Detect**: Detect new units.
|
||||
-- * **Detected**: New units have been detected.
|
||||
-- * **Stop**: Stop the detection process.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 2) @{Detection#DETECTION_UNITS} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_UNITS} class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of units detected is large, the DetectedItems list will be large also.
|
||||
--
|
||||
-- # 3) @{Detection#DETECTION_TYPES} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_TYPES} class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
|
||||
-- Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also.
|
||||
--
|
||||
-- # 4) @{Detection#DETECTION_AREAS} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_AREAS} class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
||||
-- The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
-- A set with multiple detected zones will be created as there are groups of units detected.
|
||||
--
|
||||
-- ## 4.1) Retrieve the Detected Unit Sets and Detected Zones
|
||||
--
|
||||
-- The methods to manage the DetectedItems[].Set(s) are implemented in @{Detection#DECTECTION_BASE} and
|
||||
-- the methods to manage the DetectedItems[].Zone(s) is implemented in @{Detection#DETECTION_AREAS}.
|
||||
--
|
||||
-- Retrieve the DetectedItems[].Set with the method @{Detection#DETECTION_BASE.GetDetectedSet}(). A @{Set#SET_UNIT} object will be returned.
|
||||
--
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
--
|
||||
-- ## 4.4) Flare or Smoke detected units
|
||||
--
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
--
|
||||
-- ## 4.5) Flare or Smoke or Bound detected zones
|
||||
--
|
||||
-- Use the methods:
|
||||
--
|
||||
-- * @{Detection#DETECTION_AREAS.FlareDetectedZones}() to flare in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to smoke in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to bound with a tire with a white flag
|
||||
--
|
||||
-- the detected zones when a new detection has taken place.
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -249,7 +17,191 @@
|
||||
|
||||
do -- DETECTION_BASE
|
||||
|
||||
--- DETECTION_BASE class
|
||||
--- # 1) DETECTION_BASE class, extends @{Fsm#FSM}
|
||||
--
|
||||
-- The DETECTION_BASE class defines the core functions to administer detected objects.
|
||||
-- The DETECTION_BASE class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
--
|
||||
-- ## 1.1) DETECTION_BASE constructor
|
||||
--
|
||||
-- Construct a new DETECTION_BASE instance using the @{#DETECTION_BASE.New}() method.
|
||||
--
|
||||
-- ## 1.2) DETECTION_BASE initialization
|
||||
--
|
||||
-- By default, detection will return detected objects with all the detection sensors available.
|
||||
-- However, you can ask how the objects were found with specific detection methods.
|
||||
-- If you use one of the below methods, the detection will work with the detection method specified.
|
||||
-- You can specify to apply multiple detection methods.
|
||||
--
|
||||
-- Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:
|
||||
--
|
||||
-- * @{#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
--
|
||||
-- ## 1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list
|
||||
--
|
||||
-- DETECTION_BASE derived classes build a list called DetectedItems[], which is essentially a first later
|
||||
-- of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains
|
||||
-- a SET_UNIT object that contains the detected units that belong to that group.
|
||||
--
|
||||
-- Derived classes will apply different methods to group the detected units.
|
||||
-- Examples are per area, per quadrant, per distance, per type.
|
||||
-- See further the derived DETECTION classes on which grouping methods are currently supported.
|
||||
--
|
||||
-- Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:
|
||||
--
|
||||
-- * The method @{Detection#DETECTION_BASE.GetDetectedItems}() retrieves the DetectedItems[] list.
|
||||
-- * A DetectedItem from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedItem}( DetectedItemIndex ).
|
||||
-- Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information
|
||||
-- about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.
|
||||
-- * A DetectedSet from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedSet}( DetectedItemIndex ).
|
||||
-- This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).
|
||||
--
|
||||
-- ## 1.4) Apply additional Filters to fine-tune the detected objects
|
||||
--
|
||||
-- By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means.
|
||||
-- That being said, the DCS World detection algorithm can sometimes be unrealistic.
|
||||
-- Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities.
|
||||
-- Additionally, trees and other obstacles are not accounted during the DCS World detection.
|
||||
--
|
||||
-- Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units.
|
||||
-- For electronic detection, this filtering is not applied, only for visually detected targets.
|
||||
--
|
||||
-- The following additional filtering can be applied for visual filtering:
|
||||
--
|
||||
-- * A probability factor per kilometer distance.
|
||||
-- * A probability factor based on the alpha angle between the detected object and the unit detecting.
|
||||
-- A detection from a higher altitude allows for better detection than when on the ground.
|
||||
-- * Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult.
|
||||
-- The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.
|
||||
--
|
||||
-- I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters.
|
||||
-- Only when you experience unrealistic behaviour in your missions, these filters could be applied.
|
||||
--
|
||||
-- ### 1.4.1 ) Distance visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the further away a detected object is, the less likely it is to be detected properly.
|
||||
-- Also, the speed of accurate detection plays a role.
|
||||
--
|
||||
-- A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.
|
||||
--
|
||||
-- For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like:
|
||||
-- 1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.
|
||||
--
|
||||
-- Note that based on this probability factor, not only the detection but also the **type** of the unit will be applied!
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetDistanceProbability}() to set the probability factor upon a 10 km distance.
|
||||
--
|
||||
-- ### 1.4.2 ) Alpha Angle visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.
|
||||
-- A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.
|
||||
--
|
||||
-- A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.
|
||||
--
|
||||
-- For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like:
|
||||
-- 0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAlphaAngleProbability}() to set the probability factor if 0°.
|
||||
--
|
||||
-- ### 1.4.3 ) Cloudy Zones detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.
|
||||
-- The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission
|
||||
-- zones that reflect cloudy areas where detected units may not be so easily visually detected.
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetZoneProbability}() to set for a defined number of zones, the probability factors.
|
||||
--
|
||||
-- Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take
|
||||
-- from the DETECTION_BASE to calculate the presence of the detected unit within each zone.
|
||||
-- Expecially for ZONE_POLYGON, try to limit the amount of nodes of the polygon!
|
||||
--
|
||||
-- Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for
|
||||
-- AI not to detect so easily targets within a forrest or village rich area.
|
||||
--
|
||||
-- ## 1.5 ) Accept / Reject detected units
|
||||
--
|
||||
-- DETECTION_BASE can accept or reject successful detections based on the location of the detected object,
|
||||
-- if it is located in range or located inside or outside of specific zones.
|
||||
--
|
||||
-- ### 1.5.1 ) Detection acceptance of within range limit
|
||||
--
|
||||
-- A range can be set that will limit a successful detection for a unit.
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptRange}() to apply a range in meters till where detected units will be accepted.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units if the range is below 5000 meters.
|
||||
-- Detection:SetAcceptRange( 5000 )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
--
|
||||
-- ### 1.5.2 ) Detection acceptance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptZones}() will accept detected units if they are within the specified zones.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be accepted.
|
||||
-- local ZoneAccept1 = ZONE:New( "AcceptZone1" )
|
||||
-- local ZoneAccept2 = ZONE:New( "AcceptZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
|
||||
-- Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ### 1.5.3 ) Detection rejectance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetRejectZones}() will reject detected units if they are within the specified zones.
|
||||
-- An example of how to use the method is shown below.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be rejected.
|
||||
-- local ZoneReject1 = ZONE:New( "RejectZone1" )
|
||||
-- local ZoneReject2 = ZONE:New( "RejectZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
|
||||
-- Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ## 1.6) DETECTION_BASE is a Finite State Machine
|
||||
--
|
||||
-- Various Events and State Transitions can be tailored using DETECTION_BASE.
|
||||
--
|
||||
-- ### 1.6.1) DETECTION_BASE States
|
||||
--
|
||||
-- * **Detecting**: The detection is running.
|
||||
-- * **Stopped**: The detection is stopped.
|
||||
--
|
||||
-- ### 1.6.2) DETECTION_BASE Events
|
||||
--
|
||||
-- * **Start**: Start the detection process.
|
||||
-- * **Detect**: Detect new units.
|
||||
-- * **Detected**: New units have been detected.
|
||||
-- * **Stop**: Stop the detection process.
|
||||
--
|
||||
-- @type DETECTION_BASE
|
||||
-- @field Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @field Dcs.DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
@ -1222,7 +1174,12 @@ end
|
||||
|
||||
do -- DETECTION_UNITS
|
||||
|
||||
--- DETECTION_UNITS class
|
||||
--- # 2) DETECTION_UNITS class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_UNITS class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of units detected is large, the DetectedItems list will be large also.
|
||||
--
|
||||
-- @type DETECTION_UNITS
|
||||
-- @field Dcs.DCSTypes#Distance DetectionRange The range till which targets are detected.
|
||||
-- @extends #DETECTION_BASE
|
||||
@ -1432,7 +1389,13 @@ end
|
||||
|
||||
do -- DETECTION_TYPES
|
||||
|
||||
--- DETECTION_TYPES class
|
||||
--- # 3) DETECTION_TYPES class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_TYPES class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
|
||||
-- Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also.
|
||||
--
|
||||
-- @type DETECTION_TYPES
|
||||
-- @extends #DETECTION_BASE
|
||||
DETECTION_TYPES = {
|
||||
@ -1615,7 +1578,38 @@ end
|
||||
|
||||
do -- DETECTION_AREAS
|
||||
|
||||
--- DETECTION_AREAS class
|
||||
--- # 4) DETECTION_AREAS class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_AREAS class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
||||
-- The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
-- A set with multiple detected zones will be created as there are groups of units detected.
|
||||
--
|
||||
-- ## 4.1) Retrieve the Detected Unit Sets and Detected Zones
|
||||
--
|
||||
-- The methods to manage the DetectedItems[].Set(s) are implemented in @{Detection#DECTECTION_BASE} and
|
||||
-- the methods to manage the DetectedItems[].Zone(s) is implemented in @{Detection#DETECTION_AREAS}.
|
||||
--
|
||||
-- Retrieve the DetectedItems[].Set with the method @{Detection#DETECTION_BASE.GetDetectedSet}(). A @{Set#SET_UNIT} object will be returned.
|
||||
--
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
--
|
||||
-- ## 4.4) Flare or Smoke detected units
|
||||
--
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
--
|
||||
-- ## 4.5) Flare or Smoke or Bound detected zones
|
||||
--
|
||||
-- Use the methods:
|
||||
--
|
||||
-- * @{Detection#DETECTION_AREAS.FlareDetectedZones}() to flare in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to smoke in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to bound with a tire with a white flag
|
||||
--
|
||||
-- the detected zones when a new detection has taken place.
|
||||
--
|
||||
-- @type DETECTION_AREAS
|
||||
-- @field Dcs.DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||
-- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Unit}s, @{Zone}s, the center @{Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange.
|
||||
|
||||
@ -245,7 +245,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
||||
if TargetSetUnit then
|
||||
local Task = TASK_CAS:New( Mission, self.SetGroup, string.format( "CAS.%03d", ItemID ), TargetSetUnit )
|
||||
--Task:SetTargetZone( DetectedZone )
|
||||
Task:SetTargetZone( DetectedZone )
|
||||
Task:SetDispatcher( self )
|
||||
CASTask = Mission:AddTask( Task )
|
||||
end
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170319_0757' )
|
||||
env.info( 'Moose Generation Timestamp: 20170319_1459' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -25499,241 +25499,9 @@ end
|
||||
|
||||
|
||||
|
||||
--- This module contains the DETECTION classes.
|
||||
--- **Functional** - DETECTION_ classes model the detection of enemy units by FACs or RECCEs and group them according various methods.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{#DETECTION_BASE} class, extends @{Fsm#FSM}
|
||||
--
|
||||
-- The @{#DETECTION_BASE} class defines the core functions to administer detected objects.
|
||||
-- The @{#DETECTION_BASE} class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
--
|
||||
-- ## 1.1) DETECTION_BASE constructor
|
||||
--
|
||||
-- Construct a new DETECTION_BASE instance using the @{#DETECTION_BASE.New}() method.
|
||||
--
|
||||
-- ## 1.2) DETECTION_BASE initialization
|
||||
--
|
||||
-- By default, detection will return detected objects with all the detection sensors available.
|
||||
-- However, you can ask how the objects were found with specific detection methods.
|
||||
-- If you use one of the below methods, the detection will work with the detection method specified.
|
||||
-- You can specify to apply multiple detection methods.
|
||||
--
|
||||
-- Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:
|
||||
--
|
||||
-- * @{#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
--
|
||||
-- ## 1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list
|
||||
--
|
||||
-- DETECTION_BASE derived classes build a list called DetectedItems[], which is essentially a first later
|
||||
-- of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains
|
||||
-- a SET_UNIT object that contains the detected units that belong to that group.
|
||||
--
|
||||
-- Derived classes will apply different methods to group the detected units.
|
||||
-- Examples are per area, per quadrant, per distance, per type.
|
||||
-- See further the derived DETECTION classes on which grouping methods are currently supported.
|
||||
--
|
||||
-- Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:
|
||||
--
|
||||
-- * The method @{Detection#DETECTION_BASE.GetDetectedItems}() retrieves the DetectedItems[] list.
|
||||
-- * A DetectedItem from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedItem}( DetectedItemIndex ).
|
||||
-- Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information
|
||||
-- about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.
|
||||
-- * A DetectedSet from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedSet}( DetectedItemIndex ).
|
||||
-- This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).
|
||||
--
|
||||
-- ## 1.4) Apply additional Filters to fine-tune the detected objects
|
||||
--
|
||||
-- By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means.
|
||||
-- That being said, the DCS World detection algorithm can sometimes be unrealistic.
|
||||
-- Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities.
|
||||
-- Additionally, trees and other obstacles are not accounted during the DCS World detection.
|
||||
--
|
||||
-- Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units.
|
||||
-- For electronic detection, this filtering is not applied, only for visually detected targets.
|
||||
--
|
||||
-- The following additional filtering can be applied for visual filtering:
|
||||
--
|
||||
-- * A probability factor per kilometer distance.
|
||||
-- * A probability factor based on the alpha angle between the detected object and the unit detecting.
|
||||
-- A detection from a higher altitude allows for better detection than when on the ground.
|
||||
-- * Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult.
|
||||
-- The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.
|
||||
--
|
||||
-- I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters.
|
||||
-- Only when you experience unrealistic behaviour in your missions, these filters could be applied.
|
||||
--
|
||||
-- ### 1.4.1 ) Distance visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the further away a detected object is, the less likely it is to be detected properly.
|
||||
-- Also, the speed of accurate detection plays a role.
|
||||
--
|
||||
-- A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.
|
||||
--
|
||||
-- For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like:
|
||||
-- 1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.
|
||||
--
|
||||
-- Note that based on this probability factor, not only the detection but also the **type** of the unit will be applied!
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetDistanceProbability}() to set the probability factor upon a 10 km distance.
|
||||
--
|
||||
-- ### 1.4.2 ) Alpha Angle visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.
|
||||
-- A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.
|
||||
--
|
||||
-- A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.
|
||||
--
|
||||
-- For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like:
|
||||
-- 0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAlphaAngleProbability}() to set the probability factor if 0°.
|
||||
--
|
||||
-- ### 1.4.3 ) Cloudy Zones detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.
|
||||
-- The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission
|
||||
-- zones that reflect cloudy areas where detected units may not be so easily visually detected.
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetZoneProbability}() to set for a defined number of zones, the probability factors.
|
||||
--
|
||||
-- Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take
|
||||
-- from the DETECTION_BASE to calculate the presence of the detected unit within each zone.
|
||||
-- Expecially for ZONE_POLYGON, try to limit the amount of nodes of the polygon!
|
||||
--
|
||||
-- Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for
|
||||
-- AI not to detect so easily targets within a forrest or village rich area.
|
||||
--
|
||||
-- ## 1.5 ) Accept / Reject detected units
|
||||
--
|
||||
-- DETECTION_BASE can accept or reject successful detections based on the location of the detected object,
|
||||
-- if it is located in range or located inside or outside of specific zones.
|
||||
--
|
||||
-- ### 1.5.1 ) Detection acceptance of within range limit
|
||||
--
|
||||
-- A range can be set that will limit a successful detection for a unit.
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptRange}() to apply a range in meters till where detected units will be accepted.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units if the range is below 5000 meters.
|
||||
-- Detection:SetAcceptRange( 5000 )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
--
|
||||
-- ### 1.5.2 ) Detection acceptance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptZones}() will accept detected units if they are within the specified zones.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be accepted.
|
||||
-- local ZoneAccept1 = ZONE:New( "AcceptZone1" )
|
||||
-- local ZoneAccept2 = ZONE:New( "AcceptZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
|
||||
-- Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ### 1.5.3 ) Detection rejectance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetRejectZones}() will reject detected units if they are within the specified zones.
|
||||
-- An example of how to use the method is shown below.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be rejected.
|
||||
-- local ZoneReject1 = ZONE:New( "RejectZone1" )
|
||||
-- local ZoneReject2 = ZONE:New( "RejectZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
|
||||
-- Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ## 1.6) DETECTION_BASE is a Finite State Machine
|
||||
--
|
||||
-- Various Events and State Transitions can be tailored using DETECTION_BASE.
|
||||
--
|
||||
-- ### 1.6.1) DETECTION_BASE States
|
||||
--
|
||||
-- * **Detecting**: The detection is running.
|
||||
-- * **Stopped**: The detection is stopped.
|
||||
--
|
||||
-- ### 1.6.2) DETECTION_BASE Events
|
||||
--
|
||||
-- * **Start**: Start the detection process.
|
||||
-- * **Detect**: Detect new units.
|
||||
-- * **Detected**: New units have been detected.
|
||||
-- * **Stop**: Stop the detection process.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 2) @{Detection#DETECTION_UNITS} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_UNITS} class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of units detected is large, the DetectedItems list will be large also.
|
||||
--
|
||||
-- # 3) @{Detection#DETECTION_TYPES} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_TYPES} class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
|
||||
-- Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also.
|
||||
--
|
||||
-- # 4) @{Detection#DETECTION_AREAS} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_AREAS} class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
||||
-- The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
-- A set with multiple detected zones will be created as there are groups of units detected.
|
||||
--
|
||||
-- ## 4.1) Retrieve the Detected Unit Sets and Detected Zones
|
||||
--
|
||||
-- The methods to manage the DetectedItems[].Set(s) are implemented in @{Detection#DECTECTION_BASE} and
|
||||
-- the methods to manage the DetectedItems[].Zone(s) is implemented in @{Detection#DETECTION_AREAS}.
|
||||
--
|
||||
-- Retrieve the DetectedItems[].Set with the method @{Detection#DETECTION_BASE.GetDetectedSet}(). A @{Set#SET_UNIT} object will be returned.
|
||||
--
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
--
|
||||
-- ## 4.4) Flare or Smoke detected units
|
||||
--
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
--
|
||||
-- ## 4.5) Flare or Smoke or Bound detected zones
|
||||
--
|
||||
-- Use the methods:
|
||||
--
|
||||
-- * @{Detection#DETECTION_AREAS.FlareDetectedZones}() to flare in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to smoke in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to bound with a tire with a white flag
|
||||
--
|
||||
-- the detected zones when a new detection has taken place.
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -25750,7 +25518,191 @@ end
|
||||
|
||||
do -- DETECTION_BASE
|
||||
|
||||
--- DETECTION_BASE class
|
||||
--- # 1) DETECTION_BASE class, extends @{Fsm#FSM}
|
||||
--
|
||||
-- The DETECTION_BASE class defines the core functions to administer detected objects.
|
||||
-- The DETECTION_BASE class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
--
|
||||
-- ## 1.1) DETECTION_BASE constructor
|
||||
--
|
||||
-- Construct a new DETECTION_BASE instance using the @{#DETECTION_BASE.New}() method.
|
||||
--
|
||||
-- ## 1.2) DETECTION_BASE initialization
|
||||
--
|
||||
-- By default, detection will return detected objects with all the detection sensors available.
|
||||
-- However, you can ask how the objects were found with specific detection methods.
|
||||
-- If you use one of the below methods, the detection will work with the detection method specified.
|
||||
-- You can specify to apply multiple detection methods.
|
||||
--
|
||||
-- Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:
|
||||
--
|
||||
-- * @{#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
--
|
||||
-- ## 1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list
|
||||
--
|
||||
-- DETECTION_BASE derived classes build a list called DetectedItems[], which is essentially a first later
|
||||
-- of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains
|
||||
-- a SET_UNIT object that contains the detected units that belong to that group.
|
||||
--
|
||||
-- Derived classes will apply different methods to group the detected units.
|
||||
-- Examples are per area, per quadrant, per distance, per type.
|
||||
-- See further the derived DETECTION classes on which grouping methods are currently supported.
|
||||
--
|
||||
-- Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:
|
||||
--
|
||||
-- * The method @{Detection#DETECTION_BASE.GetDetectedItems}() retrieves the DetectedItems[] list.
|
||||
-- * A DetectedItem from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedItem}( DetectedItemIndex ).
|
||||
-- Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information
|
||||
-- about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.
|
||||
-- * A DetectedSet from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedSet}( DetectedItemIndex ).
|
||||
-- This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).
|
||||
--
|
||||
-- ## 1.4) Apply additional Filters to fine-tune the detected objects
|
||||
--
|
||||
-- By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means.
|
||||
-- That being said, the DCS World detection algorithm can sometimes be unrealistic.
|
||||
-- Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities.
|
||||
-- Additionally, trees and other obstacles are not accounted during the DCS World detection.
|
||||
--
|
||||
-- Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units.
|
||||
-- For electronic detection, this filtering is not applied, only for visually detected targets.
|
||||
--
|
||||
-- The following additional filtering can be applied for visual filtering:
|
||||
--
|
||||
-- * A probability factor per kilometer distance.
|
||||
-- * A probability factor based on the alpha angle between the detected object and the unit detecting.
|
||||
-- A detection from a higher altitude allows for better detection than when on the ground.
|
||||
-- * Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult.
|
||||
-- The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.
|
||||
--
|
||||
-- I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters.
|
||||
-- Only when you experience unrealistic behaviour in your missions, these filters could be applied.
|
||||
--
|
||||
-- ### 1.4.1 ) Distance visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the further away a detected object is, the less likely it is to be detected properly.
|
||||
-- Also, the speed of accurate detection plays a role.
|
||||
--
|
||||
-- A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.
|
||||
--
|
||||
-- For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like:
|
||||
-- 1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.
|
||||
--
|
||||
-- Note that based on this probability factor, not only the detection but also the **type** of the unit will be applied!
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetDistanceProbability}() to set the probability factor upon a 10 km distance.
|
||||
--
|
||||
-- ### 1.4.2 ) Alpha Angle visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.
|
||||
-- A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.
|
||||
--
|
||||
-- A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.
|
||||
--
|
||||
-- For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like:
|
||||
-- 0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAlphaAngleProbability}() to set the probability factor if 0°.
|
||||
--
|
||||
-- ### 1.4.3 ) Cloudy Zones detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.
|
||||
-- The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission
|
||||
-- zones that reflect cloudy areas where detected units may not be so easily visually detected.
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetZoneProbability}() to set for a defined number of zones, the probability factors.
|
||||
--
|
||||
-- Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take
|
||||
-- from the DETECTION_BASE to calculate the presence of the detected unit within each zone.
|
||||
-- Expecially for ZONE_POLYGON, try to limit the amount of nodes of the polygon!
|
||||
--
|
||||
-- Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for
|
||||
-- AI not to detect so easily targets within a forrest or village rich area.
|
||||
--
|
||||
-- ## 1.5 ) Accept / Reject detected units
|
||||
--
|
||||
-- DETECTION_BASE can accept or reject successful detections based on the location of the detected object,
|
||||
-- if it is located in range or located inside or outside of specific zones.
|
||||
--
|
||||
-- ### 1.5.1 ) Detection acceptance of within range limit
|
||||
--
|
||||
-- A range can be set that will limit a successful detection for a unit.
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptRange}() to apply a range in meters till where detected units will be accepted.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units if the range is below 5000 meters.
|
||||
-- Detection:SetAcceptRange( 5000 )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
--
|
||||
-- ### 1.5.2 ) Detection acceptance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptZones}() will accept detected units if they are within the specified zones.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be accepted.
|
||||
-- local ZoneAccept1 = ZONE:New( "AcceptZone1" )
|
||||
-- local ZoneAccept2 = ZONE:New( "AcceptZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
|
||||
-- Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ### 1.5.3 ) Detection rejectance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetRejectZones}() will reject detected units if they are within the specified zones.
|
||||
-- An example of how to use the method is shown below.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be rejected.
|
||||
-- local ZoneReject1 = ZONE:New( "RejectZone1" )
|
||||
-- local ZoneReject2 = ZONE:New( "RejectZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
|
||||
-- Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ## 1.6) DETECTION_BASE is a Finite State Machine
|
||||
--
|
||||
-- Various Events and State Transitions can be tailored using DETECTION_BASE.
|
||||
--
|
||||
-- ### 1.6.1) DETECTION_BASE States
|
||||
--
|
||||
-- * **Detecting**: The detection is running.
|
||||
-- * **Stopped**: The detection is stopped.
|
||||
--
|
||||
-- ### 1.6.2) DETECTION_BASE Events
|
||||
--
|
||||
-- * **Start**: Start the detection process.
|
||||
-- * **Detect**: Detect new units.
|
||||
-- * **Detected**: New units have been detected.
|
||||
-- * **Stop**: Stop the detection process.
|
||||
--
|
||||
-- @type DETECTION_BASE
|
||||
-- @field Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @field Dcs.DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
@ -26723,7 +26675,12 @@ end
|
||||
|
||||
do -- DETECTION_UNITS
|
||||
|
||||
--- DETECTION_UNITS class
|
||||
--- # 2) DETECTION_UNITS class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_UNITS class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of units detected is large, the DetectedItems list will be large also.
|
||||
--
|
||||
-- @type DETECTION_UNITS
|
||||
-- @field Dcs.DCSTypes#Distance DetectionRange The range till which targets are detected.
|
||||
-- @extends #DETECTION_BASE
|
||||
@ -26933,7 +26890,13 @@ end
|
||||
|
||||
do -- DETECTION_TYPES
|
||||
|
||||
--- DETECTION_TYPES class
|
||||
--- # 3) DETECTION_TYPES class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_TYPES class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
|
||||
-- Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also.
|
||||
--
|
||||
-- @type DETECTION_TYPES
|
||||
-- @extends #DETECTION_BASE
|
||||
DETECTION_TYPES = {
|
||||
@ -27116,7 +27079,38 @@ end
|
||||
|
||||
do -- DETECTION_AREAS
|
||||
|
||||
--- DETECTION_AREAS class
|
||||
--- # 4) DETECTION_AREAS class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_AREAS class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
||||
-- The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
-- A set with multiple detected zones will be created as there are groups of units detected.
|
||||
--
|
||||
-- ## 4.1) Retrieve the Detected Unit Sets and Detected Zones
|
||||
--
|
||||
-- The methods to manage the DetectedItems[].Set(s) are implemented in @{Detection#DECTECTION_BASE} and
|
||||
-- the methods to manage the DetectedItems[].Zone(s) is implemented in @{Detection#DETECTION_AREAS}.
|
||||
--
|
||||
-- Retrieve the DetectedItems[].Set with the method @{Detection#DETECTION_BASE.GetDetectedSet}(). A @{Set#SET_UNIT} object will be returned.
|
||||
--
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
--
|
||||
-- ## 4.4) Flare or Smoke detected units
|
||||
--
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
--
|
||||
-- ## 4.5) Flare or Smoke or Bound detected zones
|
||||
--
|
||||
-- Use the methods:
|
||||
--
|
||||
-- * @{Detection#DETECTION_AREAS.FlareDetectedZones}() to flare in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to smoke in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to bound with a tire with a white flag
|
||||
--
|
||||
-- the detected zones when a new detection has taken place.
|
||||
--
|
||||
-- @type DETECTION_AREAS
|
||||
-- @field Dcs.DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||
-- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Unit}s, @{Zone}s, the center @{Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange.
|
||||
@ -27861,8 +27855,7 @@ end
|
||||
|
||||
|
||||
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** --
|
||||
-- **Air Patrolling or Staging.**
|
||||
--- **AI** -- **Air Patrolling or Staging.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
@ -28800,8 +28793,7 @@ function AI_PATROL_ZONE:OnPilotDead( EventData )
|
||||
self:__PilotDead( 1, EventData )
|
||||
end
|
||||
end
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** --
|
||||
-- **Provide Close Air Support to friendly ground troops.**
|
||||
--- **AI** -- **Provide Close Air Support to friendly ground troops.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
@ -29375,7 +29367,7 @@ function AI_CAS_ZONE:OnEventDead( EventData )
|
||||
end
|
||||
|
||||
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Execute Combat Air Patrol (CAP).**
|
||||
--- **AI** - **Execute Combat Air Patrol (CAP).**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
@ -31625,74 +31617,9 @@ do -- ACT_ROUTE_ZONE
|
||||
end
|
||||
|
||||
end -- ACT_ROUTE_ZONE
|
||||
--- (SP) (MP) (FSM) Account for (Detect, count and report) DCS events occuring on DCS objects (units).
|
||||
--- **Actions** - ACT_ACCOUNT_ classes **account for** (detect, count & report) various DCS events occuring on @{Unit}s.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # @{#ACT_ACCOUNT} FSM class, extends @{Fsm#FSM_PROCESS}
|
||||
--
|
||||
-- ## ACT_ACCOUNT state machine:
|
||||
--
|
||||
-- This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
-- All derived classes from this class will start with the class name, followed by a \_. See the relevant derived class descriptions below.
|
||||
-- Each derived class follows exactly the same process, using the same events and following the same state transitions,
|
||||
-- but will have **different implementation behaviour** upon each event or state transition.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **Events**:
|
||||
--
|
||||
-- These are the events defined in this class:
|
||||
--
|
||||
-- * **Start**: The process is started. The process will go into the Report state.
|
||||
-- * **Event**: A relevant event has occured that needs to be accounted for. The process will go into the Account state.
|
||||
-- * **Report**: The process is reporting to the player the accounting status of the DCS events.
|
||||
-- * **More**: There are more DCS events that need to be accounted for. The process will go back into the Report state.
|
||||
-- * **NoMore**: There are no more DCS events that need to be accounted for. The process will go into the Success state.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **Event methods**:
|
||||
--
|
||||
-- Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process.
|
||||
-- There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:
|
||||
--
|
||||
-- * **Immediate**: The event method has exactly the name of the event.
|
||||
-- * **Delayed**: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **States**:
|
||||
--
|
||||
-- * **Assigned**: The player is assigned to the task. This is the initialization state for the process.
|
||||
-- * **Waiting**: the process is waiting for a DCS event to occur within the simulator. This state is set automatically.
|
||||
-- * **Report**: The process is Reporting to the players in the group of the unit. This state is set automatically every 30 seconds.
|
||||
-- * **Account**: The relevant DCS event has occurred, and is accounted for.
|
||||
-- * **Success (*)**: All DCS events were accounted for.
|
||||
-- * **Failed (*)**: The process has failed.
|
||||
--
|
||||
-- (*) End states of the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT state transition methods:
|
||||
--
|
||||
-- State transition functions can be set **by the mission designer** customizing or improving the behaviour of the state.
|
||||
-- There are 2 moments when state transition methods will be called by the state machine:
|
||||
--
|
||||
-- * **Before** the state transition.
|
||||
-- The state transition method needs to start with the name **OnBefore + the name of the state**.
|
||||
-- If the state transition method returns false, then the processing of the state transition will not be done!
|
||||
-- If you want to change the behaviour of the AIControllable at this event, return false,
|
||||
-- but then you'll need to specify your own logic using the AIControllable!
|
||||
--
|
||||
-- * **After** the state transition.
|
||||
-- The state transition method needs to start with the name **OnAfter + the name of the state**.
|
||||
-- These state transition methods need to provide a return value, which is specified at the function description.
|
||||
--
|
||||
-- # 1) @{#ACT_ACCOUNT_DEADS} FSM class, extends @{Fsm.Account#ACT_ACCOUNT}
|
||||
--
|
||||
-- The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.
|
||||
-- The process is given a @{Set} of units that will be tracked upon successful destruction.
|
||||
-- The process will end after each target has been successfully destroyed.
|
||||
-- Each successful dead will trigger an Account state transition that can be scored, modified or administered.
|
||||
--
|
||||
--
|
||||
-- ## ACT_ACCOUNT_DEADS constructor:
|
||||
--
|
||||
-- * @{#ACT_ACCOUNT_DEADS.New}(): Creates a new ACT_ACCOUNT_DEADS object.
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -31701,7 +31628,51 @@ end -- ACT_ROUTE_ZONE
|
||||
|
||||
do -- ACT_ACCOUNT
|
||||
|
||||
--- ACT_ACCOUNT class
|
||||
--- # @{#ACT_ACCOUNT} FSM class, extends @{Fsm#FSM_PROCESS}
|
||||
--
|
||||
-- ## ACT_ACCOUNT state machine:
|
||||
--
|
||||
-- This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
-- All derived classes from this class will start with the class name, followed by a \_. See the relevant derived class descriptions below.
|
||||
-- Each derived class follows exactly the same process, using the same events and following the same state transitions,
|
||||
-- but will have **different implementation behaviour** upon each event or state transition.
|
||||
--
|
||||
-- ### ACT_ACCOUNT States
|
||||
--
|
||||
-- * **Asigned**: The player is assigned.
|
||||
-- * **Waiting**: Waiting for an event.
|
||||
-- * **Report**: Reporting.
|
||||
-- * **Account**: Account for an event.
|
||||
-- * **Accounted**: All events have been accounted for, end of the process.
|
||||
-- * **Failed**: Failed the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT Events
|
||||
--
|
||||
-- * **Start**: Start the process.
|
||||
-- * **Wait**: Wait for an event.
|
||||
-- * **Report**: Report the status of the accounting.
|
||||
-- * **Event**: An event happened, process the event.
|
||||
-- * **More**: More targets.
|
||||
-- * **NoMore (*)**: No more targets.
|
||||
-- * **Fail (*)**: The action process has failed.
|
||||
--
|
||||
-- (*) End states of the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT state transition methods:
|
||||
--
|
||||
-- State transition functions can be set **by the mission designer** customizing or improving the behaviour of the state.
|
||||
-- There are 2 moments when state transition methods will be called by the state machine:
|
||||
--
|
||||
-- * **Before** the state transition.
|
||||
-- The state transition method needs to start with the name **OnBefore + the name of the state**.
|
||||
-- If the state transition method returns false, then the processing of the state transition will not be done!
|
||||
-- If you want to change the behaviour of the AIControllable at this event, return false,
|
||||
-- but then you'll need to specify your own logic using the AIControllable!
|
||||
--
|
||||
-- * **After** the state transition.
|
||||
-- The state transition method needs to start with the name **OnAfter + the name of the state**.
|
||||
-- These state transition methods need to provide a return value, which is specified at the function description.
|
||||
--
|
||||
-- @type ACT_ACCOUNT
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @extends Core.Fsm#FSM_PROCESS
|
||||
@ -31783,7 +31754,18 @@ end -- ACT_ACCOUNT
|
||||
|
||||
do -- ACT_ACCOUNT_DEADS
|
||||
|
||||
--- ACT_ACCOUNT_DEADS class
|
||||
--- # @{#ACT_ACCOUNT_DEADS} FSM class, extends @{Fsm.Account#ACT_ACCOUNT}
|
||||
--
|
||||
-- The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.
|
||||
-- The process is given a @{Set} of units that will be tracked upon successful destruction.
|
||||
-- The process will end after each target has been successfully destroyed.
|
||||
-- Each successful dead will trigger an Account state transition that can be scored, modified or administered.
|
||||
--
|
||||
--
|
||||
-- ## ACT_ACCOUNT_DEADS constructor:
|
||||
--
|
||||
-- * @{#ACT_ACCOUNT_DEADS.New}(): Creates a new ACT_ACCOUNT_DEADS object.
|
||||
--
|
||||
-- @type ACT_ACCOUNT_DEADS
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @extends #ACT_ACCOUNT
|
||||
@ -31827,7 +31809,7 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onenterReport( ProcessUnit, From, Event, To )
|
||||
function ACT_ACCOUNT_DEADS:onenterReport( ProcessUnit, Task, From, Event, To )
|
||||
self:E( { ProcessUnit, From, Event, To } )
|
||||
|
||||
self:Message( "Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:GetUnitTypesText() .. " targets left to be destroyed." )
|
||||
@ -31840,17 +31822,21 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onenterAccount( ProcessUnit, From, Event, To, EventData )
|
||||
function ACT_ACCOUNT_DEADS:onenterAccount( ProcessUnit, Task, From, Event, To, EventData )
|
||||
self:T( { ProcessUnit, EventData, From, Event, To } )
|
||||
|
||||
self:T({self.Controllable})
|
||||
|
||||
self.TargetSetUnit:Flush()
|
||||
|
||||
self:T( { "Before sending Message", EventData.IniUnitName, self.TargetSetUnit:FindUnit( EventData.IniUnitName ) } )
|
||||
if self.TargetSetUnit:FindUnit( EventData.IniUnitName ) then
|
||||
self:T( "Sending Message" )
|
||||
local TaskGroup = ProcessUnit:GetGroup()
|
||||
self.TargetSetUnit:Remove( EventData.IniUnitName )
|
||||
self:Message( "You hit a target. Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:Count() .. " targets ( " .. self.TargetSetUnit:GetUnitTypesText() .. " ) left to be destroyed." )
|
||||
end
|
||||
self:T( { "After sending Message" } )
|
||||
end
|
||||
|
||||
--- StateMachine callback function
|
||||
@ -31859,9 +31845,9 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onafterEvent( ProcessUnit, From, Event, To, EventData )
|
||||
function ACT_ACCOUNT_DEADS:onafterEvent( ProcessUnit, Task, From, Event, To )
|
||||
|
||||
if self.TargetSetUnit:Count() > 1 then
|
||||
if self.TargetSetUnit:Count() > 0 then
|
||||
self:__More( 1 )
|
||||
else
|
||||
self:__NoMore( 1 )
|
||||
@ -34671,7 +34657,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
||||
if TargetSetUnit then
|
||||
local Task = TASK_CAS:New( Mission, self.SetGroup, string.format( "CAS.%03d", ItemID ), TargetSetUnit )
|
||||
--Task:SetTargetZone( DetectedZone )
|
||||
Task:SetTargetZone( DetectedZone )
|
||||
Task:SetDispatcher( self )
|
||||
CASTask = Mission:AddTask( Task )
|
||||
end
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170319_0757' )
|
||||
env.info( 'Moose Generation Timestamp: 20170319_1459' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -25499,241 +25499,9 @@ end
|
||||
|
||||
|
||||
|
||||
--- This module contains the DETECTION classes.
|
||||
--- **Functional** - DETECTION_ classes model the detection of enemy units by FACs or RECCEs and group them according various methods.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{#DETECTION_BASE} class, extends @{Fsm#FSM}
|
||||
--
|
||||
-- The @{#DETECTION_BASE} class defines the core functions to administer detected objects.
|
||||
-- The @{#DETECTION_BASE} class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
--
|
||||
-- ## 1.1) DETECTION_BASE constructor
|
||||
--
|
||||
-- Construct a new DETECTION_BASE instance using the @{#DETECTION_BASE.New}() method.
|
||||
--
|
||||
-- ## 1.2) DETECTION_BASE initialization
|
||||
--
|
||||
-- By default, detection will return detected objects with all the detection sensors available.
|
||||
-- However, you can ask how the objects were found with specific detection methods.
|
||||
-- If you use one of the below methods, the detection will work with the detection method specified.
|
||||
-- You can specify to apply multiple detection methods.
|
||||
--
|
||||
-- Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:
|
||||
--
|
||||
-- * @{#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
--
|
||||
-- ## 1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list
|
||||
--
|
||||
-- DETECTION_BASE derived classes build a list called DetectedItems[], which is essentially a first later
|
||||
-- of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains
|
||||
-- a SET_UNIT object that contains the detected units that belong to that group.
|
||||
--
|
||||
-- Derived classes will apply different methods to group the detected units.
|
||||
-- Examples are per area, per quadrant, per distance, per type.
|
||||
-- See further the derived DETECTION classes on which grouping methods are currently supported.
|
||||
--
|
||||
-- Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:
|
||||
--
|
||||
-- * The method @{Detection#DETECTION_BASE.GetDetectedItems}() retrieves the DetectedItems[] list.
|
||||
-- * A DetectedItem from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedItem}( DetectedItemIndex ).
|
||||
-- Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information
|
||||
-- about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.
|
||||
-- * A DetectedSet from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedSet}( DetectedItemIndex ).
|
||||
-- This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).
|
||||
--
|
||||
-- ## 1.4) Apply additional Filters to fine-tune the detected objects
|
||||
--
|
||||
-- By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means.
|
||||
-- That being said, the DCS World detection algorithm can sometimes be unrealistic.
|
||||
-- Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities.
|
||||
-- Additionally, trees and other obstacles are not accounted during the DCS World detection.
|
||||
--
|
||||
-- Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units.
|
||||
-- For electronic detection, this filtering is not applied, only for visually detected targets.
|
||||
--
|
||||
-- The following additional filtering can be applied for visual filtering:
|
||||
--
|
||||
-- * A probability factor per kilometer distance.
|
||||
-- * A probability factor based on the alpha angle between the detected object and the unit detecting.
|
||||
-- A detection from a higher altitude allows for better detection than when on the ground.
|
||||
-- * Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult.
|
||||
-- The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.
|
||||
--
|
||||
-- I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters.
|
||||
-- Only when you experience unrealistic behaviour in your missions, these filters could be applied.
|
||||
--
|
||||
-- ### 1.4.1 ) Distance visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the further away a detected object is, the less likely it is to be detected properly.
|
||||
-- Also, the speed of accurate detection plays a role.
|
||||
--
|
||||
-- A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.
|
||||
--
|
||||
-- For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like:
|
||||
-- 1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.
|
||||
--
|
||||
-- Note that based on this probability factor, not only the detection but also the **type** of the unit will be applied!
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetDistanceProbability}() to set the probability factor upon a 10 km distance.
|
||||
--
|
||||
-- ### 1.4.2 ) Alpha Angle visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.
|
||||
-- A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.
|
||||
--
|
||||
-- A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.
|
||||
--
|
||||
-- For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like:
|
||||
-- 0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAlphaAngleProbability}() to set the probability factor if 0°.
|
||||
--
|
||||
-- ### 1.4.3 ) Cloudy Zones detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.
|
||||
-- The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission
|
||||
-- zones that reflect cloudy areas where detected units may not be so easily visually detected.
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetZoneProbability}() to set for a defined number of zones, the probability factors.
|
||||
--
|
||||
-- Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take
|
||||
-- from the DETECTION_BASE to calculate the presence of the detected unit within each zone.
|
||||
-- Expecially for ZONE_POLYGON, try to limit the amount of nodes of the polygon!
|
||||
--
|
||||
-- Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for
|
||||
-- AI not to detect so easily targets within a forrest or village rich area.
|
||||
--
|
||||
-- ## 1.5 ) Accept / Reject detected units
|
||||
--
|
||||
-- DETECTION_BASE can accept or reject successful detections based on the location of the detected object,
|
||||
-- if it is located in range or located inside or outside of specific zones.
|
||||
--
|
||||
-- ### 1.5.1 ) Detection acceptance of within range limit
|
||||
--
|
||||
-- A range can be set that will limit a successful detection for a unit.
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptRange}() to apply a range in meters till where detected units will be accepted.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units if the range is below 5000 meters.
|
||||
-- Detection:SetAcceptRange( 5000 )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
--
|
||||
-- ### 1.5.2 ) Detection acceptance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptZones}() will accept detected units if they are within the specified zones.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be accepted.
|
||||
-- local ZoneAccept1 = ZONE:New( "AcceptZone1" )
|
||||
-- local ZoneAccept2 = ZONE:New( "AcceptZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
|
||||
-- Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ### 1.5.3 ) Detection rejectance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetRejectZones}() will reject detected units if they are within the specified zones.
|
||||
-- An example of how to use the method is shown below.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be rejected.
|
||||
-- local ZoneReject1 = ZONE:New( "RejectZone1" )
|
||||
-- local ZoneReject2 = ZONE:New( "RejectZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
|
||||
-- Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ## 1.6) DETECTION_BASE is a Finite State Machine
|
||||
--
|
||||
-- Various Events and State Transitions can be tailored using DETECTION_BASE.
|
||||
--
|
||||
-- ### 1.6.1) DETECTION_BASE States
|
||||
--
|
||||
-- * **Detecting**: The detection is running.
|
||||
-- * **Stopped**: The detection is stopped.
|
||||
--
|
||||
-- ### 1.6.2) DETECTION_BASE Events
|
||||
--
|
||||
-- * **Start**: Start the detection process.
|
||||
-- * **Detect**: Detect new units.
|
||||
-- * **Detected**: New units have been detected.
|
||||
-- * **Stop**: Stop the detection process.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 2) @{Detection#DETECTION_UNITS} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_UNITS} class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of units detected is large, the DetectedItems list will be large also.
|
||||
--
|
||||
-- # 3) @{Detection#DETECTION_TYPES} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_TYPES} class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
|
||||
-- Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also.
|
||||
--
|
||||
-- # 4) @{Detection#DETECTION_AREAS} class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The @{Detection#DETECTION_AREAS} class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
||||
-- The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
-- A set with multiple detected zones will be created as there are groups of units detected.
|
||||
--
|
||||
-- ## 4.1) Retrieve the Detected Unit Sets and Detected Zones
|
||||
--
|
||||
-- The methods to manage the DetectedItems[].Set(s) are implemented in @{Detection#DECTECTION_BASE} and
|
||||
-- the methods to manage the DetectedItems[].Zone(s) is implemented in @{Detection#DETECTION_AREAS}.
|
||||
--
|
||||
-- Retrieve the DetectedItems[].Set with the method @{Detection#DETECTION_BASE.GetDetectedSet}(). A @{Set#SET_UNIT} object will be returned.
|
||||
--
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
--
|
||||
-- ## 4.4) Flare or Smoke detected units
|
||||
--
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
--
|
||||
-- ## 4.5) Flare or Smoke or Bound detected zones
|
||||
--
|
||||
-- Use the methods:
|
||||
--
|
||||
-- * @{Detection#DETECTION_AREAS.FlareDetectedZones}() to flare in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to smoke in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to bound with a tire with a white flag
|
||||
--
|
||||
-- the detected zones when a new detection has taken place.
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -25750,7 +25518,191 @@ end
|
||||
|
||||
do -- DETECTION_BASE
|
||||
|
||||
--- DETECTION_BASE class
|
||||
--- # 1) DETECTION_BASE class, extends @{Fsm#FSM}
|
||||
--
|
||||
-- The DETECTION_BASE class defines the core functions to administer detected objects.
|
||||
-- The DETECTION_BASE class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
--
|
||||
-- ## 1.1) DETECTION_BASE constructor
|
||||
--
|
||||
-- Construct a new DETECTION_BASE instance using the @{#DETECTION_BASE.New}() method.
|
||||
--
|
||||
-- ## 1.2) DETECTION_BASE initialization
|
||||
--
|
||||
-- By default, detection will return detected objects with all the detection sensors available.
|
||||
-- However, you can ask how the objects were found with specific detection methods.
|
||||
-- If you use one of the below methods, the detection will work with the detection method specified.
|
||||
-- You can specify to apply multiple detection methods.
|
||||
--
|
||||
-- Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:
|
||||
--
|
||||
-- * @{#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
--
|
||||
-- ## 1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list
|
||||
--
|
||||
-- DETECTION_BASE derived classes build a list called DetectedItems[], which is essentially a first later
|
||||
-- of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains
|
||||
-- a SET_UNIT object that contains the detected units that belong to that group.
|
||||
--
|
||||
-- Derived classes will apply different methods to group the detected units.
|
||||
-- Examples are per area, per quadrant, per distance, per type.
|
||||
-- See further the derived DETECTION classes on which grouping methods are currently supported.
|
||||
--
|
||||
-- Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:
|
||||
--
|
||||
-- * The method @{Detection#DETECTION_BASE.GetDetectedItems}() retrieves the DetectedItems[] list.
|
||||
-- * A DetectedItem from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedItem}( DetectedItemIndex ).
|
||||
-- Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information
|
||||
-- about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.
|
||||
-- * A DetectedSet from the DetectedItems[] list can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedSet}( DetectedItemIndex ).
|
||||
-- This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).
|
||||
--
|
||||
-- ## 1.4) Apply additional Filters to fine-tune the detected objects
|
||||
--
|
||||
-- By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means.
|
||||
-- That being said, the DCS World detection algorithm can sometimes be unrealistic.
|
||||
-- Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities.
|
||||
-- Additionally, trees and other obstacles are not accounted during the DCS World detection.
|
||||
--
|
||||
-- Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units.
|
||||
-- For electronic detection, this filtering is not applied, only for visually detected targets.
|
||||
--
|
||||
-- The following additional filtering can be applied for visual filtering:
|
||||
--
|
||||
-- * A probability factor per kilometer distance.
|
||||
-- * A probability factor based on the alpha angle between the detected object and the unit detecting.
|
||||
-- A detection from a higher altitude allows for better detection than when on the ground.
|
||||
-- * Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult.
|
||||
-- The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.
|
||||
--
|
||||
-- I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters.
|
||||
-- Only when you experience unrealistic behaviour in your missions, these filters could be applied.
|
||||
--
|
||||
-- ### 1.4.1 ) Distance visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the further away a detected object is, the less likely it is to be detected properly.
|
||||
-- Also, the speed of accurate detection plays a role.
|
||||
--
|
||||
-- A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.
|
||||
--
|
||||
-- For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like:
|
||||
-- 1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.
|
||||
--
|
||||
-- Note that based on this probability factor, not only the detection but also the **type** of the unit will be applied!
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetDistanceProbability}() to set the probability factor upon a 10 km distance.
|
||||
--
|
||||
-- ### 1.4.2 ) Alpha Angle visual detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.
|
||||
-- A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.
|
||||
--
|
||||
-- A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.
|
||||
--
|
||||
-- For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like:
|
||||
-- 0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAlphaAngleProbability}() to set the probability factor if 0°.
|
||||
--
|
||||
-- ### 1.4.3 ) Cloudy Zones detection probability
|
||||
--
|
||||
-- Upon a **visual** detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.
|
||||
-- The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission
|
||||
-- zones that reflect cloudy areas where detected units may not be so easily visually detected.
|
||||
--
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetZoneProbability}() to set for a defined number of zones, the probability factors.
|
||||
--
|
||||
-- Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take
|
||||
-- from the DETECTION_BASE to calculate the presence of the detected unit within each zone.
|
||||
-- Expecially for ZONE_POLYGON, try to limit the amount of nodes of the polygon!
|
||||
--
|
||||
-- Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for
|
||||
-- AI not to detect so easily targets within a forrest or village rich area.
|
||||
--
|
||||
-- ## 1.5 ) Accept / Reject detected units
|
||||
--
|
||||
-- DETECTION_BASE can accept or reject successful detections based on the location of the detected object,
|
||||
-- if it is located in range or located inside or outside of specific zones.
|
||||
--
|
||||
-- ### 1.5.1 ) Detection acceptance of within range limit
|
||||
--
|
||||
-- A range can be set that will limit a successful detection for a unit.
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptRange}() to apply a range in meters till where detected units will be accepted.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units if the range is below 5000 meters.
|
||||
-- Detection:SetAcceptRange( 5000 )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
--
|
||||
-- ### 1.5.2 ) Detection acceptance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetAcceptZones}() will accept detected units if they are within the specified zones.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be accepted.
|
||||
-- local ZoneAccept1 = ZONE:New( "AcceptZone1" )
|
||||
-- local ZoneAccept2 = ZONE:New( "AcceptZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
|
||||
-- Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ### 1.5.3 ) Detection rejectance if within zone(s).
|
||||
--
|
||||
-- Specific ZONE_BASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONE_BASE object(s).
|
||||
-- Use the method @{Detection#DETECTION_BASE.SetRejectZones}() will reject detected units if they are within the specified zones.
|
||||
-- An example of how to use the method is shown below.
|
||||
--
|
||||
-- local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
--
|
||||
-- -- Search fo the zones where units are to be rejected.
|
||||
-- local ZoneReject1 = ZONE:New( "RejectZone1" )
|
||||
-- local ZoneReject2 = ZONE:New( "RejectZone2" )
|
||||
--
|
||||
-- -- Build a detect object.
|
||||
-- local Detection = DETECTION_BASE:New( SetGroup )
|
||||
--
|
||||
-- -- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
|
||||
-- Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } )
|
||||
--
|
||||
-- -- Start the Detection.
|
||||
-- Detection:Start()
|
||||
--
|
||||
-- ## 1.6) DETECTION_BASE is a Finite State Machine
|
||||
--
|
||||
-- Various Events and State Transitions can be tailored using DETECTION_BASE.
|
||||
--
|
||||
-- ### 1.6.1) DETECTION_BASE States
|
||||
--
|
||||
-- * **Detecting**: The detection is running.
|
||||
-- * **Stopped**: The detection is stopped.
|
||||
--
|
||||
-- ### 1.6.2) DETECTION_BASE Events
|
||||
--
|
||||
-- * **Start**: Start the detection process.
|
||||
-- * **Detect**: Detect new units.
|
||||
-- * **Detected**: New units have been detected.
|
||||
-- * **Stop**: Stop the detection process.
|
||||
--
|
||||
-- @type DETECTION_BASE
|
||||
-- @field Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @field Dcs.DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
@ -26723,7 +26675,12 @@ end
|
||||
|
||||
do -- DETECTION_UNITS
|
||||
|
||||
--- DETECTION_UNITS class
|
||||
--- # 2) DETECTION_UNITS class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_UNITS class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of units detected is large, the DetectedItems list will be large also.
|
||||
--
|
||||
-- @type DETECTION_UNITS
|
||||
-- @field Dcs.DCSTypes#Distance DetectionRange The range till which targets are detected.
|
||||
-- @extends #DETECTION_BASE
|
||||
@ -26933,7 +26890,13 @@ end
|
||||
|
||||
do -- DETECTION_TYPES
|
||||
|
||||
--- DETECTION_TYPES class
|
||||
--- # 3) DETECTION_TYPES class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_TYPES class will detect units within the battle zone.
|
||||
-- It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
|
||||
-- Each DetectedItem will contain a field Set, which contains a @{Set#SET_UNIT} containing ONE @{UNIT} object reference.
|
||||
-- Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also.
|
||||
--
|
||||
-- @type DETECTION_TYPES
|
||||
-- @extends #DETECTION_BASE
|
||||
DETECTION_TYPES = {
|
||||
@ -27116,7 +27079,38 @@ end
|
||||
|
||||
do -- DETECTION_AREAS
|
||||
|
||||
--- DETECTION_AREAS class
|
||||
--- # 4) DETECTION_AREAS class, extends @{Detection#DETECTION_BASE}
|
||||
--
|
||||
-- The DETECTION_AREAS class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
||||
-- The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
-- A set with multiple detected zones will be created as there are groups of units detected.
|
||||
--
|
||||
-- ## 4.1) Retrieve the Detected Unit Sets and Detected Zones
|
||||
--
|
||||
-- The methods to manage the DetectedItems[].Set(s) are implemented in @{Detection#DECTECTION_BASE} and
|
||||
-- the methods to manage the DetectedItems[].Zone(s) is implemented in @{Detection#DETECTION_AREAS}.
|
||||
--
|
||||
-- Retrieve the DetectedItems[].Set with the method @{Detection#DETECTION_BASE.GetDetectedSet}(). A @{Set#SET_UNIT} object will be returned.
|
||||
--
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
--
|
||||
-- ## 4.4) Flare or Smoke detected units
|
||||
--
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
--
|
||||
-- ## 4.5) Flare or Smoke or Bound detected zones
|
||||
--
|
||||
-- Use the methods:
|
||||
--
|
||||
-- * @{Detection#DETECTION_AREAS.FlareDetectedZones}() to flare in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to smoke in a color
|
||||
-- * @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to bound with a tire with a white flag
|
||||
--
|
||||
-- the detected zones when a new detection has taken place.
|
||||
--
|
||||
-- @type DETECTION_AREAS
|
||||
-- @field Dcs.DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||
-- @field #DETECTION_BASE.DetectedItems DetectedItems A list of areas containing the set of @{Unit}s, @{Zone}s, the center @{Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange.
|
||||
@ -27861,8 +27855,7 @@ end
|
||||
|
||||
|
||||
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** --
|
||||
-- **Air Patrolling or Staging.**
|
||||
--- **AI** -- **Air Patrolling or Staging.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
@ -28800,8 +28793,7 @@ function AI_PATROL_ZONE:OnPilotDead( EventData )
|
||||
self:__PilotDead( 1, EventData )
|
||||
end
|
||||
end
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** --
|
||||
-- **Provide Close Air Support to friendly ground troops.**
|
||||
--- **AI** -- **Provide Close Air Support to friendly ground troops.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
@ -29375,7 +29367,7 @@ function AI_CAS_ZONE:OnEventDead( EventData )
|
||||
end
|
||||
|
||||
|
||||
--- Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Execute Combat Air Patrol (CAP).**
|
||||
--- **AI** - **Execute Combat Air Patrol (CAP).**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
@ -31625,74 +31617,9 @@ do -- ACT_ROUTE_ZONE
|
||||
end
|
||||
|
||||
end -- ACT_ROUTE_ZONE
|
||||
--- (SP) (MP) (FSM) Account for (Detect, count and report) DCS events occuring on DCS objects (units).
|
||||
--- **Actions** - ACT_ACCOUNT_ classes **account for** (detect, count & report) various DCS events occuring on @{Unit}s.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # @{#ACT_ACCOUNT} FSM class, extends @{Fsm#FSM_PROCESS}
|
||||
--
|
||||
-- ## ACT_ACCOUNT state machine:
|
||||
--
|
||||
-- This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
-- All derived classes from this class will start with the class name, followed by a \_. See the relevant derived class descriptions below.
|
||||
-- Each derived class follows exactly the same process, using the same events and following the same state transitions,
|
||||
-- but will have **different implementation behaviour** upon each event or state transition.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **Events**:
|
||||
--
|
||||
-- These are the events defined in this class:
|
||||
--
|
||||
-- * **Start**: The process is started. The process will go into the Report state.
|
||||
-- * **Event**: A relevant event has occured that needs to be accounted for. The process will go into the Account state.
|
||||
-- * **Report**: The process is reporting to the player the accounting status of the DCS events.
|
||||
-- * **More**: There are more DCS events that need to be accounted for. The process will go back into the Report state.
|
||||
-- * **NoMore**: There are no more DCS events that need to be accounted for. The process will go into the Success state.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **Event methods**:
|
||||
--
|
||||
-- Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process.
|
||||
-- There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:
|
||||
--
|
||||
-- * **Immediate**: The event method has exactly the name of the event.
|
||||
-- * **Delayed**: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed.
|
||||
--
|
||||
-- ### ACT_ACCOUNT **States**:
|
||||
--
|
||||
-- * **Assigned**: The player is assigned to the task. This is the initialization state for the process.
|
||||
-- * **Waiting**: the process is waiting for a DCS event to occur within the simulator. This state is set automatically.
|
||||
-- * **Report**: The process is Reporting to the players in the group of the unit. This state is set automatically every 30 seconds.
|
||||
-- * **Account**: The relevant DCS event has occurred, and is accounted for.
|
||||
-- * **Success (*)**: All DCS events were accounted for.
|
||||
-- * **Failed (*)**: The process has failed.
|
||||
--
|
||||
-- (*) End states of the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT state transition methods:
|
||||
--
|
||||
-- State transition functions can be set **by the mission designer** customizing or improving the behaviour of the state.
|
||||
-- There are 2 moments when state transition methods will be called by the state machine:
|
||||
--
|
||||
-- * **Before** the state transition.
|
||||
-- The state transition method needs to start with the name **OnBefore + the name of the state**.
|
||||
-- If the state transition method returns false, then the processing of the state transition will not be done!
|
||||
-- If you want to change the behaviour of the AIControllable at this event, return false,
|
||||
-- but then you'll need to specify your own logic using the AIControllable!
|
||||
--
|
||||
-- * **After** the state transition.
|
||||
-- The state transition method needs to start with the name **OnAfter + the name of the state**.
|
||||
-- These state transition methods need to provide a return value, which is specified at the function description.
|
||||
--
|
||||
-- # 1) @{#ACT_ACCOUNT_DEADS} FSM class, extends @{Fsm.Account#ACT_ACCOUNT}
|
||||
--
|
||||
-- The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.
|
||||
-- The process is given a @{Set} of units that will be tracked upon successful destruction.
|
||||
-- The process will end after each target has been successfully destroyed.
|
||||
-- Each successful dead will trigger an Account state transition that can be scored, modified or administered.
|
||||
--
|
||||
--
|
||||
-- ## ACT_ACCOUNT_DEADS constructor:
|
||||
--
|
||||
-- * @{#ACT_ACCOUNT_DEADS.New}(): Creates a new ACT_ACCOUNT_DEADS object.
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -31701,7 +31628,51 @@ end -- ACT_ROUTE_ZONE
|
||||
|
||||
do -- ACT_ACCOUNT
|
||||
|
||||
--- ACT_ACCOUNT class
|
||||
--- # @{#ACT_ACCOUNT} FSM class, extends @{Fsm#FSM_PROCESS}
|
||||
--
|
||||
-- ## ACT_ACCOUNT state machine:
|
||||
--
|
||||
-- This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
-- All derived classes from this class will start with the class name, followed by a \_. See the relevant derived class descriptions below.
|
||||
-- Each derived class follows exactly the same process, using the same events and following the same state transitions,
|
||||
-- but will have **different implementation behaviour** upon each event or state transition.
|
||||
--
|
||||
-- ### ACT_ACCOUNT States
|
||||
--
|
||||
-- * **Asigned**: The player is assigned.
|
||||
-- * **Waiting**: Waiting for an event.
|
||||
-- * **Report**: Reporting.
|
||||
-- * **Account**: Account for an event.
|
||||
-- * **Accounted**: All events have been accounted for, end of the process.
|
||||
-- * **Failed**: Failed the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT Events
|
||||
--
|
||||
-- * **Start**: Start the process.
|
||||
-- * **Wait**: Wait for an event.
|
||||
-- * **Report**: Report the status of the accounting.
|
||||
-- * **Event**: An event happened, process the event.
|
||||
-- * **More**: More targets.
|
||||
-- * **NoMore (*)**: No more targets.
|
||||
-- * **Fail (*)**: The action process has failed.
|
||||
--
|
||||
-- (*) End states of the process.
|
||||
--
|
||||
-- ### ACT_ACCOUNT state transition methods:
|
||||
--
|
||||
-- State transition functions can be set **by the mission designer** customizing or improving the behaviour of the state.
|
||||
-- There are 2 moments when state transition methods will be called by the state machine:
|
||||
--
|
||||
-- * **Before** the state transition.
|
||||
-- The state transition method needs to start with the name **OnBefore + the name of the state**.
|
||||
-- If the state transition method returns false, then the processing of the state transition will not be done!
|
||||
-- If you want to change the behaviour of the AIControllable at this event, return false,
|
||||
-- but then you'll need to specify your own logic using the AIControllable!
|
||||
--
|
||||
-- * **After** the state transition.
|
||||
-- The state transition method needs to start with the name **OnAfter + the name of the state**.
|
||||
-- These state transition methods need to provide a return value, which is specified at the function description.
|
||||
--
|
||||
-- @type ACT_ACCOUNT
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @extends Core.Fsm#FSM_PROCESS
|
||||
@ -31783,7 +31754,18 @@ end -- ACT_ACCOUNT
|
||||
|
||||
do -- ACT_ACCOUNT_DEADS
|
||||
|
||||
--- ACT_ACCOUNT_DEADS class
|
||||
--- # @{#ACT_ACCOUNT_DEADS} FSM class, extends @{Fsm.Account#ACT_ACCOUNT}
|
||||
--
|
||||
-- The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.
|
||||
-- The process is given a @{Set} of units that will be tracked upon successful destruction.
|
||||
-- The process will end after each target has been successfully destroyed.
|
||||
-- Each successful dead will trigger an Account state transition that can be scored, modified or administered.
|
||||
--
|
||||
--
|
||||
-- ## ACT_ACCOUNT_DEADS constructor:
|
||||
--
|
||||
-- * @{#ACT_ACCOUNT_DEADS.New}(): Creates a new ACT_ACCOUNT_DEADS object.
|
||||
--
|
||||
-- @type ACT_ACCOUNT_DEADS
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @extends #ACT_ACCOUNT
|
||||
@ -31827,7 +31809,7 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onenterReport( ProcessUnit, From, Event, To )
|
||||
function ACT_ACCOUNT_DEADS:onenterReport( ProcessUnit, Task, From, Event, To )
|
||||
self:E( { ProcessUnit, From, Event, To } )
|
||||
|
||||
self:Message( "Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:GetUnitTypesText() .. " targets left to be destroyed." )
|
||||
@ -31840,17 +31822,21 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onenterAccount( ProcessUnit, From, Event, To, EventData )
|
||||
function ACT_ACCOUNT_DEADS:onenterAccount( ProcessUnit, Task, From, Event, To, EventData )
|
||||
self:T( { ProcessUnit, EventData, From, Event, To } )
|
||||
|
||||
self:T({self.Controllable})
|
||||
|
||||
self.TargetSetUnit:Flush()
|
||||
|
||||
self:T( { "Before sending Message", EventData.IniUnitName, self.TargetSetUnit:FindUnit( EventData.IniUnitName ) } )
|
||||
if self.TargetSetUnit:FindUnit( EventData.IniUnitName ) then
|
||||
self:T( "Sending Message" )
|
||||
local TaskGroup = ProcessUnit:GetGroup()
|
||||
self.TargetSetUnit:Remove( EventData.IniUnitName )
|
||||
self:Message( "You hit a target. Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:Count() .. " targets ( " .. self.TargetSetUnit:GetUnitTypesText() .. " ) left to be destroyed." )
|
||||
end
|
||||
self:T( { "After sending Message" } )
|
||||
end
|
||||
|
||||
--- StateMachine callback function
|
||||
@ -31859,9 +31845,9 @@ do -- ACT_ACCOUNT_DEADS
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT_DEADS:onafterEvent( ProcessUnit, From, Event, To, EventData )
|
||||
function ACT_ACCOUNT_DEADS:onafterEvent( ProcessUnit, Task, From, Event, To )
|
||||
|
||||
if self.TargetSetUnit:Count() > 1 then
|
||||
if self.TargetSetUnit:Count() > 0 then
|
||||
self:__More( 1 )
|
||||
else
|
||||
self:__NoMore( 1 )
|
||||
@ -34671,7 +34657,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
||||
if TargetSetUnit then
|
||||
local Task = TASK_CAS:New( Mission, self.SetGroup, string.format( "CAS.%03d", ItemID ), TargetSetUnit )
|
||||
--Task:SetTargetZone( DetectedZone )
|
||||
Task:SetTargetZone( DetectedZone )
|
||||
Task:SetDispatcher( self )
|
||||
CASTask = Mission:AddTask( Task )
|
||||
end
|
||||
|
||||
BIN
Moose Presentations/ACT_ACCOUNT.pptx
Normal file
@ -0,0 +1,65 @@
|
||||
---
|
||||
-- Name: TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 19 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the FAC(A)'s detecting targets and grouping them.
|
||||
-- 2. Check that the HQ provides menus to engage on a task set by the FACs.
|
||||
-- 3. Engage on a task and destroy a target. Check if scoring is given for that target.
|
||||
-- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given.
|
||||
-- 5. Restart the mission, and crash into the ground, check if you can get penalties.
|
||||
--
|
||||
local HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
||||
|
||||
local CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
|
||||
|
||||
local Scoring = SCORING:New( "Detect Demo" )
|
||||
|
||||
local Mission = MISSION
|
||||
:New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED )
|
||||
:AddScoring( Scoring )
|
||||
|
||||
local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart()
|
||||
|
||||
local FACAreas = DETECTION_AREAS:New( FACSet, 400 )
|
||||
FACAreas:BoundDetectedZones()
|
||||
|
||||
|
||||
local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart()
|
||||
|
||||
TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas )
|
||||
|
||||
--- @param #TaskDispatcher self
|
||||
-- @param From
|
||||
-- @param Event
|
||||
-- @param To
|
||||
-- @param Tasking.Task_A2G#TASK_A2G Task
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @param #string PlayerName
|
||||
function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName )
|
||||
Task:SetScoreOnDestroy( "Player " .. PlayerName .. " destroyed a target", 20, TaskUnit )
|
||||
Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit )
|
||||
Task:SetPenaltyOnFailed( "The task has failed completion!", -100, TaskUnit )
|
||||
end
|
||||
|
||||
-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004.
|
||||
-- This is just an example, but many more examples can follow...
|
||||
|
||||
-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission.
|
||||
-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion
|
||||
-- too early!
|
||||
|
||||
function Mission:OnBeforeComplete( From, Event, To )
|
||||
local Group004 = GROUP:FindByName( "Target #004" )
|
||||
if Group004:IsAlive() == false then
|
||||
Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" )
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
@ -72,7 +72,7 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>AI_Cap</code></h1>
|
||||
|
||||
<p>Single-Player:<strong>Yes</strong> / Multi-Player:<strong>Yes</strong> / AI:<strong>Yes</strong> / Human:<strong>No</strong> / Types:<strong>Air</strong> -- <strong>Execute Combat Air Patrol (CAP).</strong></p>
|
||||
<p><strong>AI</strong> - <strong>Execute Combat Air Patrol (CAP).</strong></p>
|
||||
|
||||
<p><img src="..\Presentations\AI_CAP\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
|
||||
@ -72,8 +72,7 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>AI_Cas</code></h1>
|
||||
|
||||
<p>Single-Player:<strong>Yes</strong> / Multi-Player:<strong>Yes</strong> / AI:<strong>Yes</strong> / Human:<strong>No</strong> / Types:<strong>Air</strong> --
|
||||
<strong>Provide Close Air Support to friendly ground troops.</strong></p>
|
||||
<p><strong>AI</strong> -- <strong>Provide Close Air Support to friendly ground troops.</strong></p>
|
||||
|
||||
<p><img src="..\Presentations\AI_CAS\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
|
||||
@ -72,8 +72,7 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>AI_Patrol</code></h1>
|
||||
|
||||
<p>Single-Player:<strong>Yes</strong> / Multi-Player:<strong>Yes</strong> / AI:<strong>Yes</strong> / Human:<strong>No</strong> / Types:<strong>Air</strong> --
|
||||
<strong>Air Patrolling or Staging.</strong></p>
|
||||
<p><strong>AI</strong> -- <strong>Air Patrolling or Staging.</strong></p>
|
||||
|
||||
<p><img src="..\Presentations\AI_PATROL\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
|
||||
@ -72,85 +72,11 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Account</code></h1>
|
||||
|
||||
<p>(SP) (MP) (FSM) Account for (Detect, count and report) DCS events occuring on DCS objects (units).</p>
|
||||
<p><strong>Actions</strong> - ACT<em>ACCOUNT</em> classes <strong>account for</strong> (detect, count & report) various DCS events occuring on <a href="Unit.html">Unit</a>s.</p>
|
||||
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1><a href="##(ACT_ACCOUNT)">#ACT_ACCOUNT</a> FSM class, extends <a href="Fsm.html##(FSM_PROCESS)">Fsm#FSM_PROCESS</a></h1>
|
||||
|
||||
<h2>ACT_ACCOUNT state machine:</h2>
|
||||
|
||||
<p>This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
All derived classes from this class will start with the class name, followed by a _. See the relevant derived class descriptions below.
|
||||
Each derived class follows exactly the same process, using the same events and following the same state transitions,
|
||||
but will have <strong>different implementation behaviour</strong> upon each event or state transition.</p>
|
||||
|
||||
<h3>ACT_ACCOUNT <strong>Events</strong>:</h3>
|
||||
|
||||
<p>These are the events defined in this class:</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Start</strong>: The process is started. The process will go into the Report state.</li>
|
||||
<li><strong>Event</strong>: A relevant event has occured that needs to be accounted for. The process will go into the Account state.</li>
|
||||
<li><strong>Report</strong>: The process is reporting to the player the accounting status of the DCS events.</li>
|
||||
<li><strong>More</strong>: There are more DCS events that need to be accounted for. The process will go back into the Report state.</li>
|
||||
<li><strong>NoMore</strong>: There are no more DCS events that need to be accounted for. The process will go into the Success state.</li>
|
||||
</ul>
|
||||
|
||||
<h3>ACT_ACCOUNT <strong>Event methods</strong>:</h3>
|
||||
|
||||
<p>Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process.
|
||||
There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Immediate</strong>: The event method has exactly the name of the event.</li>
|
||||
<li><strong>Delayed</strong>: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed. </li>
|
||||
</ul>
|
||||
|
||||
<h3>ACT_ACCOUNT <strong>States</strong>:</h3>
|
||||
|
||||
<ul>
|
||||
<li><strong>Assigned</strong>: The player is assigned to the task. This is the initialization state for the process.</li>
|
||||
<li><strong>Waiting</strong>: the process is waiting for a DCS event to occur within the simulator. This state is set automatically.</li>
|
||||
<li><strong>Report</strong>: The process is Reporting to the players in the group of the unit. This state is set automatically every 30 seconds.</li>
|
||||
<li><strong>Account</strong>: The relevant DCS event has occurred, and is accounted for.</li>
|
||||
<li><strong>Success (*)</strong>: All DCS events were accounted for. </li>
|
||||
<li><strong>Failed (*)</strong>: The process has failed.</li>
|
||||
</ul>
|
||||
|
||||
<p>(*) End states of the process.</p>
|
||||
|
||||
<h3>ACT_ACCOUNT state transition methods:</h3>
|
||||
|
||||
<p>State transition functions can be set <strong>by the mission designer</strong> customizing or improving the behaviour of the state.
|
||||
There are 2 moments when state transition methods will be called by the state machine:</p>
|
||||
|
||||
<ul>
|
||||
<li><p><strong>Before</strong> the state transition.
|
||||
The state transition method needs to start with the name <strong>OnBefore + the name of the state</strong>.
|
||||
If the state transition method returns false, then the processing of the state transition will not be done!
|
||||
If you want to change the behaviour of the AIControllable at this event, return false,
|
||||
but then you'll need to specify your own logic using the AIControllable!</p></li>
|
||||
<li><p><strong>After</strong> the state transition.
|
||||
The state transition method needs to start with the name <strong>OnAfter + the name of the state</strong>.
|
||||
These state transition methods need to provide a return value, which is specified at the function description.</p></li>
|
||||
</ul>
|
||||
|
||||
<h1>1) <a href="##(ACT_ACCOUNT_DEADS)">#ACT<em>ACCOUNT</em>DEADS</a> FSM class, extends <a href="Fsm.Account.html##(ACT_ACCOUNT)">Fsm.Account#ACT_ACCOUNT</a></h1>
|
||||
|
||||
<p>The ACT<em>ACCOUNT</em>DEADS class accounts (detects, counts and reports) successful kills of DCS units.
|
||||
The process is given a <a href="Set.html">Set</a> of units that will be tracked upon successful destruction.
|
||||
The process will end after each target has been successfully destroyed.
|
||||
Each successful dead will trigger an Account state transition that can be scored, modified or administered.</p>
|
||||
|
||||
|
||||
<h2>ACT<em>ACCOUNT</em>DEADS constructor:</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(ACT_ACCOUNT_DEADS).New">ACT<em>ACCOUNT</em>DEADS.New</a>(): Creates a new ACT<em>ACCOUNT</em>DEADS object.</li>
|
||||
</ul>
|
||||
<p><img src="..\Presentations\ACT_ACCOUNT\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
<hr/>
|
||||
|
||||
@ -279,19 +205,19 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ACT_ACCOUNT_DEADS).onafterEvent">ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To, EventData)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ACT_ACCOUNT_DEADS).onafterEvent">ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To, Task)</a></td>
|
||||
<td class="summary">
|
||||
<p>StateMachine callback function</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ACT_ACCOUNT_DEADS).onenterAccount">ACT_ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To, EventData)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ACT_ACCOUNT_DEADS).onenterAccount">ACT_ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To, Task, EventData)</a></td>
|
||||
<td class="summary">
|
||||
<p>StateMachine callback function</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ACT_ACCOUNT_DEADS).onenterReport">ACT_ACCOUNT_DEADS:onenterReport(ProcessUnit, Event, From, To)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ACT_ACCOUNT_DEADS).onenterReport">ACT_ACCOUNT_DEADS:onenterReport(ProcessUnit, Event, From, To, Task)</a></td>
|
||||
<td class="summary">
|
||||
<p>StateMachine callback function</p>
|
||||
</td>
|
||||
@ -337,7 +263,58 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
|
||||
<h2><a id="#(ACT_ACCOUNT)" >Type <code>ACT_ACCOUNT</code></a></h2>
|
||||
|
||||
<p>ACT_ACCOUNT class</p>
|
||||
<h1><a href="##(ACT_ACCOUNT)">#ACT_ACCOUNT</a> FSM class, extends <a href="Fsm.html##(FSM_PROCESS)">Fsm#FSM_PROCESS</a></h1>
|
||||
|
||||
<h2>ACT_ACCOUNT state machine:</h2>
|
||||
|
||||
<p>This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.</p>
|
||||
|
||||
|
||||
<p>All derived classes from this class will start with the class name, followed by a _. See the relevant derived class descriptions below.
|
||||
Each derived class follows exactly the same process, using the same events and following the same state transitions,
|
||||
but will have <strong>different implementation behaviour</strong> upon each event or state transition.</p>
|
||||
|
||||
<h3>ACT_ACCOUNT States</h3>
|
||||
|
||||
<ul>
|
||||
<li><strong>Asigned</strong>: The player is assigned.</li>
|
||||
<li><strong>Waiting</strong>: Waiting for an event.</li>
|
||||
<li><strong>Report</strong>: Reporting.</li>
|
||||
<li><strong>Account</strong>: Account for an event.</li>
|
||||
<li><strong>Accounted</strong>: All events have been accounted for, end of the process.</li>
|
||||
<li><strong>Failed</strong>: Failed the process.</li>
|
||||
</ul>
|
||||
|
||||
<h3>ACT_ACCOUNT Events</h3>
|
||||
|
||||
<ul>
|
||||
<li><strong>Start</strong>: Start the process.</li>
|
||||
<li><strong>Wait</strong>: Wait for an event.</li>
|
||||
<li><strong>Report</strong>: Report the status of the accounting.</li>
|
||||
<li><strong>Event</strong>: An event happened, process the event.</li>
|
||||
<li><strong>More</strong>: More targets.</li>
|
||||
<li><strong>NoMore (*)</strong>: No more targets.</li>
|
||||
<li><strong>Fail (*)</strong>: The action process has failed.</li>
|
||||
</ul>
|
||||
|
||||
<p>(*) End states of the process.</p>
|
||||
|
||||
<h3>ACT_ACCOUNT state transition methods:</h3>
|
||||
|
||||
<p>State transition functions can be set <strong>by the mission designer</strong> customizing or improving the behaviour of the state.
|
||||
There are 2 moments when state transition methods will be called by the state machine:</p>
|
||||
|
||||
<ul>
|
||||
<li><p><strong>Before</strong> the state transition.
|
||||
The state transition method needs to start with the name <strong>OnBefore + the name of the state</strong>.
|
||||
If the state transition method returns false, then the processing of the state transition will not be done!
|
||||
If you want to change the behaviour of the AIControllable at this event, return false,
|
||||
but then you'll need to specify your own logic using the AIControllable!</p></li>
|
||||
<li><p><strong>After</strong> the state transition.
|
||||
The state transition method needs to start with the name <strong>OnAfter + the name of the state</strong>.
|
||||
These state transition methods need to provide a return value, which is specified at the function description.</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
@ -511,7 +488,22 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
|
||||
<h2><a id="#(ACT_ACCOUNT_DEADS)" >Type <code>ACT_ACCOUNT_DEADS</code></a></h2>
|
||||
|
||||
<p>ACT<em>ACCOUNT</em>DEADS class</p>
|
||||
<h1><a href="##(ACT_ACCOUNT_DEADS)">#ACT<em>ACCOUNT</em>DEADS</a> FSM class, extends <a href="Fsm.Account.html##(ACT_ACCOUNT)">Fsm.Account#ACT_ACCOUNT</a></h1>
|
||||
|
||||
<p>The ACT<em>ACCOUNT</em>DEADS class accounts (detects, counts and reports) successful kills of DCS units.</p>
|
||||
|
||||
|
||||
<p>The process is given a <a href="Set.html">Set</a> of units that will be tracked upon successful destruction.
|
||||
The process will end after each target has been successfully destroyed.
|
||||
Each successful dead will trigger an Account state transition that can be scored, modified or administered.</p>
|
||||
|
||||
|
||||
<h2>ACT<em>ACCOUNT</em>DEADS constructor:</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(ACT_ACCOUNT_DEADS).New">ACT<em>ACCOUNT</em>DEADS.New</a>(): Creates a new ACT<em>ACCOUNT</em>DEADS object.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
@ -683,7 +675,7 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
<dt>
|
||||
|
||||
<a id="#(ACT_ACCOUNT_DEADS).onafterEvent" >
|
||||
<strong>ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To, EventData)</strong>
|
||||
<strong>ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To, Task)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -714,7 +706,7 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> EventData </em></code>: </p>
|
||||
<p><code><em> Task </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
@ -724,7 +716,7 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
<dt>
|
||||
|
||||
<a id="#(ACT_ACCOUNT_DEADS).onenterAccount" >
|
||||
<strong>ACT_ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To, EventData)</strong>
|
||||
<strong>ACT_ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To, Task, EventData)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -755,6 +747,11 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Task </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> EventData </em></code>: </p>
|
||||
|
||||
</li>
|
||||
@ -765,7 +762,7 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
<dt>
|
||||
|
||||
<a id="#(ACT_ACCOUNT_DEADS).onenterReport" >
|
||||
<strong>ACT_ACCOUNT_DEADS:onenterReport(ProcessUnit, Event, From, To)</strong>
|
||||
<strong>ACT_ACCOUNT_DEADS:onenterReport(ProcessUnit, Event, From, To, Task)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -793,6 +790,11 @@ Each successful dead will trigger an Account state transition that can be scored
|
||||
|
||||
<p><code><em>#string To </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Task </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
@ -72,273 +72,27 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Detection</code></h1>
|
||||
|
||||
<p> This module contains the DETECTION classes.</p>
|
||||
<p><strong>Functional</strong> - DETECTION_ classes model the detection of enemy units by FACs or RECCEs and group them according various methods.</p>
|
||||
|
||||
|
||||
<h1> </h1>
|
||||
|
||||
<p> # 1) <a href="##(DETECTION_BASE)">#DETECTION_BASE</a> class, extends <a href="Fsm.html##(FSM)">Fsm#FSM</a></p>
|
||||
|
||||
<p> The <a href="##(DETECTION_BASE)">#DETECTION_BASE</a> class defines the core functions to administer detected objects.
|
||||
The <a href="##(DETECTION_BASE)">#DETECTION_BASE</a> class will detect objects within the battle zone for a list of <a href="Group.html">Group</a>s detecting targets following (a) detection method(s).</p>
|
||||
|
||||
<p> ## 1.1) DETECTION_BASE constructor</p>
|
||||
|
||||
<p> Construct a new DETECTION_BASE instance using the <a href="##(DETECTION_BASE).New">DETECTION_BASE.New</a>() method.</p>
|
||||
|
||||
<p> ## 1.2) DETECTION_BASE initialization</p>
|
||||
|
||||
<p> By default, detection will return detected objects with all the detection sensors available.
|
||||
However, you can ask how the objects were found with specific detection methods.
|
||||
If you use one of the below methods, the detection will work with the detection method specified.
|
||||
You can specify to apply multiple detection methods.</p>
|
||||
|
||||
<p> Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectVisual">DETECTION_BASE.InitDetectVisual</a>(): Detected using Visual.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectOptical">DETECTION_BASE.InitDetectOptical</a>(): Detected using Optical.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectRadar">DETECTION_BASE.InitDetectRadar</a>(): Detected using Radar.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectIRST">DETECTION_BASE.InitDetectIRST</a>(): Detected using IRST.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectRWR">DETECTION_BASE.InitDetectRWR</a>(): Detected using RWR.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectDLINK">DETECTION_BASE.InitDetectDLINK</a>(): Detected using DLINK.</li>
|
||||
</ul>
|
||||
|
||||
<p> ## 1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list</p>
|
||||
|
||||
<p> DETECTION<em>BASE derived classes build a list called DetectedItems[], which is essentially a first later
|
||||
of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains
|
||||
a SET</em>UNIT object that contains the detected units that belong to that group.</p>
|
||||
|
||||
<p> Derived classes will apply different methods to group the detected units.
|
||||
Examples are per area, per quadrant, per distance, per type.
|
||||
See further the derived DETECTION classes on which grouping methods are currently supported. </p>
|
||||
|
||||
<p> Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:</p>
|
||||
|
||||
<ul>
|
||||
<li>The method <a href="Detection.html##(DETECTION_BASE).GetDetectedItems">Detection#DETECTION_BASE.GetDetectedItems</a>() retrieves the DetectedItems[] list.</li>
|
||||
<li>A DetectedItem from the DetectedItems[] list can be retrieved using the method <a href="Detection.html##(DETECTION_BASE).GetDetectedItem">Detection#DETECTION_BASE.GetDetectedItem</a>( DetectedItemIndex ).
|
||||
Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information
|
||||
about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.</li>
|
||||
<li>A DetectedSet from the DetectedItems[] list can be retrieved using the method <a href="Detection.html##(DETECTION_BASE).GetDetectedSet">Detection#DETECTION_BASE.GetDetectedSet</a>( DetectedItemIndex ).
|
||||
This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).</li>
|
||||
</ul>
|
||||
|
||||
<p> ## 1.4) Apply additional Filters to fine-tune the detected objects</p>
|
||||
|
||||
<p> By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means.
|
||||
That being said, the DCS World detection algorithm can sometimes be unrealistic.
|
||||
Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities.
|
||||
Additionally, trees and other obstacles are not accounted during the DCS World detection.</p>
|
||||
|
||||
<p> Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units.
|
||||
For electronic detection, this filtering is not applied, only for visually detected targets.</p>
|
||||
|
||||
<p> The following additional filtering can be applied for visual filtering:</p>
|
||||
|
||||
<ul>
|
||||
<li>A probability factor per kilometer distance.</li>
|
||||
<li>A probability factor based on the alpha angle between the detected object and the unit detecting.
|
||||
A detection from a higher altitude allows for better detection than when on the ground.</li>
|
||||
<li>Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult.
|
||||
The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.</li>
|
||||
</ul>
|
||||
|
||||
<p> I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters.
|
||||
Only when you experience unrealistic behaviour in your missions, these filters could be applied.</p>
|
||||
|
||||
<p> ### 1.4.1 ) Distance visual detection probability</p>
|
||||
|
||||
<p> Upon a <strong>visual</strong> detection, the further away a detected object is, the less likely it is to be detected properly.
|
||||
Also, the speed of accurate detection plays a role.</p>
|
||||
|
||||
<p> A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.</p>
|
||||
|
||||
<p> For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like:
|
||||
1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.</p>
|
||||
|
||||
<p> Note that based on this probability factor, not only the detection but also the <strong>type</strong> of the unit will be applied!</p>
|
||||
|
||||
<p> Use the method <a href="Detection.html##(DETECTION_BASE).SetDistanceProbability">Detection#DETECTION_BASE.SetDistanceProbability</a>() to set the probability factor upon a 10 km distance.</p>
|
||||
|
||||
<p> ### 1.4.2 ) Alpha Angle visual detection probability</p>
|
||||
|
||||
<p> Upon a <strong>visual</strong> detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.
|
||||
A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.</p>
|
||||
|
||||
<p> A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.</p>
|
||||
|
||||
<p> For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like:
|
||||
0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%</p>
|
||||
|
||||
<p> Use the method <a href="Detection.html##(DETECTION_BASE).SetAlphaAngleProbability">Detection#DETECTION_BASE.SetAlphaAngleProbability</a>() to set the probability factor if 0°.</p>
|
||||
|
||||
<p> ### 1.4.3 ) Cloudy Zones detection probability</p>
|
||||
|
||||
<p> Upon a <strong>visual</strong> detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.
|
||||
The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission
|
||||
zones that reflect cloudy areas where detected units may not be so easily visually detected.</p>
|
||||
|
||||
<p> Use the method <a href="Detection.html##(DETECTION_BASE).SetZoneProbability">Detection#DETECTION_BASE.SetZoneProbability</a>() to set for a defined number of zones, the probability factors.</p>
|
||||
|
||||
<p> Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take
|
||||
from the DETECTION<em>BASE to calculate the presence of the detected unit within each zone.
|
||||
Expecially for ZONE</em>POLYGON, try to limit the amount of nodes of the polygon!</p>
|
||||
|
||||
<p> Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for
|
||||
AI not to detect so easily targets within a forrest or village rich area.</p>
|
||||
|
||||
<p> ## 1.5 ) Accept / Reject detected units</p>
|
||||
|
||||
<p> DETECTION_BASE can accept or reject successful detections based on the location of the detected object,
|
||||
if it is located in range or located inside or outside of specific zones.</p>
|
||||
|
||||
<p> ### 1.5.1 ) Detection acceptance of within range limit</p>
|
||||
|
||||
<p> A range can be set that will limit a successful detection for a unit.
|
||||
Use the method <a href="Detection.html##(DETECTION_BASE).SetAcceptRange">Detection#DETECTION_BASE.SetAcceptRange</a>() to apply a range in meters till where detected units will be accepted.</p>
|
||||
|
||||
<pre><code> local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
|
||||
-- Build a detect object.
|
||||
local Detection = DETECTION_BASE:New( SetGroup )
|
||||
|
||||
-- This will accept detected units if the range is below 5000 meters.
|
||||
Detection:SetAcceptRange( 5000 )
|
||||
|
||||
-- Start the Detection.
|
||||
Detection:Start()
|
||||
</code></pre>
|
||||
|
||||
|
||||
<p> ### 1.5.2 ) Detection acceptance if within zone(s).</p>
|
||||
|
||||
<p> Specific ZONE<em>BASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONE</em>BASE object(s).
|
||||
Use the method <a href="Detection.html##(DETECTION_BASE).SetAcceptZones">Detection#DETECTION_BASE.SetAcceptZones</a>() will accept detected units if they are within the specified zones.</p>
|
||||
|
||||
<pre><code> local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
|
||||
-- Search fo the zones where units are to be accepted.
|
||||
local ZoneAccept1 = ZONE:New( "AcceptZone1" )
|
||||
local ZoneAccept2 = ZONE:New( "AcceptZone2" )
|
||||
|
||||
-- Build a detect object.
|
||||
local Detection = DETECTION_BASE:New( SetGroup )
|
||||
|
||||
-- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
|
||||
Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } )
|
||||
|
||||
-- Start the Detection.
|
||||
Detection:Start()
|
||||
</code></pre>
|
||||
|
||||
<p> ### 1.5.3 ) Detection rejectance if within zone(s).</p>
|
||||
|
||||
<p> Specific ZONE<em>BASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONE</em>BASE object(s).
|
||||
Use the method <a href="Detection.html##(DETECTION_BASE).SetRejectZones">Detection#DETECTION_BASE.SetRejectZones</a>() will reject detected units if they are within the specified zones.
|
||||
An example of how to use the method is shown below.</p>
|
||||
|
||||
<pre><code> local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
|
||||
-- Search fo the zones where units are to be rejected.
|
||||
local ZoneReject1 = ZONE:New( "RejectZone1" )
|
||||
local ZoneReject2 = ZONE:New( "RejectZone2" )
|
||||
|
||||
-- Build a detect object.
|
||||
local Detection = DETECTION_BASE:New( SetGroup )
|
||||
|
||||
-- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
|
||||
Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } )
|
||||
|
||||
-- Start the Detection.
|
||||
Detection:Start()
|
||||
</code></pre>
|
||||
|
||||
<p> ## 1.6) DETECTION_BASE is a Finite State Machine</p>
|
||||
|
||||
<p> Various Events and State Transitions can be tailored using DETECTION_BASE.</p>
|
||||
|
||||
<p> ### 1.6.1) DETECTION_BASE States</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Detecting</strong>: The detection is running.</li>
|
||||
<li><strong>Stopped</strong>: The detection is stopped.</li>
|
||||
</ul>
|
||||
|
||||
<p> ### 1.6.2) DETECTION_BASE Events</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Start</strong>: Start the detection process.</li>
|
||||
<li><strong>Detect</strong>: Detect new units.</li>
|
||||
<li><strong>Detected</strong>: New units have been detected.</li>
|
||||
<li><strong>Stop</strong>: Stop the detection process.</li>
|
||||
</ul>
|
||||
<p><img src="..\Presentations\DETECTION\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
<hr/>
|
||||
|
||||
<p> # 2) <a href="Detection.html##(DETECTION_UNITS)">Detection#DETECTION_UNITS</a> class, extends <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a></p>
|
||||
|
||||
<p> The <a href="Detection.html##(DETECTION_UNITS)">Detection#DETECTION_UNITS</a> class will detect units within the battle zone.
|
||||
It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a> containing ONE <a href="UNIT.html">UNIT</a> object reference.
|
||||
Beware that when the amount of units detected is large, the DetectedItems list will be large also. </p>
|
||||
|
||||
<p> # 3) <a href="Detection.html##(DETECTION_TYPES)">Detection#DETECTION_TYPES</a> class, extends <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a></p>
|
||||
|
||||
<p> The <a href="Detection.html##(DETECTION_TYPES)">Detection#DETECTION_TYPES</a> class will detect units within the battle zone.
|
||||
It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
|
||||
Each DetectedItem will contain a field Set, which contains a <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a> containing ONE <a href="UNIT.html">UNIT</a> object reference.
|
||||
Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also. </p>
|
||||
|
||||
<p> # 4) <a href="Detection.html##(DETECTION_AREAS)">Detection#DETECTION_AREAS</a> class, extends <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a></p>
|
||||
|
||||
<p> The <a href="Detection.html##(DETECTION_AREAS)">Detection#DETECTION_AREAS</a> class will detect units within the battle zone for a list of <a href="Group.html">Group</a>s detecting targets following (a) detection method(s),
|
||||
and will build a list (table) of <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a>s containing the <a href="Unit.html##(UNIT)">Unit#UNIT</a>s detected.
|
||||
The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
A set with multiple detected zones will be created as there are groups of units detected.</p>
|
||||
|
||||
<p> ## 4.1) Retrieve the Detected Unit Sets and Detected Zones</p>
|
||||
|
||||
<p> The methods to manage the DetectedItems[].Set(s) are implemented in <a href="Detection.html##(DECTECTION_BASE)">Detection#DECTECTION_BASE</a> and
|
||||
the methods to manage the DetectedItems[].Zone(s) is implemented in <a href="Detection.html##(DETECTION_AREAS)">Detection#DETECTION_AREAS</a>.</p>
|
||||
|
||||
<p> Retrieve the DetectedItems[].Set with the method <a href="Detection.html##(DETECTION_BASE).GetDetectedSet">Detection#DETECTION_BASE.GetDetectedSet</a>(). A <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a> object will be returned.</p>
|
||||
|
||||
<p> Retrieve the formed <a href="Zone.html">Zone</a>s as a result of the grouping the detected units within the DetectionZoneRange, use the method <a href="Detection.html##(DETECTION_BASE).GetDetectionZones">Detection#DETECTION_BASE.GetDetectionZones</a>().
|
||||
To understand the amount of zones created, use the method <a href="Detection.html##(DETECTION_BASE).GetDetectionZoneCount">Detection#DETECTION_BASE.GetDetectionZoneCount</a>().
|
||||
If you want to obtain a specific zone from the DetectedZones, use the method <a href="Detection.html##(DETECTION_BASE).GetDetectionZone">Detection#DETECTION_BASE.GetDetectionZone</a>() with a given index.</p>
|
||||
|
||||
<p> ## 4.4) Flare or Smoke detected units</p>
|
||||
|
||||
<p> Use the methods <a href="Detection.html##(DETECTION_AREAS).FlareDetectedUnits">Detection#DETECTION_AREAS.FlareDetectedUnits</a>() or <a href="Detection.html##(DETECTION_AREAS).SmokeDetectedUnits">Detection#DETECTION_AREAS.SmokeDetectedUnits</a>() to flare or smoke the detected units when a new detection has taken place.</p>
|
||||
|
||||
<p> ## 4.5) Flare or Smoke or Bound detected zones</p>
|
||||
|
||||
<p> Use the methods:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="Detection.html##(DETECTION_AREAS).FlareDetectedZones">Detection#DETECTION_AREAS.FlareDetectedZones</a>() to flare in a color </li>
|
||||
<li><a href="Detection.html##(DETECTION_AREAS).SmokeDetectedZones">Detection#DETECTION_AREAS.SmokeDetectedZones</a>() to smoke in a color</li>
|
||||
<li><a href="Detection.html##(DETECTION_AREAS).SmokeDetectedZones">Detection#DETECTION_AREAS.SmokeDetectedZones</a>() to bound with a tire with a white flag</li>
|
||||
</ul>
|
||||
|
||||
<p> the detected zones when a new detection has taken place.</p>
|
||||
|
||||
<hr/>
|
||||
|
||||
<p> ### Contributions: </p>
|
||||
<h3>Contributions:</h3>
|
||||
|
||||
<ul>
|
||||
<li>Mechanist : Early concept of DETECTION_AREAS.</li>
|
||||
</ul>
|
||||
|
||||
<p> ### Authors: </p>
|
||||
<h3>Authors:</h3>
|
||||
|
||||
<ul>
|
||||
<li>FlightControl : Analysis, Design, Programming, Testing
|
||||
</li>
|
||||
<li>FlightControl : Analysis, Design, Programming, Testing</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
@ -1321,7 +1075,42 @@
|
||||
|
||||
<h2><a id="#(DETECTION_AREAS)" >Type <code>DETECTION_AREAS</code></a></h2>
|
||||
|
||||
<p>DETECTION_AREAS class</p>
|
||||
<p> # 4) DETECTION_AREAS class, extends <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a></p>
|
||||
|
||||
<p> The DETECTION_AREAS class will detect units within the battle zone for a list of <a href="Group.html">Group</a>s detecting targets following (a) detection method(s),
|
||||
and will build a list (table) of <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a>s containing the <a href="Unit.html##(UNIT)">Unit#UNIT</a>s detected.</p>
|
||||
|
||||
|
||||
<p> The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
A set with multiple detected zones will be created as there are groups of units detected.</p>
|
||||
|
||||
<p> ## 4.1) Retrieve the Detected Unit Sets and Detected Zones</p>
|
||||
|
||||
<p> The methods to manage the DetectedItems[].Set(s) are implemented in <a href="Detection.html##(DECTECTION_BASE)">Detection#DECTECTION_BASE</a> and
|
||||
the methods to manage the DetectedItems[].Zone(s) is implemented in <a href="Detection.html##(DETECTION_AREAS)">Detection#DETECTION_AREAS</a>.</p>
|
||||
|
||||
<p> Retrieve the DetectedItems[].Set with the method <a href="Detection.html##(DETECTION_BASE).GetDetectedSet">Detection#DETECTION_BASE.GetDetectedSet</a>(). A <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a> object will be returned.</p>
|
||||
|
||||
<p> Retrieve the formed <a href="Zone.html">Zone</a>s as a result of the grouping the detected units within the DetectionZoneRange, use the method <a href="Detection.html##(DETECTION_BASE).GetDetectionZones">Detection#DETECTION_BASE.GetDetectionZones</a>().
|
||||
To understand the amount of zones created, use the method <a href="Detection.html##(DETECTION_BASE).GetDetectionZoneCount">Detection#DETECTION_BASE.GetDetectionZoneCount</a>().
|
||||
If you want to obtain a specific zone from the DetectedZones, use the method <a href="Detection.html##(DETECTION_BASE).GetDetectionZone">Detection#DETECTION_BASE.GetDetectionZone</a>() with a given index.</p>
|
||||
|
||||
<p> ## 4.4) Flare or Smoke detected units</p>
|
||||
|
||||
<p> Use the methods <a href="Detection.html##(DETECTION_AREAS).FlareDetectedUnits">Detection#DETECTION_AREAS.FlareDetectedUnits</a>() or <a href="Detection.html##(DETECTION_AREAS).SmokeDetectedUnits">Detection#DETECTION_AREAS.SmokeDetectedUnits</a>() to flare or smoke the detected units when a new detection has taken place.</p>
|
||||
|
||||
<p> ## 4.5) Flare or Smoke or Bound detected zones</p>
|
||||
|
||||
<p> Use the methods:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="Detection.html##(DETECTION_AREAS).FlareDetectedZones">Detection#DETECTION_AREAS.FlareDetectedZones</a>() to flare in a color </li>
|
||||
<li><a href="Detection.html##(DETECTION_AREAS).SmokeDetectedZones">Detection#DETECTION_AREAS.SmokeDetectedZones</a>() to smoke in a color</li>
|
||||
<li><a href="Detection.html##(DETECTION_AREAS).SmokeDetectedZones">Detection#DETECTION_AREAS.SmokeDetectedZones</a>() to bound with a tire with a white flag</li>
|
||||
</ul>
|
||||
|
||||
<p> the detected zones when a new detection has taken place.
|
||||
</p>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
@ -1734,7 +1523,206 @@ self</p>
|
||||
|
||||
<h2><a id="#(DETECTION_BASE)" >Type <code>DETECTION_BASE</code></a></h2>
|
||||
|
||||
<p>DETECTION_BASE class</p>
|
||||
<h1>1) DETECTION_BASE class, extends <a href="Fsm.html##(FSM)">Fsm#FSM</a></h1>
|
||||
|
||||
<p>The DETECTION_BASE class defines the core functions to administer detected objects.</p>
|
||||
|
||||
|
||||
<p>The DETECTION_BASE class will detect objects within the battle zone for a list of <a href="Group.html">Group</a>s detecting targets following (a) detection method(s).</p>
|
||||
|
||||
<h2>1.1) DETECTION_BASE constructor</h2>
|
||||
|
||||
<p>Construct a new DETECTION_BASE instance using the <a href="##(DETECTION_BASE).New">DETECTION_BASE.New</a>() method.</p>
|
||||
|
||||
<h2>1.2) DETECTION_BASE initialization</h2>
|
||||
|
||||
<p>By default, detection will return detected objects with all the detection sensors available.
|
||||
However, you can ask how the objects were found with specific detection methods.
|
||||
If you use one of the below methods, the detection will work with the detection method specified.
|
||||
You can specify to apply multiple detection methods.</p>
|
||||
|
||||
<p>Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectVisual">DETECTION_BASE.InitDetectVisual</a>(): Detected using Visual.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectOptical">DETECTION_BASE.InitDetectOptical</a>(): Detected using Optical.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectRadar">DETECTION_BASE.InitDetectRadar</a>(): Detected using Radar.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectIRST">DETECTION_BASE.InitDetectIRST</a>(): Detected using IRST.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectRWR">DETECTION_BASE.InitDetectRWR</a>(): Detected using RWR.</li>
|
||||
<li><a href="##(DETECTION_BASE).InitDetectDLINK">DETECTION_BASE.InitDetectDLINK</a>(): Detected using DLINK.</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list</h2>
|
||||
|
||||
<p>DETECTION<em>BASE derived classes build a list called DetectedItems[], which is essentially a first later
|
||||
of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains
|
||||
a SET</em>UNIT object that contains the detected units that belong to that group.</p>
|
||||
|
||||
<p>Derived classes will apply different methods to group the detected units.
|
||||
Examples are per area, per quadrant, per distance, per type.
|
||||
See further the derived DETECTION classes on which grouping methods are currently supported. </p>
|
||||
|
||||
<p>Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:</p>
|
||||
|
||||
<ul>
|
||||
<li>The method <a href="Detection.html##(DETECTION_BASE).GetDetectedItems">Detection#DETECTION_BASE.GetDetectedItems</a>() retrieves the DetectedItems[] list.</li>
|
||||
<li>A DetectedItem from the DetectedItems[] list can be retrieved using the method <a href="Detection.html##(DETECTION_BASE).GetDetectedItem">Detection#DETECTION_BASE.GetDetectedItem</a>( DetectedItemIndex ).
|
||||
Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information
|
||||
about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.</li>
|
||||
<li>A DetectedSet from the DetectedItems[] list can be retrieved using the method <a href="Detection.html##(DETECTION_BASE).GetDetectedSet">Detection#DETECTION_BASE.GetDetectedSet</a>( DetectedItemIndex ).
|
||||
This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.4) Apply additional Filters to fine-tune the detected objects</h2>
|
||||
|
||||
<p>By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means.
|
||||
That being said, the DCS World detection algorithm can sometimes be unrealistic.
|
||||
Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities.
|
||||
Additionally, trees and other obstacles are not accounted during the DCS World detection.</p>
|
||||
|
||||
<p>Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units.
|
||||
For electronic detection, this filtering is not applied, only for visually detected targets.</p>
|
||||
|
||||
<p>The following additional filtering can be applied for visual filtering:</p>
|
||||
|
||||
<ul>
|
||||
<li>A probability factor per kilometer distance.</li>
|
||||
<li>A probability factor based on the alpha angle between the detected object and the unit detecting.
|
||||
A detection from a higher altitude allows for better detection than when on the ground.</li>
|
||||
<li>Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult.
|
||||
The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.</li>
|
||||
</ul>
|
||||
|
||||
<p>I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters.
|
||||
Only when you experience unrealistic behaviour in your missions, these filters could be applied.</p>
|
||||
|
||||
<h3>1.4.1 ) Distance visual detection probability</h3>
|
||||
|
||||
<p>Upon a <strong>visual</strong> detection, the further away a detected object is, the less likely it is to be detected properly.
|
||||
Also, the speed of accurate detection plays a role.</p>
|
||||
|
||||
<p>A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.</p>
|
||||
|
||||
<p>For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like:
|
||||
1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.</p>
|
||||
|
||||
<p>Note that based on this probability factor, not only the detection but also the <strong>type</strong> of the unit will be applied!</p>
|
||||
|
||||
<p>Use the method <a href="Detection.html##(DETECTION_BASE).SetDistanceProbability">Detection#DETECTION_BASE.SetDistanceProbability</a>() to set the probability factor upon a 10 km distance.</p>
|
||||
|
||||
<h3>1.4.2 ) Alpha Angle visual detection probability</h3>
|
||||
|
||||
<p>Upon a <strong>visual</strong> detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.
|
||||
A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.</p>
|
||||
|
||||
<p>A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.</p>
|
||||
|
||||
<p>For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like:
|
||||
0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%</p>
|
||||
|
||||
<p>Use the method <a href="Detection.html##(DETECTION_BASE).SetAlphaAngleProbability">Detection#DETECTION_BASE.SetAlphaAngleProbability</a>() to set the probability factor if 0°.</p>
|
||||
|
||||
<h3>1.4.3 ) Cloudy Zones detection probability</h3>
|
||||
|
||||
<p>Upon a <strong>visual</strong> detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.
|
||||
The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission
|
||||
zones that reflect cloudy areas where detected units may not be so easily visually detected.</p>
|
||||
|
||||
<p>Use the method <a href="Detection.html##(DETECTION_BASE).SetZoneProbability">Detection#DETECTION_BASE.SetZoneProbability</a>() to set for a defined number of zones, the probability factors.</p>
|
||||
|
||||
<p>Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take
|
||||
from the DETECTION<em>BASE to calculate the presence of the detected unit within each zone.
|
||||
Expecially for ZONE</em>POLYGON, try to limit the amount of nodes of the polygon!</p>
|
||||
|
||||
<p>Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for
|
||||
AI not to detect so easily targets within a forrest or village rich area.</p>
|
||||
|
||||
<h2>1.5 ) Accept / Reject detected units</h2>
|
||||
|
||||
<p>DETECTION_BASE can accept or reject successful detections based on the location of the detected object,
|
||||
if it is located in range or located inside or outside of specific zones.</p>
|
||||
|
||||
<h3>1.5.1 ) Detection acceptance of within range limit</h3>
|
||||
|
||||
<p>A range can be set that will limit a successful detection for a unit.
|
||||
Use the method <a href="Detection.html##(DETECTION_BASE).SetAcceptRange">Detection#DETECTION_BASE.SetAcceptRange</a>() to apply a range in meters till where detected units will be accepted.</p>
|
||||
|
||||
<pre><code> local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
|
||||
-- Build a detect object.
|
||||
local Detection = DETECTION_BASE:New( SetGroup )
|
||||
|
||||
-- This will accept detected units if the range is below 5000 meters.
|
||||
Detection:SetAcceptRange( 5000 )
|
||||
|
||||
-- Start the Detection.
|
||||
Detection:Start()
|
||||
</code></pre>
|
||||
|
||||
|
||||
<h3>1.5.2 ) Detection acceptance if within zone(s).</h3>
|
||||
|
||||
<p>Specific ZONE<em>BASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONE</em>BASE object(s).
|
||||
Use the method <a href="Detection.html##(DETECTION_BASE).SetAcceptZones">Detection#DETECTION_BASE.SetAcceptZones</a>() will accept detected units if they are within the specified zones.</p>
|
||||
|
||||
<pre><code> local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
|
||||
-- Search fo the zones where units are to be accepted.
|
||||
local ZoneAccept1 = ZONE:New( "AcceptZone1" )
|
||||
local ZoneAccept2 = ZONE:New( "AcceptZone2" )
|
||||
|
||||
-- Build a detect object.
|
||||
local Detection = DETECTION_BASE:New( SetGroup )
|
||||
|
||||
-- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
|
||||
Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } )
|
||||
|
||||
-- Start the Detection.
|
||||
Detection:Start()
|
||||
</code></pre>
|
||||
|
||||
<h3>1.5.3 ) Detection rejectance if within zone(s).</h3>
|
||||
|
||||
<p>Specific ZONE<em>BASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONE</em>BASE object(s).
|
||||
Use the method <a href="Detection.html##(DETECTION_BASE).SetRejectZones">Detection#DETECTION_BASE.SetRejectZones</a>() will reject detected units if they are within the specified zones.
|
||||
An example of how to use the method is shown below.</p>
|
||||
|
||||
<pre><code> local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.
|
||||
|
||||
-- Search fo the zones where units are to be rejected.
|
||||
local ZoneReject1 = ZONE:New( "RejectZone1" )
|
||||
local ZoneReject2 = ZONE:New( "RejectZone2" )
|
||||
|
||||
-- Build a detect object.
|
||||
local Detection = DETECTION_BASE:New( SetGroup )
|
||||
|
||||
-- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
|
||||
Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } )
|
||||
|
||||
-- Start the Detection.
|
||||
Detection:Start()
|
||||
</code></pre>
|
||||
|
||||
<h2>1.6) DETECTION_BASE is a Finite State Machine</h2>
|
||||
|
||||
<p>Various Events and State Transitions can be tailored using DETECTION_BASE.</p>
|
||||
|
||||
<h3>1.6.1) DETECTION_BASE States</h3>
|
||||
|
||||
<ul>
|
||||
<li><strong>Detecting</strong>: The detection is running.</li>
|
||||
<li><strong>Stopped</strong>: The detection is stopped.</li>
|
||||
</ul>
|
||||
|
||||
<h3>1.6.2) DETECTION_BASE Events</h3>
|
||||
|
||||
<ul>
|
||||
<li><strong>Start</strong>: Start the detection process.</li>
|
||||
<li><strong>Detect</strong>: Detect new units.</li>
|
||||
<li><strong>Detected</strong>: New units have been detected.</li>
|
||||
<li><strong>Stop</strong>: Stop the detection process.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
@ -2243,7 +2231,7 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<em>#number</em>
|
||||
<a id="#(DETECTION_BASE).DetectionInterval" >
|
||||
<strong>DETECTION_BASE.DetectionInterval</strong>
|
||||
</a>
|
||||
@ -3969,7 +3957,15 @@ The To State string.</p>
|
||||
|
||||
<h2><a id="#(DETECTION_TYPES)" >Type <code>DETECTION_TYPES</code></a></h2>
|
||||
|
||||
<p>DETECTION_TYPES class</p>
|
||||
<h1>3) DETECTION_TYPES class, extends <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a></h1>
|
||||
|
||||
<p>The DETECTION_TYPES class will detect units within the battle zone.</p>
|
||||
|
||||
|
||||
<p>It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected.
|
||||
Each DetectedItem will contain a field Set, which contains a <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a> containing ONE <a href="UNIT.html">UNIT</a> object reference.
|
||||
Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also. </p>
|
||||
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
@ -4197,7 +4193,14 @@ self</p>
|
||||
|
||||
<h2><a id="#(DETECTION_UNITS)" >Type <code>DETECTION_UNITS</code></a></h2>
|
||||
|
||||
<p>DETECTION_UNITS class</p>
|
||||
<h1>2) DETECTION_UNITS class, extends <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a></h1>
|
||||
|
||||
<p>The DETECTION_UNITS class will detect units within the battle zone.</p>
|
||||
|
||||
|
||||
<p>It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a> containing ONE <a href="UNIT.html">UNIT</a> object reference.
|
||||
Beware that when the amount of units detected is large, the DetectedItems list will be large also. </p>
|
||||
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>1) <a href="DetectionManager.html##(DETECTION_MANAGER)">DetectionManager#DETECTION_MANAGER</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
<h1>1) <a href="DetectionManager.html##(DETECTION_MANAGER)">DetectionManager#DETECTION_MANAGER</a> class, extends <a href="Fsm.html##(FSM)">Fsm#FSM</a></h1>
|
||||
<p>The <a href="DetectionManager.html##(DETECTION_MANAGER)">DetectionManager#DETECTION_MANAGER</a> class defines the core functions to report detected objects to groups.
|
||||
Reportings can be done in several manners, and it is up to the derived classes if DETECTION_MANAGER to model the reporting behaviour.</p>
|
||||
|
||||
@ -139,12 +139,6 @@ If an ad-hoc report is requested, use the method <a href="DetectionManager.html#
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).Detection">DETECTION_MANAGER.Detection</a></td>
|
||||
<td class="summary">
|
||||
<p>The DETECTION_BASE object that is used to report the detected objects.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).FacScheduler">DETECTION_MANAGER.FacScheduler</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -160,15 +154,9 @@ If an ad-hoc report is requested, use the method <a href="DetectionManager.html#
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).ReportDetected">DETECTION_MANAGER:ReportDetected(Detection)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).ProcessDetected">DETECTION_MANAGER:ProcessDetected(Detection)</a></td>
|
||||
<td class="summary">
|
||||
<p>Reports the detected items to the <a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).Schedule">DETECTION_MANAGER:Schedule(DelayTime, ReportInterval)</a></td>
|
||||
<td class="summary">
|
||||
<p>Schedule the FAC reporting.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -187,12 +175,6 @@ If an ad-hoc report is requested, use the method <a href="DetectionManager.html#
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).SetReportInterval">DETECTION_MANAGER:SetReportInterval(ReportInterval)</a></td>
|
||||
<td class="summary">
|
||||
<p>Set the reporting time interval.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER)._FacScheduler">DETECTION_MANAGER:_FacScheduler(SchedulerName)</a></td>
|
||||
<td class="summary">
|
||||
<p>Report the detected <a href="Unit.html##(UNIT)">Unit#UNIT</a>s detected within the <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a> object to the <a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a>s.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -208,7 +190,13 @@ If an ad-hoc report is requested, use the method <a href="DetectionManager.html#
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER)._ScheduleDelayTime">DETECTION_MANAGER._ScheduleDelayTime</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).onafterReport">DETECTION_MANAGER:onafterReport(From, Event, To)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).onafterStart">DETECTION_MANAGER:onafterStart(From, Event, To)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
@ -317,20 +305,6 @@ If an ad-hoc report is requested, use the method <a href="DetectionManager.html#
|
||||
|
||||
<p>The DETECTION_BASE object that is used to report the detected objects.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(DETECTION_MANAGER).FacScheduler" >
|
||||
<strong>DETECTION_MANAGER.FacScheduler</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -385,8 +359,8 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DETECTION_MANAGER).ReportDetected" >
|
||||
<strong>DETECTION_MANAGER:ReportDetected(Detection)</strong>
|
||||
<a id="#(DETECTION_MANAGER).ProcessDetected" >
|
||||
<strong>DETECTION_MANAGER:ProcessDetected(Detection)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -406,39 +380,6 @@ self</p>
|
||||
<p><em><a href="##(DETECTION_MANAGER)">#DETECTION_MANAGER</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DETECTION_MANAGER).Schedule" >
|
||||
<strong>DETECTION_MANAGER:Schedule(DelayTime, ReportInterval)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Schedule the FAC reporting.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number DelayTime </em></code>:
|
||||
The delay in seconds to wait the reporting.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number ReportInterval </em></code>:
|
||||
The repeat interval in seconds for the reporting to happen repeatedly.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(DETECTION_MANAGER)">#DETECTION_MANAGER</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -507,27 +448,6 @@ The interval in seconds when a report needs to be done.</p>
|
||||
<p><em><a href="##(DETECTION_MANAGER)">#DETECTION_MANAGER</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DETECTION_MANAGER)._FacScheduler" >
|
||||
<strong>DETECTION_MANAGER:_FacScheduler(SchedulerName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Report the detected <a href="Unit.html##(UNIT)">Unit#UNIT</a>s detected within the <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a> object to the <a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a>s.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> SchedulerName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -561,15 +481,63 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(DETECTION_MANAGER)._ScheduleDelayTime" >
|
||||
<strong>DETECTION_MANAGER._ScheduleDelayTime</strong>
|
||||
<a id="#(DETECTION_MANAGER).onafterReport" >
|
||||
<strong>DETECTION_MANAGER:onafterReport(From, Event, To)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> From </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Event </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> To </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DETECTION_MANAGER).onafterStart" >
|
||||
<strong>DETECTION_MANAGER:onafterStart(From, Event, To)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> From </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Event </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> To </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
@ -190,6 +190,7 @@ on defined intervals (currently every minute).</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(MOVEMENT).AliveUnits" >
|
||||
<strong>MOVEMENT.AliveUnits</strong>
|
||||
</a>
|
||||
@ -198,6 +199,9 @@ on defined intervals (currently every minute).</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Contains the counter how many units are currently alive</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
|
||||
@ -1870,6 +1870,9 @@ The group that was spawned. You can use this group for further actions.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2731,7 +2734,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
|
||||
|
||||
|
||||
|
||||
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
|
||||
<p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
@ -183,6 +183,12 @@ Use the method <a href="##(TASK).AddScore">TASK.AddScore</a>() to add scores whe
|
||||
<td class="name" nowrap="nowrap"><a href="##(TASK).CrashUnit">TASK:CrashUnit(PlayerUnit)</a></td>
|
||||
<td class="summary">
|
||||
<p>A PlayerUnit crashed in a Task.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(TASK).Dispatcher">TASK.Dispatcher</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -495,6 +501,12 @@ Use the method <a href="##(TASK).AddScore">TASK.AddScore</a>() to add scores whe
|
||||
<td class="name" nowrap="nowrap"><a href="##(TASK).SetBriefing">TASK:SetBriefing(TaskBriefing)</a></td>
|
||||
<td class="summary">
|
||||
<p>Sets a <a href="Task.html">Task</a> briefing.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(TASK).SetDispatcher">TASK:SetDispatcher(Dispatcher)</a></td>
|
||||
<td class="summary">
|
||||
<p>Set dispatcher of a task</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -714,7 +726,7 @@ Use the method <a href="##(TASK).AddScore">TASK.AddScore</a>() to add scores whe
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(TASK).onenterAssigned">TASK:onenterAssigned(Event, From, To)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(TASK).onenterAssigned">TASK:onenterAssigned(Event, From, To, PlayerUnit, PlayerName)</a></td>
|
||||
<td class="summary">
|
||||
<p>FSM function for a TASK</p>
|
||||
</td>
|
||||
@ -940,6 +952,20 @@ The CLIENT or UNIT of the Player aborting the Task.</p>
|
||||
<p><em>#boolean:</em>
|
||||
true if Unit is part of the Task.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(TASK).Dispatcher" >
|
||||
<strong>TASK.Dispatcher</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2012,6 +2038,32 @@ self</p>
|
||||
<p><em><a href="##(TASK)">#TASK</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(TASK).SetDispatcher" >
|
||||
<strong>TASK:SetDispatcher(Dispatcher)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Set dispatcher of a task</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Tasking.DetectionManager.html##(DETECTION_MANAGER)">Tasking.DetectionManager#DETECTION_MANAGER</a> Dispatcher </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(TASK)">#TASK</a>:</em></p>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2714,7 +2766,7 @@ self</p>
|
||||
<dt>
|
||||
|
||||
<a id="#(TASK).onenterAssigned" >
|
||||
<strong>TASK:onenterAssigned(Event, From, To)</strong>
|
||||
<strong>TASK:onenterAssigned(Event, From, To, PlayerUnit, PlayerName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -2737,6 +2789,16 @@ self</p>
|
||||
|
||||
<p><code><em>#string To </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> PlayerUnit </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> PlayerName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
@ -180,6 +180,12 @@ Find a summary below describing for which situation a task type is created:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(TASK_A2G_DISPATCHER).New">TASK_A2G_DISPATCHER:New(The, SetGroup, Detection, Mission)</a></td>
|
||||
<td class="summary">
|
||||
<p>TASK<em>A2G</em>DISPATCHER constructor.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(TASK_A2G_DISPATCHER).OnAfterAssign">TASK_A2G_DISPATCHER:OnAfterAssign(From, Event, To, Task, TaskUnit, PlayerName)</a></td>
|
||||
<td class="summary">
|
||||
<p>OnAfter Transition Handler for Event Assign.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -439,6 +445,55 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(TASK_A2G_DISPATCHER).OnAfterAssign" >
|
||||
<strong>TASK_A2G_DISPATCHER:OnAfterAssign(From, Event, To, Task, TaskUnit, PlayerName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>OnAfter Transition Handler for Event Assign.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string From </em></code>:
|
||||
The From State string.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string Event </em></code>:
|
||||
The Event string.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string To </em></code>:
|
||||
The To State string.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Tasking.Task_A2G.html##(TASK_A2G)">Tasking.Task<em>A2G#TASK</em>A2G</a> Task </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Wrapper.Unit.html##(UNIT)">Wrapper.Unit#UNIT</a> TaskUnit </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string PlayerName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(TASK_A2G_DISPATCHER).ProcessDetected" >
|
||||
<strong>TASK_A2G_DISPATCHER:ProcessDetected(Detection)</strong>
|
||||
</a>
|
||||
|
||||
@ -92,7 +92,7 @@ CLIENTS in a SET_CLIENT collection, which are not occupied by human players.</p>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="AI_Cap.html">AI_Cap</a></td>
|
||||
<td class="summary">
|
||||
<p>Single-Player:<strong>Yes</strong> / Multi-Player:<strong>Yes</strong> / AI:<strong>Yes</strong> / Human:<strong>No</strong> / Types:<strong>Air</strong> -- <strong>Execute Combat Air Patrol (CAP).</strong></p>
|
||||
<p><strong>AI</strong> - <strong>Execute Combat Air Patrol (CAP).</strong></p>
|
||||
|
||||
<p><img src="..\Presentations\AI_CAP\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
@ -107,8 +107,7 @@ and automatically engage any airborne enemies that are within a certain range or
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="AI_Cas.html">AI_Cas</a></td>
|
||||
<td class="summary">
|
||||
<p>Single-Player:<strong>Yes</strong> / Multi-Player:<strong>Yes</strong> / AI:<strong>Yes</strong> / Human:<strong>No</strong> / Types:<strong>Air</strong> --
|
||||
<strong>Provide Close Air Support to friendly ground troops.</strong></p>
|
||||
<p><strong>AI</strong> -- <strong>Provide Close Air Support to friendly ground troops.</strong></p>
|
||||
|
||||
<p><img src="..\Presentations\AI_CAS\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
@ -122,8 +121,7 @@ and automatically engage any airborne enemies that are within a certain range or
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="AI_Patrol.html">AI_Patrol</a></td>
|
||||
<td class="summary">
|
||||
<p>Single-Player:<strong>Yes</strong> / Multi-Player:<strong>Yes</strong> / AI:<strong>Yes</strong> / Human:<strong>No</strong> / Types:<strong>Air</strong> --
|
||||
<strong>Air Patrolling or Staging.</strong></p>
|
||||
<p><strong>AI</strong> -- <strong>Air Patrolling or Staging.</strong></p>
|
||||
|
||||
<p><img src="..\Presentations\AI_PATROL\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
@ -137,7 +135,7 @@ and automatically engage any airborne enemies that are within a certain range or
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Account.html">Account</a></td>
|
||||
<td class="summary">
|
||||
<p>(SP) (MP) (FSM) Account for (Detect, count and report) DCS events occuring on DCS objects (units).</p>
|
||||
<p><strong>Actions</strong> - ACT<em>ACCOUNT</em> classes <strong>account for</strong> (detect, count & report) various DCS events occuring on <a href="Unit.html">Unit</a>s.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -214,7 +212,7 @@ and automatically engage any airborne enemies that are within a certain range or
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Detection.html">Detection</a></td>
|
||||
<td class="summary">
|
||||
<p> This module contains the DETECTION classes.</p>
|
||||
<p><strong>Functional</strong> - DETECTION_ classes model the detection of enemy units by FACs or RECCEs and group them according various methods.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
BIN
docs/Presentations/ACT_ACCOUNT/Dia1.JPG
Normal file
|
After Width: | Height: | Size: 242 KiB |
BIN
docs/Presentations/DETECTION/Dia1.JPG
Normal file
|
After Width: | Height: | Size: 195 KiB |
BIN
docs/Presentations/DETECTION/Dia10.JPG
Normal file
|
After Width: | Height: | Size: 192 KiB |
BIN
docs/Presentations/DETECTION/Dia11.JPG
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
docs/Presentations/DETECTION/Dia12.JPG
Normal file
|
After Width: | Height: | Size: 192 KiB |
BIN
docs/Presentations/DETECTION/Dia13.JPG
Normal file
|
After Width: | Height: | Size: 201 KiB |
BIN
docs/Presentations/DETECTION/Dia14.JPG
Normal file
|
After Width: | Height: | Size: 192 KiB |
BIN
docs/Presentations/DETECTION/Dia15.JPG
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
docs/Presentations/DETECTION/Dia16.JPG
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
docs/Presentations/DETECTION/Dia17.JPG
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
docs/Presentations/DETECTION/Dia18.JPG
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
docs/Presentations/DETECTION/Dia19.JPG
Normal file
|
After Width: | Height: | Size: 186 KiB |
BIN
docs/Presentations/DETECTION/Dia2.JPG
Normal file
|
After Width: | Height: | Size: 197 KiB |
BIN
docs/Presentations/DETECTION/Dia20.JPG
Normal file
|
After Width: | Height: | Size: 197 KiB |
BIN
docs/Presentations/DETECTION/Dia21.JPG
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
docs/Presentations/DETECTION/Dia22.JPG
Normal file
|
After Width: | Height: | Size: 191 KiB |
BIN
docs/Presentations/DETECTION/Dia23.JPG
Normal file
|
After Width: | Height: | Size: 199 KiB |
BIN
docs/Presentations/DETECTION/Dia24.JPG
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
docs/Presentations/DETECTION/Dia25.JPG
Normal file
|
After Width: | Height: | Size: 209 KiB |
BIN
docs/Presentations/DETECTION/Dia26.JPG
Normal file
|
After Width: | Height: | Size: 159 KiB |
BIN
docs/Presentations/DETECTION/Dia3.JPG
Normal file
|
After Width: | Height: | Size: 182 KiB |
BIN
docs/Presentations/DETECTION/Dia4.JPG
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
docs/Presentations/DETECTION/Dia5.JPG
Normal file
|
After Width: | Height: | Size: 172 KiB |
BIN
docs/Presentations/DETECTION/Dia6.JPG
Normal file
|
After Width: | Height: | Size: 177 KiB |
BIN
docs/Presentations/DETECTION/Dia7.JPG
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
docs/Presentations/DETECTION/Dia8.JPG
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
docs/Presentations/DETECTION/Dia9.JPG
Normal file
|
After Width: | Height: | Size: 187 KiB |