# Formations

Every move order is a **formation order**. When you call `SetAgentsTarget(members, point)`,
the simulation lays out one **slot** per member, arranged behind the destination and
deepening toward where the group is coming from, then walks each agent to its own slot. This
is what makes a selection move as a coherent block instead of a single-file line or a pile.

A single-unit order (`SetAgentTarget`) is just a formation of one - it walks straight to the
point.

## Shapes

Set the **Formation → Shape** property:

=== Blob
A tight, round, hex-packed clump. The default - compact and natural-looking for most
groups.

![Blob formation](../assets/concepts/formation-blob.png)
===

=== Box
A roughly square block. Good for ordered, drilled-looking formations.

![Box formation](../assets/concepts/formation-box.png)
===

=== Wedge
A solid triangle with its apex on the destination. Reads as an arrowhead / charge
formation.

![Wedge formation](../assets/concepts/formation-wedge.png)
===

## Tuning

| Property | What it does |
|---|---|
| **Shape** (`FormationShape`) | `Blob`, `Box`, or `Wedge` (see above). |
| **Settle Radius** (`SettleRadius`) | How close to its slot an agent must be to count as **settled** (arrived). Also the steering ease-in radius, so arrivals smooth out. |
| **Slot Spacing** (`SlotSpacing`) | Distance between slots, in **agent diameters**. `1.1` packs units almost shoulder-to-shoulder; higher spreads them out. |

## Settling

When an agent reaches its slot (within `SettleRadius`) its **settle latch** flips on and
[`OnAgentsReachedGoal`](./05-events.md) fires once for it. You can read the latched state at
any time:

```cpp
TArray<bool> Settled = Crowd->GetAgentSettled({}); // parallel to GetAgentPositions
```

Settled agents still **step aside** for passers-by (governed by `Settle Push`, see
[Avoidance](./03-avoidance.md)) and then drift back, so a standing formation stays tidy as
others move through it.

::: tip
Issuing a new `SetAgentsTarget` for agents that already have an unfinished order replaces it
and fires [`OnAgentsOrdersCanceled`](./05-events.md) for them. This is exactly what you want
for re-pathing stuck units or redirecting a group mid-march.
:::

## Reading the formation

| Getter | Returns |
|---|---|
| `GetAgentTargets` | Each agent's individual **slot** position. |
| `GetAgentNavGoals` | The **shared formation anchor** the group is routing toward. |
| `GetAgentSettled` | Per-agent latched arrival state. |

All are parallel to `GetAgentPositions` and accept the same optional index mask.
