Spearhead 1944 AI Systems (AIS)

From Bohemia Interactive Community
Jump to navigation Jump to search

The AI Tweaks system improves in various ways the AI behavior and their gameplay influence.

Usage

When activated via module or functions, the system's functions operate in the background to adjust AI behavior. Depending on the mission setup, it can be active for one or multiple sides.

Detailed information

Main features


  • Info Share: This improves the situational awareness and combat responsiveness of fighting forces via simulated voice and radio-based knowledge sharing between groups.
  • Unstuck: This system tries to restore the mobility of AI when it's stuck due to various pathfinding issues - applies to both infantry and ground vehicles.
  • Collision Insurance: The safety code for AI to avoid harm or damage caused by vehicles colliding with allied mobile infantry and other vehicles.

Additional improvements


  • Manning vehicle turrets by passengers to engage enemies
  • Improved movement group cohesion to avoid soldiers being left behind
  • Autonomous rearming to avoid AI running out of ammo
  • Dynamic and situational formation adjustment for combat vs. non-combat phases
  • More reliable embarking of vehicles under various conditions

Configuration

Mission parameters may allow the customizing of certain elements of the system for the given play-session in multiplayer.

Mission maker setup and use

The advanced customization of AI is possible via the module to a large extent and even more so via scripting.

Detailed documentation is found in the Spearhead 1944.

Retreat Flee Surrender System

Overview

The Retreat Flee Surrender system simulates the stress, threat perception, and unit morale that may make AI decide to retreat from their current position, drop their weapons and flee the battlefield or surrender altogether. As such, the enemy doesn't have to be killed, yet different actions may also lead to overcoming the opposing force. Finally, POWs can be questioned to receive information on potential enemy forces and their locations.

Usage

When activated via module or functions, the system's functions operate in the background to calculate the AI behavior. Depending on the mission setup, it can be active for one or multiple sides. Players won't be directly affected, yet players do influence the AI through their actions.

Detailed information

Units in the scenario that are affected by this system will gain a special stress value that will increase and decrease depending on the current situation (being under fire, wounds, losses, lack of ammo, nearby threats, or allies). Depending on the stress value and the proximity of hostiles, units may be put into one or more non-combatant states. They may temporarily retreat, abandon weapons and flee permanently, become shocked, or surrender. Surrendered enemies, when approached, become POWs and may be interrogated with some chance to get intel about enemy presence in the area. POWs are directed towards certain areas where they will remain. Units in the permanent non-combatant state may get deleted when far enough away from any player.

Configuration

Mission parameters may allow customizing certain elements of the system for the given play-session in multiplayer.

Mission maker setup and use

The advanced customization of RFS is possible via the module to a large extent and even more so via scripting.

Detailed documentation is found in the Spearhead 1944.

MissionNamespace Variables

SPE_Active_AISuite

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: If set to false AI system will be paused.

SPE_Active_Flee

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Can groups flee?

SPE_Active_GroupTracing

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Group traces regardless of flee/surrender active.

SPE_Active_InfoSharing

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Do groups share knowledege.

SPE_Active_Surrender

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Can units surrender?

SPE_Active_TweakAI

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Groups of AI can be tweaked.

SPE_Active_TweakAI_rearm

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: AI can rearm.

SPE_Active_Unstuck

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Enable unstuck system.

SPE_AddGroups

Data Type: Array

Locality: GEGlobal

Default Value:[]

Description: Additional groups for AIS.

SPE_additionalPrimaryWeaponAmmoForAI

Data Type: String

Locality: GEGlobal

Default Value:if (SPE_AIS_cadetDifficulty) then {6} else {0}

Description: Additional primary weapon ammo for all AIs out there.

SPE_addSpawnedGroups

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Spawned groups added to AIS. Currently has no effect for Zeus-spawned units.

SPE_AffectOurSide

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: Should good guys be affected by retreat/flee/surrender/POW/shock.

SPE_AIS_cadetDifficulty

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: Use cadet difficulty.

SPE_AIS_DebugSwitch_systemChat

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Enables debugging via system chat. SPE_AIS_IFS_DebugSwitch needs to be set to true as well.

SPE_AIS_IFS_DebugSwitch

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: Enables debugging. Needs to be set to true for all other debug modes to work.

SPE_AIS_Sides

Data Type: Array

Locality: GEGlobal

Default Value:[EAST,WEST,GUER]

Description: All affected sides.

SPE_AISuiteLoopActive

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Is AIS main loop running. Set to false to disable.

SPE_CleanUp_Distances

Data Type: String

Locality: GEGlobal

Default Value:[((getObjectViewDistance select 0) + 20),((getObjectViewDistance select 0) + 20),-1]

Description: clean up from player distances in format [retreat, fleeing, surrender].

SPE_CleanUp_Hourglass

Data Type: Array

Locality: GEGlobal

Default Value:[120,240]

Description: Time in seconds that must pass from gaining non-combatant status to the moment, when non-combatant can be cleaned up in format [minimum time, max random addition]. Final value is determined at gaining non-combatant status.

