The shared engine behind garrisons, patrols and ambushes for AI groups
In development · ALiVE 3
ALiVE 3 is in active development. This briefing describes work in progress, and the behaviour it covers is subject to change as testing continues. Check the changelog at the foot of the page for what has moved recently.
On this page
Overview
What Military Command (AI Behavior Engine) does
Military Command has no Eden module of its own that you drag onto the map. Instead it is the behind-the-scenes engine that other parts of ALiVE call on to make AI groups act like a garrison, run a building patrol, ambush a route, hold an insurgent hideout, or run an ambient sea patrol. Callers include the Military and Civilian Placement modules (and their custom-objective versions), the AI commander itself, airbase guards, and roadblocks. When you place a Military Placement or Civilian Placement module and pick garrison-style behaviour, this is the code actually moving the units, assigning building positions, and deciding when to relax back to a calm patrol stance.
Capabilities
What it handles
Garrison command
Garrisons occupied objectives
Sends a group to hold a position, spreads some of the unit into buildings using CBA AI Building Positions where available, and keeps a portion patrolling between buildings at a chosen alert stance and speed.
Building patrol
Walks a beat between buildings
Runs a building-to-building patrol loop with configurable stance (Careless, Safe, Aware, Combat, Stealth) and movement speed (Limited, Normal, Full), so garrisons can look relaxed until they actually spot something. How much of a group patrols comes from Garrisoned Building Patrol on the placement modules, including for garrisons ordered without a module of their own.
Ambush / insurgents / sea patrol
Other AI command behaviours
Also provides an ambush behaviour, where a group plants roadside bombs near a chosen spot and then pulls back, used only when the AI commander is fighting an insurgency; an ambient sea patrol for boats, which Military Placement and Civilian Placement can switch on for harbours and coastal objectives; and an insurgent hideout behaviour that nothing currently uses.
Command router
Keeps track of what each group is doing
A shared command router assigns, tracks, and cleanly hands off these behaviours per AI group, including a background loop for behaviours that need ongoing management (like garrisons) rather than a one-shot script.
Recent work
What's changed lately
A garrison ordered near a player walks to its buildingsThe AI Commander's reserve and the insurgency guard order work on a group that's already on the map, so men used to vanish from where they stood and appear in buildings in front of a player. With a player within 500 m of the group or its objective, the men now walk in. A Zeus, a player's drone or one of the mission's own spawn sources counts as a player here. With nobody near, they're still placed at once. The walk is sturdier too: the men stay on the server until they're in place, and anyone still walking after 2 minutes stops where he is, so one man who can't reach his post no longer holds up the group's next order.
Garrisoned AI hold their posts and fire backUnder fire, garrisoned men used to go prone behind the parapet or climb down and leave. In a test attack on towers and a Cargo HQ, 7 of 8 men left their posts. Now a man on his post is held there: standing when it's raised or inside a building, bunker or trench piece, crouched in the open, and unable to walk off. The hold lifts when his group gets a new order or a player takes him over. It also survives the group moving to a headless client, where the men used to drift 24 to 88 m off their posts.
A building patrol moves with its man on a headless clientWhen the AI distributor hands a garrison group to a headless client, the building patrol used to keep running on the server, and the man stood still at his building. Each patrol round now checks whether its man is still on the same machine. If he's moved, the patrol starts again where he is, with the same buildings and orders.
Garrison patrols no longer pile up waypointsEach building search by a patrolling soldier left a regroup waypoint behind, and one reported mission gathered about 100 an hour. Every search lap now deletes the ones it leaves, and the group's other waypoints stay as they are. Groups the AI Commander keeps re-tasking also no longer collect hundreds of waypoints. Worth a look in Zeus on a long mission.
Garrison Building Patrol set to None means no patrolWith Garrisoned Building Patrol at None, guards used to walk around the objective anyway. They now hold where they're put. Garrisons ordered without a placement module of their own (the commander's reserve, insurgent cell guards, airbase guards, task camp guards, Military Logistics garrisons) read the setting from the Military Placement modules first, then the Civilian ones, instead of quietly patrolling at half strength.
Garrison patrol stance and speed are configurableMilitary Placement, Civilian Placement and their custom-objective versions have Garrison Patrol Behaviour (Careless, Safe, Aware, Combat, Stealth) and Garrison Patrol Speed (Limited, Normal, Full). The defaults are Safe and Limited (walk). Garrison patrols start in that calm stance from the very first leg, and garrisons still react normally the moment they spot an enemy.
Status
Where it stands
Delivered
Garrison, building patrol, ambush, insurgent, and sea patrol behaviours
Garrison and building patrol are working. They're used by the Military and Civilian Placement modules when a garrison-style objective is placed, and also by other callers such as the AI commander, its reserve, airbase guards, and roadblocks, so a garrison can be ordered without a placement module of its own. The sea patrol is used by Military Placement and Civilian Placement, each through its own sea patrol setting. The ambush behaviour only runs when the AI commander is fighting an insurgency, and the insurgent hideout behaviour is not currently used by anything.
Configurable patrol stance and speed
Mission makers can tune how alert and how fast garrison patrols look, through options on the Placement modules rather than on this module directly.
Recent stability fixes
Garrisons now walk in when a player is close, keep their posts under fire, keep patrolling after a headless client takes their group, and no longer pile up waypoints. Earlier script errors during garrison building searches and settings handling are also resolved.
In progress
No direct player-facing controls
Because this is a shared engine rather than a placeable module, mission makers only reach it indirectly through Military Placement and Civilian Placement settings. There is nothing to place or configure here on its own.
Testing
How you can help
There is nothing to place for Military Command itself. To test it, place a Military Placement or Civilian Placement module (or their custom-objective versions) with a garrison-type objective, set the Garrison Patrol Behaviour and Speed options, and observe the AI group: it should hold the objective, occupy some buildings, and patrol between buildings at the chosen stance and speed from the start, reacting normally if it spots an enemy. Check the server log for script errors during setup, which would indicate a regression in the building-search or settings handling. To test the walk-in, order a garrison (the AI Commander's reserve works) with a player within 500 m of the group: the men should walk to their buildings, not appear in them. To test the hold, attack a garrisoned tower or bunker: the men should stay up on their posts and fire back, not go prone or leave.
Spotted a problem? Please report it on the ALiVE issue tracker on GitHub, with the map, rough location and what the units were doing so it can be reproduced.
Changelog
Updates to this page
2026-10-30
Vehicle patrols can be given their own radius and kept inside a Military Placement module's TAOR and out of its blacklist (new settings on that module).
2026-10-29
An idle group on foot with a wander of 500 m or less walks its 4 or 5 wander points straight, instead of getting two dozen pathfinder waypoints zig-zagging across the ground. Vehicles, longer wanders and legs that cross water still use pathfinding.
2026-10-14
Groups the AI Commander keeps re-tasking no longer pile up hundreds of waypoints.
2026-10-10
Garrisoned AI stay on their posts when a headless client takes over their group.
2026-10-10
Garrisoned AI in towers, bunkers and buildings hold their posts and fire back under attack instead of lying down or wandering off.
2026-10-09
A building patrol keeps moving when a headless client takes over its group. Before, the man stood still at his building.
2026-10-05
Boat Sea Patrols only pick points deep enough for the boat, and with pathfinding on, their legs can follow a river.
2026-09-28
A garrison order given with a player within 500 m of the group or its objective now walks the men in instead of putting them straight into their buildings. That covers the AI Commander's reserve and insurgency guard orders.
2026-09-28
Men walking to their posts stay off headless clients until they're there and stop after 2 minutes if they can't reach them. A gun or CBA position one of them is walking to isn't given to another group.
2026-09-28
Garrison groups no longer pile up waypoints as their men search buildings on patrol; one reported mission gathered about 100 an hour. Worth a look in Zeus on a long mission.
2026-09-04
The garrison order now reads Garrisoned Building Patrol off the placement modules when the caller doesn't supply it. Ten orders, the commander's reserve among them, were quietly garrisoning at half strength, and a mission set to None read as half strength in the log.
2026-08-06
Fixed the description of the ambush behaviour (it plants roadside bombs and withdraws) and named where each of the three behaviours actually comes from.
2026-08-06
Corrected the delivered lane: only garrison and building patrol come from the placement modules, sea patrol is Civilian Placement only, ambush belongs to the insurgent commander and the insurgent hideout behaviour is unused.
2026-08-02
Ambient patrol routes now use spaced-out patrol points, with the arrival distance scaled to each leg, so groups loop around their area instead of stacking several points in one spot.