# IPC Autonomous Capture AI

****IPCAutonomousCaptureAI****<span style="white-space: pre-wrap;"> is a mod designed for the </span>**Conflict**<span style="white-space: pre-wrap;"> game mode in Arma Reforger. It introduces an </span>****autonomous AI capture system****<span style="white-space: pre-wrap;">, enabling AI units to dynamically capture objectives without player intervention. Spawned AI will automatically locate and move toward the current </span>****Main Objective****, supporting a more immersive and reactive battlefield experience.

## <span style="white-space: pre-wrap;">1. How to Use the Autonomous Capture Spawn Point </span>

<span style="white-space: pre-wrap;">To set up an autonomous AI group that dynamically targets objectives in the </span>**Conflict**<span style="white-space: pre-wrap;"> mode, simply place the prefab </span>**`<strong class="editor-theme-bold editor-theme-code">IPC_AutonomousCaptureSpawnPoint</strong>`**<span style="white-space: pre-wrap;"> in your scenario using the World Editor.</span>

##### ✅ Basic Setup

- <span style="white-space: pre-wrap;">Ensure the entity has a </span>**`<strong class="editor-theme-bold editor-theme-code">SCR_FactionAffiliationComponent</strong>`**<span style="white-space: pre-wrap;"> set to the faction you want.</span>
- <span style="white-space: pre-wrap;">Place the prefab close to a </span>****military base****<span style="white-space: pre-wrap;"> or </span>****target point****.
- <span style="white-space: pre-wrap;">Upon scenario start, the AI group will </span>****spawn****<span style="white-space: pre-wrap;">, </span>****select a target****<span style="white-space: pre-wrap;">, and </span>****move toward it****<span style="white-space: pre-wrap;"> automatically.</span>

##### ⚙️ Configurable Attributes Explained

Here’s a breakdown of each configuration field and its effect:

<table id="bkmrk-attributedescription"><colgroup><col></col><col></col></colgroup><tbody><tr><th>****Attribute****</th><th>****Description****</th></tr><tr><td>`<span class="editor-theme-code">m_eGroupType</span>`

</td><td>Defines the type of group to spawn (e.g., Fireteam, Squad).

</td></tr><tr><td>`<span class="editor-theme-code">m_bPickRandomGroupType</span>`

</td><td>Randomly selects a group type on spawn.

</td></tr><tr><td>`<span class="editor-theme-code">m_isGroupUpdate</span>`

</td><td>Enables dynamic group change after X respawns.

</td></tr><tr><td>`<span class="editor-theme-code">m_iGroupUpdateRate</span>`

</td><td>Number of respawns before group type is updated.

</td></tr><tr><td>`<span class="editor-theme-code">m_iRespawnPeriod</span>`

</td><td><span style="white-space: pre-wrap;">Time (in seconds) before the group respawns. </span>`<span class="editor-theme-code">0 = no respawn</span>`.

</td></tr><tr><td>`<span class="editor-theme-code">m_fAILimitThreshold</span>`

</td><td>Prevents spawning if too many AIs already exist globally (as ratio).

</td></tr><tr><td>`<span class="editor-theme-code">m_iNum</span>`

</td><td>Number of groups to spawn at once.

</td></tr><tr><td>`<span class="editor-theme-code">m_eTargetType</span>`

</td><td><span style="white-space: pre-wrap;">Defines the AI’s target type: </span>`<span class="editor-theme-code">MainTarget</span>`<span style="white-space: pre-wrap;">, </span>`<span class="editor-theme-code">EnemyMainTarget</span>`<span style="white-space: pre-wrap;">, </span>`<span class="editor-theme-code">Base</span>`<span style="white-space: pre-wrap;">, </span>`<span class="editor-theme-code">CapturePoint</span>`<span style="white-space: pre-wrap;">, or </span>`<span class="editor-theme-code">Player</span>`.

</td></tr><tr><td>`<span class="editor-theme-code">m_fTargetRange</span>`

</td><td>Maximum distance to target to allow spawn.

</td></tr><tr><td>`<span class="editor-theme-code">m_sTargetFactionKey</span>`

</td><td>Key of the enemy faction (e.g., "USSR") for target logic.

</td></tr><tr><td>`<span class="editor-theme-code">m_iTargetUpdateTimeout</span>`

</td><td>Time interval (ms) between target updates.

</td></tr><tr><td>`<span class="editor-theme-code">m_iWaypointUpdateTimeout</span>`

</td><td>Time interval (ms) between waypoint recalculations.

</td></tr><tr><td>`<span class="editor-theme-code">m_fDespawnRange</span>`

</td><td>If no players are within this range, AI will despawn.

</td></tr><tr><td>`<span class="editor-theme-code">m_fSpawnProtectRange</span>`

</td><td>Prevents AI from spawning too close to players.

</td></tr><tr><td>`<span class="editor-theme-code">SpawnProtect</span>`

</td><td>Enable/disable spawn protection behavior.

</td></tr><tr><td>`<span class="editor-theme-code">dynamicDespawn</span>`

</td><td>Despawn AI when players are far away.

</td></tr><tr><td>`<span class="editor-theme-code">spawnOnlyNearest</span>`

