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:

1.2)

* Add * Remove

1.2) AI_BALANCER returns AI to Airbases

You can configure to have the AI to return to:

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

AI_BALANCER.AIGroups
AI_BALANCER.ClassName
AI_BALANCER:New(SetClient, SpawnAI)

Creates a new AI_BALANCER object

AI_BALANCER.PatrolZones
AI_BALANCER.ReturnAirbaseSet
AI_BALANCER:ReturnToHomeAirbase(ReturnTresholdRange)

Returns the AI to the home Wrapper.Airbase#AIRBASE.

AI_BALANCER:ReturnToNearestAirbases(ReturnTresholdRange, ReturnAirbaseSet)

Returns the AI to the nearest friendly Wrapper.Airbase#AIRBASE.

AI_BALANCER.ReturnTresholdRange
AI_BALANCER.SetClient
AI_BALANCER.ToHomeAirbase
AI_BALANCER.ToNearestAirbase
AI_BALANCER:onenterDestroying(SetGroup, AIGroup, From, Event, To)
AI_BALANCER:onenterMonitoring(SetGroup)
AI_BALANCER:onenterReturning(SetGroup, AIGroup, From, Event, To)
AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, From, Event, To)

Global(s)

#AI_BALANCER AI_BALANCER

Type AI_Balancer

Type AI_BALANCER

AI_BALANCER class

Field(s)

AI_BALANCER.AIGroups
#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

#AI_BALANCER:

Usage:

-- Define a new AI_BALANCER Object.
AI_BALANCER.PatrolZones
AI_BALANCER.ReturnAirbaseSet
AI_BALANCER:ReturnToHomeAirbase(ReturnTresholdRange)

Returns the AI to the home Wrapper.Airbase#AIRBASE.

Parameter

AI_BALANCER:ReturnToNearestAirbases(ReturnTresholdRange, ReturnAirbaseSet)

Returns the AI to the nearest friendly Wrapper.Airbase#AIRBASE.

Parameters

AI_BALANCER.ReturnTresholdRange
Core.Set#SET_CLIENT AI_BALANCER.SetClient
#boolean AI_BALANCER.ToHomeAirbase
#boolean AI_BALANCER.ToNearestAirbase
AI_BALANCER:onenterDestroying(SetGroup, AIGroup, From, Event, To)

Parameters

AI_BALANCER:onenterMonitoring(SetGroup)

Parameter

  • SetGroup :

AI_BALANCER:onenterReturning(SetGroup, AIGroup, From, Event, To)

Parameters

AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, From, Event, To)

Parameters