Module AI_Balancer
This module contains the AI_BALANCER class.
1) AI.AIBalancer#AIBALANCER class, extends Core.Fsm#FSM_SET
The AI.AIBalancer#AIBALANCER class monitors and manages as many AI GROUPS as there are CLIENTS in a SETCLIENT collection not occupied by players. The AIBALANCER class manages internally a collection of AI management objects, which govern the behaviour of the underlying AI GROUPS.
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 SET_GROUP and additional event parameters provided during the event.
1.1) AI_BALANCER construction method
Create a new AI_BALANCER object with the AI_BALANCER.New method:
- AI_BALANCER.New: Creates a new AI_BALANCER object.
1.2)
* Add * Remove
1.2) AI_BALANCER returns AI to Airbases
You can configure to have the AI to return to:
- 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. --
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 AI_BALANCER 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 AI_BALANCER moose class.
Authors:
- FlightControl: Framework Design & Programming
Global(s)
| AI_BALANCER |
Type AI_BALANCER
Global(s)
Type AI_Balancer
Type AI_BALANCER
AI_BALANCER class
Field(s)
- #string AI_BALANCER.ClassName
- AI_BALANCER:New(SetClient, SpawnAI)
-
Creates a new AI_BALANCER object
Parameters
-
Core.Set#SET_CLIENT SetClient: A SET_CLIENT object that will contain the CLIENT objects to be monitored if they are alive or not (joined by a player). -
Functional.Spawn#SPAWN SpawnAI: The default Spawn object to spawn new AI Groups when needed.
Return value
Usage:
-- Define a new AI_BALANCER Object. -
- AI_BALANCER:ReturnToHomeAirbase(ReturnTresholdRange)
-
Returns the AI to the home Wrapper.Airbase#AIRBASE.
Parameter
-
Dcs.DCSTypes#Distance ReturnTresholdRange: If there is an enemy Wrapper.Client#CLIENT within the ReturnTresholdRange given in meters, the AI will not return to the nearest Wrapper.Airbase#AIRBASE.
-
- AI_BALANCER:ReturnToNearestAirbases(ReturnTresholdRange, ReturnAirbaseSet)
-
Returns the AI to the nearest friendly Wrapper.Airbase#AIRBASE.
Parameters
-
Dcs.DCSTypes#Distance ReturnTresholdRange: If there is an enemy Wrapper.Client#CLIENT within the ReturnTresholdRange given in meters, the AI will not return to the nearest Wrapper.Airbase#AIRBASE. -
Core.Set#SET_AIRBASE ReturnAirbaseSet: The SET of Core.Set#SET_AIRBASEs to evaluate where to return to.
-
- #boolean AI_BALANCER.ToHomeAirbase
- #boolean AI_BALANCER.ToNearestAirbase
- AI_BALANCER:onenterDestroying(SetGroup, AIGroup, Event, From, To)
-
Parameters
-
Core.Set#SET_GROUP SetGroup: -
Wrapper.Group#GROUP AIGroup: -
Event: -
From: -
To:
-
- AI_BALANCER:onenterMonitoring(SetGroup)
-
Parameter
-
SetGroup:
-
- AI_BALANCER:onenterReturning(SetGroup, AIGroup, Event, From, To)
-
Parameters
-
Core.Set#SET_GROUP SetGroup: -
Wrapper.Group#GROUP AIGroup: -
Event: -
From: -
To:
-
- AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, Event, From, To)
-
Parameters
-
Core.Set#SET_GROUP SetGroup: -
#string ClientName: -
Wrapper.Group#GROUP AIGroup: -
Event: -
From: -
To:
-