</td><td>Only spawn if this base is closest to the current target.

</td></tr><tr><td>`<span class="editor-theme-code">m_iPlayer</span>`

</td><td>Number of players required to allow spawn.

</td></tr><tr><td>`<span class="editor-theme-code">m_sNoSpawnFactionKey</span>`

</td><td>Disables spawn if nearest base belongs to this faction.

</td></tr><tr><td>`<span class="editor-theme-code">m_sSpawnOnlyFactionKey</span>`

</td><td>Enables spawn only if nearest base belongs to this faction.

</td></tr><tr><td>`<span class="editor-theme-code">m_bShowMarker</span>`

</td><td>Show map marker for the AI group.

</td></tr><tr><td>`<span class="editor-theme-code">m_bShowToEveryone</span>`

</td><td>Make the marker visible to all factions.

</td></tr></tbody></table>

##### 🧪 AI Behavior

- AI group dynamically updates its waypoint to the selected target type.
- <span style="white-space: pre-wrap;">Skill level is scaled depending on the </span>****number of players online****.
- <span style="white-space: pre-wrap;">If no valid target is found or conditions are unmet (e.g., players too close), the group will </span>****not spawn****.
- <span style="white-space: pre-wrap;">Waypoint and group are updated live based on </span>****real-time campaign state****.

---

## <span style="white-space: pre-wrap;">2. How to Use the Autonomous Capture Spawn Point </span>****with Vehicle****

<span style="white-space: pre-wrap;">The </span>`<span class="editor-theme-code">IPC_AutonomousCaptureSpawnPointWithVehicle</span>`<span style="white-space: pre-wrap;"> prefab works just like the standard version, but includes </span>****vehicle support****. AI groups will spawn with vehicles and automatically mount them before moving to their objective.

##### 🧱 Setup Instructions

1. <span style="white-space: pre-wrap;">Place the prefab in the </span>****World Editor****, same as the non-vehicle version.
2. <span style="white-space: pre-wrap;">Ensure the faction is correctly assigned with a </span>`<span class="editor-theme-code">SCR_FactionAffiliationComponent</span>`.
3. Define which vehicle to use for each group type.
4. AI groups will:
    - Spawn next to the vehicle
    - Mount it using the provided "Get In" waypoint
    - Move toward the target (main objective, base, or enemy unit)

##### ⚙️ Additional Configurable Attributes

<span style="white-space: pre-wrap;">This prefab inherits </span>****all options****<span style="white-space: pre-wrap;"> from </span>`<span class="editor-theme-code">IPC_AutonomousCaptureSpawnPointComponent</span>`<span style="white-space: pre-wrap;"> and adds vehicle-specific settings:</span>

<table id="bkmrk-attributedescription-1"><colgroup><col style="width: 551px;"></col><col style="width: 612px;"></col></colgroup><tbody><tr><th>****Attribute****</th><th>****Description****</th></tr><tr><td>`<span class="editor-theme-code">m_sVehicle_TeamSentry</span>`

</td><td><span style="white-space: pre-wrap;">Prefab for vehicle used by </span>****TEAM\_SENTRY****<span style="white-space: pre-wrap;"> group.</span>

</td></tr><tr><td>`<span class="editor-theme-code">m_sVehicle_TeamMG</span>`

</td><td><span style="white-space: pre-wrap;">Prefab for vehicle used by </span>****TEAM\_MG****<span style="white-space: pre-wrap;"> group.</span>

</td></tr><tr><td>`<span class="editor-theme-code">m_sVehicle_TeamAT</span>`

</td><td><span style="white-space: pre-wrap;">Prefab for vehicle used by </span>****TEAM\_AT****<span style="white-space: pre-wrap;"> group.</span>

</td></tr><tr><td>`<span class="editor-theme-code">m_sVehicle_Fireteam</span>`

</td><td><span style="white-space: pre-wrap;">Prefab for vehicle used by </span>****FIRETEAM****<span style="white-space: pre-wrap;"> group.</span>

</td></tr><tr><td>`<span class="editor-theme-code">m_sVehicle_SquadRifle</span>`

</td><td><span style="white-space: pre-wrap;">Prefab for vehicle used by </span>****SQUAD\_RIFLE****<span style="white-space: pre-wrap;"> group.</span>

</td></tr><tr><td>`<span class="editor-theme-code">m_sGetInWaypointPrefab</span>`

</td><td>Waypoint prefab used by AI to mount the vehicle after spawn.

</td></tr></tbody></table>

> <span style="white-space: pre-wrap;">💡 </span>**Each group type can have its own vehicle. If no vehicle is defined for the type, the AI will behave like a normal foot patrol.**

##### 🛠️ Vehicle Behavior Logic

- <span style="white-space: pre-wrap;">Vehicles are spawned </span>****only once per patrol group****.
- <span style="white-space: pre-wrap;">If the patrol despawns (e.g., no players nearby), the vehicle is also </span>****automatically removed****.
- <span style="white-space: pre-wrap;">The waypoint used makes sure AI </span>****gets inside****<span style="white-space: pre-wrap;"> the vehicle before moving.</span>
- <span style="white-space: pre-wrap;">Marker icon will change to </span>****motorized****<span style="white-space: pre-wrap;"> if the patrol includes a vehicle.</span>

