Revised documentation for AI_BALANCER
-- Added new SPAWN test missions. -- Added new AI_BALANCER test missions. -- Revised the MOOSE launch page.
@ -28,7 +28,7 @@
|
||||
--
|
||||
-- ## 1.2) AI_BALANCER is a FSM
|
||||
--
|
||||
-- 
|
||||
-- 
|
||||
--
|
||||
-- ### 1.2.1) AI_BALANCER States
|
||||
--
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170108_2104' )
|
||||
env.info( 'Moose Generation Timestamp: 20170110_1254' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -24182,27 +24182,29 @@ function DETECTION_AREAS:CreateDetectionSets()
|
||||
end
|
||||
|
||||
|
||||
--- SP:N MP:Y AI:Y HU:N TYP:A -- This module contains the AI_BALANCER class.
|
||||
--
|
||||
-- AI Balancing will replace in multi player missions non-occupied human slots with AI groups, in order to provide an
|
||||
-- engaging simulation environment, even when there are hardly any players in the mission.
|
||||
--- SP:N MP:Y AI:Y HU:N TYP:A -- This module contains the AI_BALANCER class. AI Balancing will replace in multi player missions
|
||||
-- non-occupied human slots with AI groups, in order to provide an engaging simulation environment,
|
||||
-- even when there are hardly any players in the mission.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Examples can be found in the test missions.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{AI.AI_Balancer#AI_BALANCER} class, extends @{Core.Fsm#FSM_SET}
|
||||
--
|
||||
-- The @{AI.AI_Balancer#AI_BALANCER} class monitors and manages as many AI GROUPS as there are
|
||||
-- CLIENTS in a SET_CLIENT collection not occupied by human players.
|
||||
-- In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI.
|
||||
-- The @{AI.AI_Balancer#AI_BALANCER} class monitors and manages as many replacement AI groups as there are
|
||||
-- CLIENTS in a SET_CLIENT collection, which are not occupied by human players.
|
||||
-- In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI in multi player missions.
|
||||
--
|
||||
-- The AI_BALANCER class manages internally a collection of AI management objects, which govern the behaviour
|
||||
-- of the spawned AI @{Wrapper.Group#GROUP)s.
|
||||
-- The parent class @{Core.Fsm#FSM_SET} manages the functionality to control the Finite State Machine (FSM).
|
||||
-- The mission designer can tailor the behaviour of the AI_BALANCER, by defining event and state transition methods.
|
||||
-- An explanation about state and event transition methods can be found in the @{FSM} module documentation.
|
||||
--
|
||||
-- The parent class @{Core.Fsm#FSM_SET} manages the functionality to control the Finite State Machine (FSM)
|
||||
-- and calls for each event the state transition methods providing the internal @{Core.Fsm#FSM_SET.Set} object containing the
|
||||
-- AI and additional event parameters provided during the event.
|
||||
-- The mission designer can tailor the AI_BALANCER behaviour, by implementing a state or event handling method for the following:
|
||||
--
|
||||
-- * **@{#AI_BALANCER.OnAfterSpawned}**( AISet, From, Event, To, AIGroup ): Define to add extra logic when an AI is spawned.
|
||||
--
|
||||
-- ## 1.1) AI_BALANCER construction
|
||||
--
|
||||
@ -24210,11 +24212,7 @@ end
|
||||
--
|
||||
-- ## 1.2) AI_BALANCER is a FSM
|
||||
--
|
||||
-- The AI_BALANCER is a state machine: it manages the different events and states of the @{Core.Fsm#FSM_SET.Set} it is governing.
|
||||
-- The AI_BALANCER has a default flow to manage the set.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ### 1.2.1) AI_BALANCER States
|
||||
--
|
||||
@ -24245,13 +24243,12 @@ end
|
||||
-- * @{#AI_BALANCER.ReturnToHomeAirbase}: Returns the AI to the **home** @{Wrapper.Airbase#AIRBASE}.
|
||||
-- * @{#AI_BALANCER.ReturnToNearestAirbases}: Returns the AI to the **nearest friendly** @{Wrapper.Airbase#AIRBASE}.
|
||||
--
|
||||
-- Note that when AI returns to an airbase, it will trigger the **Return** event and will return,
|
||||
-- otherwise when the AI is destroyed, the **Destroy** event will be triggered.
|
||||
-- Note that when AI returns to an airbase, the AI_BALANCER will trigger the **Return** event and the AI will return,
|
||||
-- otherwise the AI_BALANCER will trigger a **Destroy** event, and the AI will be destroyed.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- **API CHANGE HISTORY**
|
||||
-- ======================
|
||||
-- # **API CHANGE HISTORY**
|
||||
--
|
||||
-- The underlying change log documents the API changes. Please read this carefully. The following notation is used:
|
||||
--
|
||||
@ -24278,8 +24275,6 @@ end
|
||||
--
|
||||
-- @module AI_Balancer
|
||||
|
||||
|
||||
|
||||
--- AI_BALANCER class
|
||||
-- @type AI_BALANCER
|
||||
-- @field Core.Set#SET_CLIENT SetClient
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170108_2104' )
|
||||
env.info( 'Moose Generation Timestamp: 20170110_1254' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -24182,27 +24182,29 @@ function DETECTION_AREAS:CreateDetectionSets()
|
||||
end
|
||||
|
||||
|
||||
--- SP:N MP:Y AI:Y HU:N TYP:A -- This module contains the AI_BALANCER class.
|
||||
--
|
||||
-- AI Balancing will replace in multi player missions non-occupied human slots with AI groups, in order to provide an
|
||||
-- engaging simulation environment, even when there are hardly any players in the mission.
|
||||
--- SP:N MP:Y AI:Y HU:N TYP:A -- This module contains the AI_BALANCER class. AI Balancing will replace in multi player missions
|
||||
-- non-occupied human slots with AI groups, in order to provide an engaging simulation environment,
|
||||
-- even when there are hardly any players in the mission.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Examples can be found in the test missions.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{AI.AI_Balancer#AI_BALANCER} class, extends @{Core.Fsm#FSM_SET}
|
||||
--
|
||||
-- The @{AI.AI_Balancer#AI_BALANCER} class monitors and manages as many AI GROUPS as there are
|
||||
-- CLIENTS in a SET_CLIENT collection not occupied by human players.
|
||||
-- In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI.
|
||||
-- The @{AI.AI_Balancer#AI_BALANCER} class monitors and manages as many replacement AI groups as there are
|
||||
-- CLIENTS in a SET_CLIENT collection, which are not occupied by human players.
|
||||
-- In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI in multi player missions.
|
||||
--
|
||||
-- The AI_BALANCER class manages internally a collection of AI management objects, which govern the behaviour
|
||||
-- of the spawned AI @{Wrapper.Group#GROUP)s.
|
||||
-- The parent class @{Core.Fsm#FSM_SET} manages the functionality to control the Finite State Machine (FSM).
|
||||
-- The mission designer can tailor the behaviour of the AI_BALANCER, by defining event and state transition methods.
|
||||
-- An explanation about state and event transition methods can be found in the @{FSM} module documentation.
|
||||
--
|
||||
-- The parent class @{Core.Fsm#FSM_SET} manages the functionality to control the Finite State Machine (FSM)
|
||||
-- and calls for each event the state transition methods providing the internal @{Core.Fsm#FSM_SET.Set} object containing the
|
||||
-- AI and additional event parameters provided during the event.
|
||||
-- The mission designer can tailor the AI_BALANCER behaviour, by implementing a state or event handling method for the following:
|
||||
--
|
||||
-- * **@{#AI_BALANCER.OnAfterSpawned}**( AISet, From, Event, To, AIGroup ): Define to add extra logic when an AI is spawned.
|
||||
--
|
||||
-- ## 1.1) AI_BALANCER construction
|
||||
--
|
||||
@ -24210,11 +24212,7 @@ end
|
||||
--
|
||||
-- ## 1.2) AI_BALANCER is a FSM
|
||||
--
|
||||
-- The AI_BALANCER is a state machine: it manages the different events and states of the @{Core.Fsm#FSM_SET.Set} it is governing.
|
||||
-- The AI_BALANCER has a default flow to manage the set.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ### 1.2.1) AI_BALANCER States
|
||||
--
|
||||
@ -24245,13 +24243,12 @@ end
|
||||
-- * @{#AI_BALANCER.ReturnToHomeAirbase}: Returns the AI to the **home** @{Wrapper.Airbase#AIRBASE}.
|
||||
-- * @{#AI_BALANCER.ReturnToNearestAirbases}: Returns the AI to the **nearest friendly** @{Wrapper.Airbase#AIRBASE}.
|
||||
--
|
||||
-- Note that when AI returns to an airbase, it will trigger the **Return** event and will return,
|
||||
-- otherwise when the AI is destroyed, the **Destroy** event will be triggered.
|
||||
-- Note that when AI returns to an airbase, the AI_BALANCER will trigger the **Return** event and the AI will return,
|
||||
-- otherwise the AI_BALANCER will trigger a **Destroy** event, and the AI will be destroyed.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- **API CHANGE HISTORY**
|
||||
-- ======================
|
||||
-- # **API CHANGE HISTORY**
|
||||
--
|
||||
-- The underlying change log documents the API changes. Please read this carefully. The following notation is used:
|
||||
--
|
||||
@ -24278,8 +24275,6 @@ end
|
||||
--
|
||||
-- @module AI_Balancer
|
||||
|
||||
|
||||
|
||||
--- AI_BALANCER class
|
||||
-- @type AI_BALANCER
|
||||
-- @field Core.Set#SET_CLIENT SetClient
|
||||
|
||||
@ -19,10 +19,6 @@
|
||||
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
|
||||
-- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa.
|
||||
-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa.
|
||||
--
|
||||
-- # Status: DEVELOP 07 Dec 2016
|
||||
--
|
||||
-- @module TEST.AI_BALANCER.T002
|
||||
|
||||
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
|
||||
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
-- Name: AIB-006 - Declutter AI at Airbases
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2016
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- For the red coalition, 2 client slots are foreseen.
|
||||
-- For those players that have not joined the mission, red AI is spawned.
|
||||
-- The red AI should start patrolling an area until fuel is empty and return to the home base.
|
||||
-- For each AI being spawned, ensure that they fly to a random zone defined within the mission editor.
|
||||
-- Right now there are two patrol zones defined, so the AI should start patrolliing in one of these zones.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. If no player is logging into the red slots, 2 red AI planes should be alive.
|
||||
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.
|
||||
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
|
||||
-- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa.
|
||||
-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa.
|
||||
-- 6. Ensure that you see the AI patrol in one of the two zones ...
|
||||
|
||||
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
|
||||
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
|
||||
|
||||
-- Define the SPAWN object for the red AI plane template.
|
||||
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
|
||||
-- If a blocked plane exists, this red plane will be ReSpawned.
|
||||
local RU_PlanesSpawn = SPAWN:New( "AI RU" )
|
||||
|
||||
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
|
||||
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
|
||||
|
||||
-- Create the first polygon zone ...
|
||||
local PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
|
||||
local PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
|
||||
|
||||
-- Create the second polygon zone ...
|
||||
local PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" )
|
||||
local PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 )
|
||||
|
||||
-- Now, create an array of these zones ...
|
||||
local PatrolZoneArray = { PatrolZone1, PatrolZone2 }
|
||||
|
||||
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
|
||||
local Patrol = AI_PATROLZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
|
||||
Patrol:ManageFuel( 0.2, 60 )
|
||||
Patrol:SetControllable( AIGroup )
|
||||
Patrol:__Start( 5 )
|
||||
|
||||
end
|
||||
@ -0,0 +1,43 @@
|
||||
-- Name: AIB-005 - Patrol AI and Randomize Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2016
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- For the red coalition, 2 client slots are foreseen.
|
||||
-- For those players that have not joined the mission, red AI is spawned.
|
||||
-- You'll notice a lot of AI is being spawned, as there are a lot of slots...
|
||||
-- If the SPAWN API :InitCleanUp( secs ) is NOT used, you'll notice that the planes block each other on the runway.
|
||||
-- After a short period of time, nothing will move anymore...
|
||||
-- The :InitCleanUp( seconds ) API of the SPAWN class ensure that any AI that is parked longer than the
|
||||
-- specified amount of seconds, is respawned back at the parking position.
|
||||
-- This frees up the other planes departing, and the airbase is in this way decluttered...
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the de-cluttering of planes at Krymsk.
|
||||
-- 2. Play with the InitCleanUp API of the SPAWN class, extende the amount of seconds to find the optimal setting.
|
||||
|
||||
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
|
||||
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
|
||||
|
||||
-- Define the SPAWN object for the red AI plane template.
|
||||
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
|
||||
-- If a blocked plane exists, this red plane will be ReSpawned.
|
||||
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
|
||||
|
||||
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
|
||||
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
|
||||
|
||||
-- Create the first polygon zone ...
|
||||
local PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
|
||||
local PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
|
||||
|
||||
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
|
||||
local Patrol = AI_PATROLZONE:New( PatrolZone1, 3000, 6000, 400, 600 )
|
||||
Patrol:ManageFuel( 0.2, 60 )
|
||||
Patrol:SetControllable( AIGroup )
|
||||
Patrol:__Start( 5 )
|
||||
|
||||
end
|
||||
@ -0,0 +1,22 @@
|
||||
-- Name: SPA-011 - Ground Ops - Simple Spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a ground vehicle.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicle is spawned.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
-- Name: SPA-012 - Ground Ops - Multiple Spawns
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_2 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_3 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_4 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_5 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
-- Name: SPA-013 - Ground Ops - Scheduled Spawns
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 )
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
-- Name: SPA-014 - Ground Ops - Scheduled Spawns Limited
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||
-- 3. There should not be more than 5 groups spawned.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 5, 10 ):SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
-- Name: SPA-015 - Ground Ops - Randomize Route
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||
-- 3. There should not be more than 5 groups spawned.
|
||||
-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeRoute( 1, 1, 200 ) -- Randomize route starting from point 1 till point 3, with a radius of 200 meters around each point.
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
-- Name: SPA-016 - Ground Ops - Randomize Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||
-- 3. There should not be more than 5 groups spawned.
|
||||
-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3.
|
||||
-- 5. Observe that the position where the units are spawned, is randomized according the zones.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeRoute( 1, 1, 200 )
|
||||
:InitRandomizeZones( ZoneTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
@ -71,24 +71,31 @@
|
||||
<p>SP:N MP:Y AI:Y HU:N TYP:A -- This module contains the AI_BALANCER class.</p>
|
||||
|
||||
|
||||
|
||||
<p>AI Balancing will replace in multi player missions non-occupied human slots with AI groups, in order to provide an
|
||||
engaging simulation environment, even when there are hardly any players in the mission.</p>
|
||||
<p>AI Balancing will replace in multi player missions
|
||||
non-occupied human slots with AI groups, in order to provide an engaging simulation environment,
|
||||
even when there are hardly any players in the mission.</p>
|
||||
|
||||
<p><img src="..\Presentations\AI_Balancer\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
<p>Examples can be found in the test missions.</p>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>1) <a href="AI.AI_Balancer.html##(AI_BALANCER)">AI.AI<em>Balancer#AI</em>BALANCER</a> class, extends <a href="Core.Fsm.html##(FSM_SET)">Core.Fsm#FSM_SET</a></h1>
|
||||
|
||||
<p>The <a href="AI.AI_Balancer.html##(AI_BALANCER)">AI.AI<em>Balancer#AI</em>BALANCER</a> class monitors and manages as many AI GROUPS as there are
|
||||
CLIENTS in a SET<em>CLIENT collection not occupied by human players.
|
||||
In other words, use AI</em>BALANCER to simulate human behaviour by spawning in replacement AI.</p>
|
||||
<p>The <a href="AI.AI_Balancer.html##(AI_BALANCER)">AI.AI<em>Balancer#AI</em>BALANCER</a> class monitors and manages as many replacement AI groups as there are
|
||||
CLIENTS in a SET<em>CLIENT collection, which are not occupied by human players.
|
||||
In other words, use AI</em>BALANCER to simulate human behaviour by spawning in replacement AI in multi player missions.</p>
|
||||
|
||||
<p>The AI_BALANCER class manages internally a collection of AI management objects, which govern the behaviour
|
||||
of the spawned AI <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> manages the functionality to control the Finite State Machine (FSM)
|
||||
and calls for each event the state transition methods providing the internal <a href="Core.Fsm.html##(FSM_SET).Set">Core.Fsm#FSM_SET.Set</a> object containing the
|
||||
AI and additional event parameters provided during the event.</p>
|
||||
<p>The parent class <a href="Core.Fsm.html##(FSM_SET)">Core.Fsm#FSM_SET</a> manages the functionality to control the Finite State Machine (FSM).
|
||||
The mission designer can tailor the behaviour of the AI_BALANCER, by defining event and state transition methods.
|
||||
An explanation about state and event transition methods can be found in the <a href="FSM.html">FSM</a> module documentation.</p>
|
||||
|
||||
<p>The mission designer can tailor the AI_BALANCER behaviour, by implementing a state or event handling method for the following:</p>
|
||||
|
||||
<ul>
|
||||
<li>**<a href="##(AI_BALANCER).OnAfterSpawned">AI_BALANCER.OnAfterSpawned</a>**( AISet, From, Event, To, AIGroup ): Define to add extra logic when an AI is spawned.</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.1) AI_BALANCER construction</h2>
|
||||
|
||||
@ -96,11 +103,7 @@ AI and additional event parameters provided during the event.</p>
|
||||
|
||||
<h2>1.2) AI_BALANCER is a FSM</h2>
|
||||
|
||||
<p>The AI_BALANCER is a state machine: it manages the different events and states of the <a href="Core.Fsm.html##(FSM_SET).Set">Core.Fsm#FSM_SET.Set</a> it is governing.
|
||||
The AI_BALANCER has a default flow to manage the set.</p>
|
||||
|
||||
<p><img src="..\Presentations\AI_Balancer\Dia2.JPG" alt="Process"/></p>
|
||||
|
||||
<p><img src="..\Presentations\AI_Balancer\Dia13.JPG" alt="Process"/></p>
|
||||
|
||||
<h3>1.2.1) AI_BALANCER States</h3>
|
||||
|
||||
@ -137,8 +140,8 @@ When a human player joins a slot, you can configure to let the AI return to:</p>
|
||||
<li><a href="##(AI_BALANCER).ReturnToNearestAirbases">AI_BALANCER.ReturnToNearestAirbases</a>: Returns the AI to the <strong>nearest friendly</strong> <a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a>.</li>
|
||||
</ul>
|
||||
|
||||
<p>Note that when AI returns to an airbase, it will trigger the <strong>Return</strong> event and will return,
|
||||
otherwise when the AI is destroyed, the <strong>Destroy</strong> event will be triggered.</p>
|
||||
<p>Note that when AI returns to an airbase, the AI<em>BALANCER will trigger the <strong>Return</strong> event and the AI will return,
|
||||
otherwise the AI</em>BALANCER will trigger a <strong>Destroy</strong> event, and the AI will be destroyed.</p>
|
||||
|
||||
<hr/>
|
||||
|
||||
|
||||
@ -2411,6 +2411,7 @@ The UNIT carrying the package.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(AI_CARGO_UNIT).CargoCarrier" >
|
||||
<strong>AI_CARGO_UNIT.CargoCarrier</strong>
|
||||
</a>
|
||||
|
||||
@ -1486,7 +1486,7 @@ A string defining the start state.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#string</em>
|
||||
<em></em>
|
||||
<a id="#(FSM)._StartState" >
|
||||
<strong>FSM._StartState</strong>
|
||||
</a>
|
||||
@ -1780,6 +1780,7 @@ A string defining the start state.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(FSM).current" >
|
||||
<strong>FSM.current</strong>
|
||||
</a>
|
||||
|
||||
@ -1692,9 +1692,6 @@ 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">
|
||||
|
||||
BIN
docs/Presentations/AI_BALANCER/Dia10.JPG
Normal file
|
After Width: | Height: | Size: 199 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia11.JPG
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia12.JPG
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia13.JPG
Normal file
|
After Width: | Height: | Size: 190 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia14.JPG
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia15.JPG
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia16.JPG
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia17.JPG
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia18.JPG
Normal file
|
After Width: | Height: | Size: 209 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia3.JPG
Normal file
|
After Width: | Height: | Size: 197 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia4.JPG
Normal file
|
After Width: | Height: | Size: 155 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia5.JPG
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia6.JPG
Normal file
|
After Width: | Height: | Size: 164 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia7.JPG
Normal file
|
After Width: | Height: | Size: 155 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia8.JPG
Normal file
|
After Width: | Height: | Size: 183 KiB |
BIN
docs/Presentations/AI_BALANCER/Dia9.JPG
Normal file
|
After Width: | Height: | Size: 190 KiB |
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 201 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 186 KiB |