data/squads/
A squad definition: how a group of creatures or party members coordinates. A squad shares what its members know, moves between named styles when its conditions hold (calm, aggressive, routed), sets each style’s AI style on every member, grants roles, and barks cues on group events. A spawn rule’s herd forms one; a party’s fixed role slots make one. Loaded by the server only.
| Registry | manifold-ai:squad |
| Files | data/squads/*.ron, *.update.ron, *.final.ron |
| Sides | server: only the server loads it |
| Reads | nothing |
| Contract | Population, data stage |
Entry
A record, written Squad(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The squad’s key, <mod-id>:<name>. | |
styles | map of string to SquadStyle | yes | Its styles by name, 1 to 32: {"calm": (roles: {..}, style: ..)}. | |
initial_style | string or None | no | the first style written | The style a new squad starts in. |
transitions | list of SquadTransition | no | none | Style changes, the first whose condition holds from the current style taken at each 2 Hz pass. |
fixed_slots | map of string to u16 | no | none | Roles the squad fills itself, from members without one, healthiest first (a party’s tank and healer): {"<role>": count}. An unknown role fails the data stage (DATA010). |
barks | map of string to string | no | none | Cues (manifold:cue keys) by group event: style.<name>, role.<role key>, member.died, target.lost. An unknown cue fails the data stage (DATA010). |
bark_cooldown_secs | f32 | no | 3.0 | Seconds between two barks of the squad. |
dissolve_when_empty | bool | no | true | Whether the squad entity is removed when its last member is gone. |
Example
No bundled file declares one yet. From the reference’s test fixture, crates/manifold-server-state/tests/data-reference-fixture/data/squads/pack.ron, which the data stage loads in its tests:
SquadDef(id: "dataref-fixture:squad/pack", styles: {"calm": ()})
Types
SquadStyle
One squad style.
A record: SquadStyle(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
roles | map of string to u16 | no | none | The most holders of each role (manifold-ai:role key) under this style, at most 8 roles: {"<role>": 1}. An unknown role fails the data stage (DATA010). |
style | string or None | no | None | The AI style (manifold-ai:style key) set on every member while the squad is in this style; None clears it. |
SquadTransition
A squad’s style change.
A record: SquadTransition(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
from | string | yes | The style it leaves, by name. | |
to | string | yes | The style it enters, by name. | |
when | condition | yes | A condition in the squad context over the squad’s atoms (manifold:group_alert, manifold:casualty_fraction, manifold:time_since_combat, manifold:members_with_role). |
Value forms used here: condition.