SPE_CleanUp_PlayableObservers

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: Use playable/switchable units instead of current player units to check, if any player is too close to clean up non-combatants.

SPE_CrowdPsyche

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: Other's Retreat/Flee/Surrender behaviour affect my behaviour.

SPE_Cycle_Flee

Data Type: Number

Locality: GEGlobal

Default Value:5

Description: flee check interval in seconds.

SPE_Cycle_InfoSharing

Data Type: Number

Locality: GEGlobal

Default Value:5

Description: info share interval in seconds.

SPE_Cycle_Surrender

Data Type: Number

Locality: GEGlobal

Default Value:2

Description: surrender check interval in seconds.

SPE_Cycle_TweakAI

Data Type: Number

Locality: GEGlobal

Default Value:1

Description: AI tweak interval in seconds.

SPE_Cycle_Unstuck

Data Type: Number

Locality: GEGlobal

Default Value:10

Description: unstuck interval in seconds.

SPE_doCatchUp

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Group members movement speed manipulation to improve group cohesion on the move.

SPE_doDiamondInCombat

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Switch groups formations to DIAMOND when in combat. Can improve AI navigation over the terrain.

SPE_doHandleBlockingStuff

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: should unstuck try to hide various map objects around the stuck vehicles.

SPE_doHideBlockingFoliage

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: should unstuck try to hide blocking foliage objects in front of stuck vehicles.

SPE_doLeaveFootmobilesBehind

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Leave behind in separate group redundant tank crewmen.

SPE_doManTurrets

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Important empty vehicle seats may be manned by passengers.

SPE_doReliableEmbarking

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Improved reliability of embarking vehicles especially in combat situations.

SPE_doTweakDisembarkInCombat

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: Tweaked rules of disembarking passengers from vehicle in combat.

SPE_FleeThreshold

Data Type: Array

Locality: GEGlobal

Default Value:[5,50,100]

Description: Flee threshold [5,50,100].

SPE_GlobalStressMultiplier

Data Type: Number

Locality: GEGlobal

Default Value:1

Description: basic stress multiplier.

SPE_GlobalThreatMultiplier

Data Type: Number

Locality: GEGlobal

Default Value:1

Description: threat multiplier.

SPE_InfoShare_BoostedInfoValue

Data Type: Number

Locality: GEGlobal

Default Value:3.5

Description: Info share boosted info value.

SPE_InfoShare_maxTargetDistance_forInfantry

Data Type: Number

Locality: GEGlobal

Default Value:300

Description: Info share max distance from the revealed target if receiver is an infantry.

SPE_InfoShare_maxTargetDistance_forInfantry_boosted

Data Type: Number

Locality: GEGlobal

Default Value:150

Description: Info share max distance from the revealed target if receiver is an infantry (knowledge boost).

SPE_InfoShare_maxTargetDistance_forVehicle

Data Type: Number

Locality: GEGlobal

Default Value:150

Description: Info share max distance from the revealed target if receiver is a vehicle.

SPE_InfoShare_maxTargetDistance_forVehicle_boosted

Data Type: Number

Locality: GEGlobal

Default Value:50

Description: Info share max distance from the revealed target if receiver is a vehicle (knowledge boost).

SPE_InfoShare_revealCapMaximum

Data Type: Number

Locality: GEGlobal

Default Value:3.5

Description: Maximal reveal value.

SPE_InfoSharing_Range

Data Type: Array

Locality: GEGlobal

Default Value:[0,1168.36]

Description: How far AI units can share information.

SPE_InfoSharing_ReceivingRange

Data Type: Array

Locality: GEGlobal

Default Value:[500,500,500,500]

Description: How far receiver may get radio info ([east, west, resistance, other]).

SPE_LocalDebug

Data Type: String

Locality: GEGlobal

Default Value:!isMultiplayer

Description: Player-local debug. By default disabled in multiplayer.

SPE_LocalDebug_fadeOut

Data Type: Number

Locality: GEGlobal

Default Value:10

Description: Player-local debug fade out delay (if applicable - permanent icons excluded).

SPE_MHILoopPause

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: As log this is true, anti-road collisions component will be paused.

SPE_MHILoopSwitch

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: If false, anti-road collisions component will cease to work permanently.

SPE_mobilityRepairTime

Data Type: Number

Locality: GEGlobal

Default Value:0

Description: How long it takes to restore vehicle's mobility when all conditions are met in seconds. 0 to repair as soon conditions are met.

SPE_MoraleAffectingTargetsRange

Data Type: Number

Locality: GEGlobal

Default Value:100

Description: Farther groups are ignored as a threat source.

SPE_nonCombatantKillsAllowed

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: Can fleeing, surrendering or POW units be killed.

SPE_OurSide

Data Type: Side

Locality: GEGlobal

Default Value:GUER

Description: Our side, the good guys.

SPE_permanentShockProb

Data Type: Number

Locality: GEGlobal

Default Value:0.1

Description: Permanent shock probability.

SPE_PlayerStressMultiplier

Data Type: Number

