Module AIBalancer
-
-This module contains the AIBALANCER class.
- - - -- -
1) AIBalancer#AIBALANCER class, extends Base#BASE
-The AIBalancer#AIBALANCER class controls the dynamic spawning of AI GROUPS depending on a SETCLIENT. -There will be as many AI GROUPS spawned as there at CLIENTS in SETCLIENT not spawned. -The AIBalancer uses the PatrolZone#PATROLZONE class to make AI patrol an zone until the fuel treshold is reached.
- -1.1) AIBALANCER construction method:
-Create a new AIBALANCER object with the AIBALANCER.New method:
- --
-
- AIBALANCER.New: Creates a new AIBALANCER object. -
1.2) AIBALANCER returns AI to Airbases:
-You can configure to have the AI to return to:
- --
-
- AIBALANCER.ReturnToHomeAirbase: Returns the AI to the home Airbase#AIRBASE. -
- AIBALANCER.ReturnToNearestAirbases: Returns the AI to the nearest friendly Airbase#AIRBASE. -
1.3) AIBALANCER allows AI to patrol specific zones:
-Use AIBalancer#AIBALANCER.SetPatrolZone() to specify a zone where the AI needs to patrol.
- -- -
API CHANGE HISTORY
- -The underlying change log documents the API changes. Please read this carefully. The following notation is used:
- --
-
- Added parts are expressed in bold type face. -
- Removed parts are expressed in italic type face. -
Hereby the change log:
- -2016-08-17: SPAWN:InitCleanUp( SpawnCleanUpInterval ) replaces SPAWN:CleanUp( SpawnCleanUpInterval )
- --
-
- Want to ensure that the methods starting with Init are the first called methods before any Spawn method is called! -
- This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods. -
- -
AUTHORS and CONTRIBUTIONS
- -Contributions:
- --
-
Dutch_Baron (James): Who you can search on the Eagle Dynamics Forums.
- Working together with James has resulted in the creation of the AIBALANCER class.
- James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)
- SNAFU: - Had a couple of mails with the guys to validate, if the same concept in the GCI/CAP script could be reworked within MOOSE. - None of the script code has been used however within the new AIBALANCER moose class.
-
Authors:
- --
-
- FlightControl: Framework Design & Programming -
Global(s)
-| AIBALANCER | -- - | -
Type AIBALANCER
- Global(s)
--
-
- - - #AIBALANCER - -AIBALANCER - - -
- - - - - -
Type AIBalancer
-
- Type AIBALANCER
-
-AIBALANCER class
- -Field(s)
--
-
- - - - -AIBALANCER.AIGroups - - -
- - - - - -
-
-
- - - #string - -AIBALANCER.ClassName - - -
- - - - - -
-
-
- - - -AIBALANCER:GetPatrolZone() - - -
-
-
-
Get the PatrolZone object assigned by the AIBalancer object.
- -Return value
- -PatrolZone#PATROLZONE: -PatrolZone The PatrolZone where the AI needs to patrol.
- -
-
-
-
- - - -AIBALANCER:New(SetClient, SpawnAI) - - -
-
-
-
Creates a new AIBALANCER object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.
- -Parameters
--
-
-
-
-
- -SetClient: -A SET_CLIENT object that will contain the CLIENT objects to be monitored if they are alive or not (joined by a player).
- -
-
-
- -SpawnAI: -A SPAWN object that will spawn the AI units required, balancing the SetClient.
-
Return value
- -#AIBALANCER: -self
- -
- -
-
-
-
-
- - - PatrolZone#PATROLZONE - -AIBALANCER.PatrolZone - - -
- - - - - -
-
-
- - - - -AIBALANCER.PatrolZones - - -
- - - - - -
-
-
- - - Set#SET_AIRBASE - -AIBALANCER.ReturnAirbaseSet - - -
- - - - - -
-
-
- - - -AIBALANCER:ReturnToHomeAirbase(ReturnTresholdRange) - - -
-
-
-
Returns the AI to the home Airbase#AIRBASE.
- -Parameter
--
-
-
-
-
- -DCSTypes#Distance ReturnTresholdRange: -If there is an enemy Client#CLIENT within the ReturnTresholdRange given in meters, the AI will not return to the nearest Airbase#AIRBASE.
-
- -
-
-
-
-
- - - -AIBALANCER:ReturnToNearestAirbases(ReturnTresholdRange, ReturnAirbaseSet) - - -
-
-
-
Returns the AI to the nearest friendly Airbase#AIRBASE.
- -Parameters
--
-
-
-
-
- -DCSTypes#Distance ReturnTresholdRange: -If there is an enemy Client#CLIENT within the ReturnTresholdRange given in meters, the AI will not return to the nearest Airbase#AIRBASE.
- -
-
-
- -Set#SET_AIRBASE ReturnAirbaseSet: -The SET of Set#SET_AIRBASEs to evaluate where to return to.
-
- -
-
-
-
-
- - - DCSTypes#Distance - -AIBALANCER.ReturnTresholdRange - - -
- - - - - -
-
-
- - - Set#SET_CLIENT - -AIBALANCER.SetClient - - -
- - - - - -
-
-
- - - -AIBALANCER:SetPatrolZone(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed) - - -
-
-
-
Let the AI patrol a Zone with a given Speed range and Altitude range.
- -Parameters
--
-
-
-
-
- -PatrolZone#PATROLZONE PatrolZone: -The PatrolZone where the AI needs to patrol.
- -
-
-
- -PatrolFloorAltitude:
- -
-
-
- -PatrolCeilingAltitude:
- -
-
-
- -PatrolMinSpeed:
- -
-
-
- -PatrolMaxSpeed:
-
Return value
- -PatrolZone#PATROLZONE: -self
- -
- -
-
-
-
-
- - - Spawn#SPAWN - -AIBALANCER.SpawnAI - - -
- - - - - -
-
-
- - - #boolean - -AIBALANCER.ToHomeAirbase - - -
- - - - - -
-
-
- - - #boolean - -AIBALANCER.ToNearestAirbase - - -
- - - - - -
-
-
- - - -AIBALANCER:_ClientAliveMonitorScheduler() - - -
- - - - - -