##### 🔁 Integration with Existing Systems

This prefab is fully compatible with:

- ****Dynamic despawn/spawn****
- ****Player proximity settings****
- ****Faction-based filtering****
- ****Marker visibility options****
- ****Target type options****<span style="white-space: pre-wrap;"> (</span>`<span class="editor-theme-code">MainTarget</span>`<span style="white-space: pre-wrap;">, </span>`<span class="editor-theme-code">Base</span>`, etc.)

---

## <span style="white-space: pre-wrap;">3. How to Use the Autonomous Capture Spawn Point </span>****with Mortar****

<span style="white-space: pre-wrap;">The </span>`<span class="editor-theme-code">IPC_MortarSpawnPoint</span>`<span style="white-space: pre-wrap;"> prefab is a special variant that deploys AI groups operating </span>****mortar positions****<span style="white-space: pre-wrap;">. It enables indirect fire support targeting enemy factions dynamically during gameplay. Ideal for adding long-range artillery threats in </span>**Conflict**<span style="white-space: pre-wrap;"> scenarios.</span>

##### 🧱 Setup Instructions

1. <span style="white-space: pre-wrap;">Place the prefab in the </span>****World Editor****<span style="white-space: pre-wrap;">, with a </span>`<span class="editor-theme-code">SCR_FactionAffiliationComponent</span>`<span style="white-space: pre-wrap;"> for correct faction assignment.</span>
2. Define the mortar composition prefab, "Get In" waypoint, and artillery support waypoint in the entity attributes.
3. On activation:
    - The mortar composition is spawned at the prefab’s location.
    - <span style="white-space: pre-wrap;">An AI group is created and tasked with launching </span>****periodic artillery attacks****<span style="white-space: pre-wrap;"> toward a valid enemy objective.</span>

##### ⚙️ Additional Configurable Attributes

<span style="white-space: pre-wrap;">Inherits all settings from </span>`<span class="editor-theme-code">IPC_AutonomousCaptureSpawnPointComponent</span>`, plus the following mortar-specific options:

<table id="bkmrk-attributedescription-2"><colgroup><col></col><col></col></colgroup><tbody><tr><th>****Attribute****</th><th>****Description****</th></tr><tr><td>`<span class="editor-theme-code">m_sMortar</span>`

</td><td><span style="white-space: pre-wrap;">Mortar prefab to be spawned (e.g. </span>`<span class="editor-theme-code">MortarPlacement_S_USSR_01</span>`).

</td></tr><tr><td>`<span class="editor-theme-code">m_sGetInWaypointPrefab</span>`

</td><td><span style="white-space: pre-wrap;">Waypoint for AI to enter the mortar (typically </span>`<span class="editor-theme-code">AIWaypoint_GetInNearest</span>`).

</td></tr><tr><td>`<span class="editor-theme-code">m_sArtillerySupportWaypointPrefab</span>`

</td><td><span style="white-space: pre-wrap;">Waypoint to handle firing behavior (typically </span>`<span class="editor-theme-code">AIWaypoint_ArtillerySupport</span>`).

</td></tr><tr><td>`<span class="editor-theme-code">m_iShots</span>`

</td><td>Number of mortar rounds per firing session (`<span class="editor-theme-code">-1</span>`<span style="white-space: pre-wrap;"> = infinite, recommended: 5–10).</span>

</td></tr><tr><td>`<span class="editor-theme-code">m_iMortarTimeout</span>`

</td><td>Time between two fire waves (milliseconds).

</td></tr><tr><td>`<span class="editor-theme-code">m_fmaxRange</span>`

</td><td>Max distance for randomizing target position (meters).

</td></tr></tbody></table>

##### 🧪 Mortar Behavior

- <span style="white-space: pre-wrap;">Mortars will </span>****fire at enemy positions****<span style="white-space: pre-wrap;"> dynamically based on the configured target type:</span>
    - Main target
    - Enemy base
    - Player proximity
- <span style="white-space: pre-wrap;">If players from the target faction are detected near the objective, a </span>****strike is called****.
- Mortars will respect dynamic despawn logic if players move away or the group is wiped.
- <span style="white-space: pre-wrap;">After firing, AI waits based on </span>`<span class="editor-theme-code">m_iMortarTimeout</span>`<span style="white-space: pre-wrap;"> before engaging again.</span>

##### 📍 Example Use Case

<span style="white-space: pre-wrap;">You want to simulate </span>****indirect fire support****<span style="white-space: pre-wrap;"> behind a frontline. Set:</span>

- `<span class="editor-theme-code">TargetType</span>`<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">EnemyMainTarget</span>`
- `<span class="editor-theme-code">Shots</span>`: 8
- `<span class="editor-theme-code">Timeout</span>`: 90000 (90 seconds)
- `<span class="editor-theme-code">MaxRange</span>`: 30
- Mortar prefab: USSR or US artillery placement

The AI will fire 8 rounds on the enemy’s main objective every 90 seconds if within range.