Difference between revisions of "Military AI Commander"

From ALiVE Wiki
Jump to: navigation, search
m (Friznit moved page OPCOM to Military AI Commander without leaving a redirect)
Line 30: Line 30:
 
AI Commanders consists of two core elements: Operational Command (OPCOM) and Tactical Command (TACOM).  Commanders take the objectives of any synced Placement modules and prioritises them depending on the user defined variables.  It also regularly analyses the map, relative troop strengths and available assets required to capture and hold objectives in its area of operations.  Commanders give missions to TACOM, which in turn executes the tactical level orders to units and reports back its state once that mission is complete.
 
AI Commanders consists of two core elements: Operational Command (OPCOM) and Tactical Command (TACOM).  Commanders take the objectives of any synced Placement modules and prioritises them depending on the user defined variables.  It also regularly analyses the map, relative troop strengths and available assets required to capture and hold objectives in its area of operations.  Commanders give missions to TACOM, which in turn executes the tactical level orders to units and reports back its state once that mission is complete.
  
The OPCOM controls only profiled groups.  TACOM is a low level tactical commander that deals with Visual AI groups when players are nearby.  This means it is possible to transfer the status of groups and objectives seamlessly between the Visual (spawned) Layer and the Virtual (unspawned or cached) Layer.  This allows huge ongoing virtual battles, from offensive operations with blazing battlefronts to insurgency deployments with a high degree of realism and minimal impact on performance.
+
The AI Commanders only control groups profiled with the Virtual AI System.  TACOM is a low level tactical commander that deals with Visual AI groups when players are nearby.  This means it is possible to transfer the status of groups and objectives seamlessly between the Visual (spawned) Layer and the Virtual (unspawned or cached) Layer.  This allows huge ongoing virtual battles, from offensive operations with blazing battlefronts to insurgency deployments with a high degree of realism and minimal impact on performance.
  
  
Line 53: Line 53:
  
 
==Editor Notes==
 
==Editor Notes==
 +
 +
'''Syncing Virtual AI Commanders to Placements'''
 +
 +
A key concept to understand is that the AI Commander will only deal with Objectives he knows about.  Objectives are defined by the Placement modules (Military, Civilian or Custom) and the AI Commander is 'informed' about these Objectives by syncing the two modules together.  Therefore the AI Commander must be Synced with ''every'' Placement Module that covers an Objective you want them to attack.  See the [[TAOR]] demo for more details on how to sync modules.
 +
  
 
'''Halting OPCOM activity'''
 
'''Halting OPCOM activity'''

Revision as of 06:19, 12 December 2014

Custom Objectives used to occupy a front line (Thanks to Oktyabr for this pic)
Part of:
Icon mil opcom.png ALiVE Military
Requirements: Synced
Icon sys profile.png Virtual AI System
Onebit no.png
Module milplacement.png Military Placement (Mil Obj)
Onebit yes.png
Optional: Synced
Icon mil ML.png Military Logistics
Onebit yes.png


How It Works

The Military AI Commander prioritises a list of objectives and then plans and executes missions with available units. AI Commanders will react to the changing environment and attack, defend, withdraw or resupply depending on the current tactical situation. Commanders continues to work with profiled groups, controlling a virtual battlefield out of visual range of players.

AI Commanders consists of two core elements: Operational Command (OPCOM) and Tactical Command (TACOM). Commanders take the objectives of any synced Placement modules and prioritises them depending on the user defined variables. It also regularly analyses the map, relative troop strengths and available assets required to capture and hold objectives in its area of operations. Commanders give missions to TACOM, which in turn executes the tactical level orders to units and reports back its state once that mission is complete.

The AI Commanders only control groups profiled with the Virtual AI System. TACOM is a low level tactical commander that deals with Visual AI groups when players are nearby. This means it is possible to transfer the status of groups and objectives seamlessly between the Visual (spawned) Layer and the Virtual (unspawned or cached) Layer. This allows huge ongoing virtual battles, from offensive operations with blazing battlefronts to insurgency deployments with a high degree of realism and minimal impact on performance.


Usage

Place a Military AI Commander module in the editor and select the faction it will control from the drop down. OPCOM can control more than one faction at the same time and custom factions can be entered in the “override factions” box. Commanders must have some troops to control from a synced Placement module set to spawn troops or some manually placed and profiled units.

Module Options:

Control Type:

  • Occupy: units will be placed at objectives throughout the Mil Placement TAOR and will attempt to occupy and defend installations.
  • Invasion: units will start in the vicinity of the Placement module(s) and will move to take objectives as ordered by OPCOM.


Reinforcements: sets the frequency of reinforcement requests sent by OPCOM when the Military Logistics module is synced. OPCOM will send requests when it reaches a given percentage of its start state.

  • Constant: Requests sent at 90% Combat Effectiveness. Effect: Reinforcements will arrive in a constant trickle.
  • Blocked: Requests sent at 75% CE. Effect: blocks of reinforcements will arrive at intervals.
  • Seldom: Requests sent at 50% CE. Effect: large block of reinforcements will arrive but very rarely.


By default, AI Commanders will take command of all available virtual units (profiles) for its faction. To limit Commanders to a set number of units, manually place some units in the editor and Sync (F5) them to the Virtual AI System module with appropriate settings to ‘convert’ them to profiles. Make sure you select Objectives Only on the Placement Module to prevent it spawning any units!

Editor Notes

Syncing Virtual AI Commanders to Placements

A key concept to understand is that the AI Commander will only deal with Objectives he knows about. Objectives are defined by the Placement modules (Military, Civilian or Custom) and the AI Commander is 'informed' about these Objectives by syncing the two modules together. Therefore the AI Commander must be Synced with every Placement Module that covers an Objective you want them to attack. See the TAOR demo for more details on how to sync modules.


Halting OPCOM activity

The AI Commander can be stopped and started by syncing a trigger to the module. When all trigger states are TRUE, the Commander will commence attacking the next unsecured objective. If the trigger state returns to False, the Commander will complete any currently assigned objectives then stop. For example, this can be used to stop AI Commander if no players are present on the map.


Custom Objectives

Additional objectives can be placed using the Military Placement (Custom Objectives) module synced to an AI Commander. Additionally, advanced editors can place a location gamelogic of any type on the map and sync it to the Commander module(s). Optionally put in init field of the gamelogic:

this setvariable ["size",150]; this setvariable ["priority", 500];
  • Size is in metres
  • Priority can be any number greater than 1 (999 would be extremely high prio!)

The following function can be used to add or remove Objectives from a script

[_OPCOM,"addObjective",[_id, _pos, _size]] call ALiVE_fnc_OPCOM
[_OPCOM, "removeObjective",_id] call ALiVE_fnc_OPCOM

Dev Notes

Subject to change as OPCOM is balanced.

"invasion":

"sectionsamount_attack", 3
"sectionsamount_reserve", 1
"sectionsamount_defend", 2

"occupation":

"sectionsamount_attack", 4
"sectionsamount_reserve", 1
"sectionsamount_defend", 2


Occupation builds a priority list using an algorithm for size, cluster priority, height over sea and distance from module. Invasion (for now) only uses distance to determine the next objective.