Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

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.

Registrymanifold-ai:squad
Filesdata/squads/*.ron, *.update.ron, *.final.ron
Sidesserver: only the server loads it
Readsnothing
ContractPopulation, data stage

Entry

A record, written Squad(..); the name before the parentheses is optional.

FieldTypeRequiredDefaultDescription
idstringyesThe squad’s key, <mod-id>:<name>.
stylesmap of string to SquadStyleyesIts styles by name, 1 to 32: {"calm": (roles: {..}, style: ..)}.
initial_stylestring or Nonenothe first style writtenThe style a new squad starts in.
transitionslist of SquadTransitionnononeStyle changes, the first whose condition holds from the current style taken at each 2 Hz pass.
fixed_slotsmap of string to u16nononeRoles 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).
barksmap of string to stringnononeCues (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_secsf32no3.0Seconds between two barks of the squad.
dissolve_when_emptyboolnotrueWhether 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 (..).

FieldTypeRequiredDefaultDescription
rolesmap of string to u16nononeThe 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).
stylestring or NonenoNoneThe 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 (..).

FieldTypeRequiredDefaultDescription
fromstringyesThe style it leaves, by name.
tostringyesThe style it enters, by name.
whenconditionyesA 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.