Locality: GEGlobal

Default Value:1.5

Description: Players are scarier than AI units.

SPE_ReliableEmbarking

Data Type: Array

Locality: GEGlobal

Default Value:[EAST,WEST,GUER,CIV]

Description: Enabling reliable embarking assistance for groups of included sides.

SPE_RetreatFollowUp

Data Type: Array

Locality: GEGlobal

Default Value:[[],[],[],[]]

Description: Optional sets of custom follow-up behavior codes after disengage stage of retreat routine is completed. Each side array in selectRandomWeighted-ready format: [string,probability]. Code must be finite, otherwise group will be considered in retreating state indefinitely.

SPE_RetreatPositions

Data Type: Array

Locality: GEGlobal

Default Value:[[],[],[],[]]

Description: Optional sets of positions, towards which retreating groups should move per side. Each side array in selectRandomWeighted-ready format: [coordinates,probability]. Example: [[500,1500,0],0.25,(getMarkerPos 'marker1'),0.75].

SPE_RetreatTime

Data Type: Array

Locality: GEGlobal

Default Value:[-1,0]

Description: Duration in seconds of disengage stage in retreat routine in format [minimum time, max random addition]. Unlimited (by default) when result is negative.

SPE_RFS_POWWalkTimer

Data Type: Number

Locality: GEGlobal

Default Value:60

Description: Surrendered will automtically walk as POWs after that amount of seconds + 2-5s.

SPE_RFSThresholds_ATStressDivisor

Data Type: Number

Locality: GEGlobal

Default Value:2

Description: Must be positive number. The higher, the more being AT-capable reduces stress generated by armored threats (it is already somewhat lower for this equal to 1).

SPE_RFSThresholds_MultiplierRF

Data Type: Number

Locality: GEGlobal

Default Value:1

Description: The lower, the easier for retreat/flee.

SPE_RFSThresholds_MultiplierS

Data Type: Number

Locality: GEGlobal

Default Value:1

Description: The lower, the easier for surrender.

SPE_StressDifficultyComponentDivisor

Data Type: Number

Locality: GEGlobal

Default Value:3

Description: The lower, the bigger impact on group's stress has game difficulty setting values below 1.5 are treated as 1.5.

SPE_SurrenderThreshold

Data Type: Array

Locality: GEGlobal

Default Value:[90,150,200]

Description: Surrender threshold.

SPE_ThreatProximityMultiplier

Data Type: Number

Locality: GEGlobal

Default Value:1

Description: Decides, by how much threat source distance reduces generated threat. values below 1 amplify influence of distance down to 0.001, which basically nullifies the threat at any distance. values above 1 reduce that influence, so farther hostiles would be more threatening.

SPE_Unstuck_BBMoveAside

Data Type: Array

Locality: GEGlobal

Default Value:[true,true,true,true]

Description: Should bounding box based move aside empty vehicles unstuck feature be active per side: [west,east,resistance,other].

SPE_Unstuck_EPEMoveAside

Data Type: Array

Locality: GEGlobal

Default Value:[true,true,true,true]

Description: Should EPE-contact move aside not moving vehicles unstuck feature be active per side: [west,east,resistance,other].

SPE_Unstuck_GroupsToCheck

Data Type: Array

Locality: GEGlobal

Default Value:[]

Description: Additional groups to be checked by the unstuck system.

SPE_Unstuck_HiddenOnly

Data Type: Boolean

Locality: GEGlobal

Default Value:false

Description: Unstuck not in player's sight.

SPE_Unstuck_MoveAsideNonHostilesOnly

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Should unstuck move aside obstacles only if non hostile.

SPE_Unstuck_MoveAsideRoadOnlyObstacle

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Should unstuck move aside obstacles only from the road.

SPE_Unstuck_MoveAsideRoadOnlyVehicle

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Should unstuck move aside obstacles only, if vehicle moves on the road.

SPE_Unstuck_MoveAsideTanksByTanksOnly

Data Type: Boolean

Locality: GEGlobal

Default Value:true

Description: Should tank kind obstacles be moved aside only by other tanks.

SPE_UnstuckExcluded

Data Type: Array

Locality: GEGlobal

Default Value:[]

Description: Units excluded from unstucking.

SPE_UnstuckHideTerrainObjects

Data Type: Array

Locality: GEGlobal

Default Value:[[],[],[],[]]

Description: which types of terrain objects can be hidden by unstuck component:

  • 1: ['TREE','SMALL TREE','BUSH','FOREST','HIDE','FENCE','WALL'] - Can hide near stuck vehicles when player observer within 200m
  • 2: ['TREE','SMALL TREE','BUSH','FOREST','HIDE','FENCE','WALL'] - Can hide near stuck vehicles if no player observer in 200m
  • 3: ['TREE','BUSH','FOREST','WALL'] - Blocking foliage to hide in front of a stuck vehicle
  • 4: ['river','pond'] - Don't hide blacklist per substrings present in the terrain object name string (str object), case-insensitive, probably best to keep it short due to performance impact (numerous string comparisons).