Strategic AI


Index


CreateScript(string name)
name: Name of the script.
InitialState(string state)
Required
state: Name of the state to start in.
CreateVarInteger(string var, integer initial, integer min, integer max)
Multiple, Optional min(integer min), max(integer max)
var: Name of the var to be created. Must be a script var, i.e. start with '%'.
initial: The inital value to give the var.
min: The minimum value this var can ever have.
max: The maximum value this var can ever have.
CreateVarFloat(string var, float initial, float min, float max)
Multiple, Optional min(float min), max(float max)
var: Name of the var to be created. Must be a script var, i.e. start with '%'.
initial: The initial value to give the var.
min: The minimum value this var can ever have.
max: The maximum value this var can ever have.
CreateVarString(string var, string initial)
Multiple
var: Name of the var to be created. Must be a script var, i.e. start with '%'.
initial: The initial value to give the var.
Op()
See
Op form more information.
State(string name)
Multiple
name: Name of the state.
Settings()
Required
Settings are applied when the state is entered.
Setting(string type)
Multiple
name: Setting type. The contents of the setting scope are dependent on the setting type.
The following setting types are defined:
Action(string type)
Optional
type: Action type. The contents of the action scope are dependent on the action type.
If no Action is present, this is known as a NULL Action. A NULL action will use the has the status "Completed" immediately. The following action types are defined:
Conditions()
Optional
Status(string status)
Multiple
Status scopes define transitions to be performed based on the status of the Action being executed in this state. The contents of Completed are identical to Transition(). See below.
status: Name of the status to pefrorm the transition on. Different actions produce different statuses but there are some common ones.
  • Completed
    When the action is completed the status is completed.
Condition(string type)
Multiple
type: Condition type. The contents of the condition scope are dependent upon the type with the exception of the Transition scope which is required in all conditions. The following types are defined.
Transition()
Required
A transition must include one of the following scopes.
End()
End the script. Note that the units in the squad are NOT discharged and that the AI won't use the units in the squad ever again.
GotoState(string state)
state: State to go to.
GotoRandomState()
Go to a state at random from the given states. At least one state must be defined.
Add(string state, float weight)
state: Name of the state to go to.
weight: Weighting to give to this branch.
CallState(string state)
state: State to call. The called state can use the return state transition to return to the calling state (this one).
CallRandomState()
Call a state at random from the given states. At least one state must be defined.
Add(string state, float weight)
state: Name of the state to call.
weight: Weighting to give to this branch.
ReturnState()
Return from this state. There must be at least one state on the "stack" otherwise this will fail.
CreateBase(string name)
Multiple
name: Name of the base.
Location
Required
Location of the base.
Refer to
Locations for more information.
InitialState(string state)
Required
state: Name of the state to start in.
State
Multiple
State
Multiple
Orderers()
Required The orderers to use in this base state.
Add(string orderer, integer resource, integer priority)
Multiple
orderer: name of the orderer to use.
resource: resource weighting of the orderer.
priority: priority of the orderer.
CreateBase::Orderer(string name)
Multiple
name: Name of the base orderer.
Reserve(integer amount)
Optional(0)
amount: This orderer won't spend resource if the total resource is less than this amount.
Manifest(string type)
Required type: Type of the manifest. The following types are defined.
  • Direct
    Build the the types presented.
  • Level
    Ensure that number of units is maintained at the given level.
  • BaseLevel
    Ensure that number of units is maintained at the given level within the base which owns this orderer.
  • Ratio
    Continue building the types in the ratio defined by the types.
  • Power
    Build more units depending on the current power level.
    Preparation(float time)
    Optional(10%)
    time: Amount of time to look ahead for power changed based on time of day.
    Over(integer amount)
    Optional(100)
    amount: Amount of power to overbuild by.
Types()
Required
Add(string type, integer amount)
Multiple, Optional amount(1)
type: Type name to use.
amount: Amount of type.
Random(boolean flag)
Optional(0)
flag: Whether the types are applied randomly or in the order listed.
Plan(string plan)
Required
plan: Name of the base plan to use when placing objects built by this manifest.
CreateBase::Plan
Multiple
name: Name of the base building plan.
Extents(float distance)
Required
distance: Distance to the perimiter of the base.
Front(float angle)
Required
angle: Compass angle to the front of the base.
DefaultEvaluation()
Required
Weighting()
Multiple
Weighting allows for multiple configurations which are chosen from via a random weighint (using the weighting values no less).
Orientation(float angle)
Optional
angle: Angle relative to the front of the base.
Weighting(float weighting)
Required
weighting: The weighting this parameter has.
Cutoff(float cutoff)
Required, Range(0.0, 1.0)
cutoff: Cells below this cutoff will not be considered.
Centre()
Optional Prefer cells which are close to the centre of the base. The contents are Weighting and Cutoff as per Orientation.
Perimeter()
Optional Prefer cells which are close to the perimeter of the base. The contents are Weighting and Cutoff as per Orientation.
WaterEdge()
Optional Prefer cells which are close to the edge of water. The contents are Weighting and Cutoff as per Orientation.
PropertyEvaluations()
Configurations based on properties in the types.
Add(string property)
Multiple
property: Property this configuration is for.
The contents are identical to the contents of DefaultEvaluation.
TypeEvaluations()
Configuratiosn based on types.
Add(string type)
Multiple
type: Type this configuration is for.
The contents are identical to the contents of DefaultEvaluation.
CreateRecruitForce(string name)
name: Name of the force matching configuration.
Evaluation()
Required
Parameters used during the evaluation of the available units. Each unit is given a score from 0 to 1 for each of the five types and those five scores are combined using the importances of each score.
Constitution(float importance)
Required
importance: Importance to give to constitution.
Constitution is determined by how long the given unit can survive in the area speficied by comparing the armour class and hit points of the units against the threats to that armour class in the area of interest.
Effectiveness(float importance)
Required
importance: Importance to give to effectiveness.
Effectiveness is determined by how effective the weapons the unit has are against the armour classes in the area of interest.
Time(float importance)
importance: Importance to give to time.
The amount of time required for the given unit to get to area of interest. The longer a unit will take to get to the area, the lower its time value.
Cost(float importance)
importance: Importance to give to cost.
The higher the cost of replacing the given unit the lower its cost value.
Tweak(float importance)
importance: Importance to give to tweak.
Type(string type, float tweak)
Multiple, tweak Range(0, 1)
type: Unit type to assign tweak to.
tweak: Tweak value to use with units of this type.
Default(float tweak)
Required, Range(0, 1)
tweak: Default tweak value given to non specified types.
Allocation()
Required
Defense(float value)
Required
value: Amount of defense to allocate to threat. This translates to the number of seconds the units could survive is all of the threat in the area is brought to bear on all units simultaneously. Experiment with values between 1 and 10.
Threat(float value)
Required
value: Amount of threat to allocate to defense. This translates to the the amount of threat required to destroy all of the defeneses in the area in one second. Experiment with values below zero.
CreateRecruitType(string name)
name: Name of the type configuration.
Type(string type, integer amount)
Multiple
type: Unit type recruit.
amount: Number of units to recruit.
Locations
Locations are used whenever the AI needs to know about a location on the map. Different circumstances will use locations differently and may require/use different parts of locations.
Base(string type)
Optional(none)
type: The type of the base part of a location which can be
  • Region(string region)
    region: Name of the region to use for a location.

  • Tag(string tag)
    tag: Name of the tag to use for a location.

  • Squad(string squad)
    squad: Name of the squad script to use for a location.

  • LastRadioEvent
    Uses the location of the last handled radio event.

Offset(string type)
Optional(none)
  • Polar(float distance, float direction)
    distance: distance (in metres) to offset by.
    direction: compass angle direction to offset by.
  • Orthogonal(float Xoffset, float Zoffset)
    Xoffset: distance to offset along x axis (in metres).
    Zoffset: distance to offset along z axis (in metres).
Rule(string type)
Optional(none)