data/directors/
A director definition: the pacing of an encounter, after Left 4 Dead’s AI Director. The director tracks each participant’s intensity, moves through build-up, peak, fade and relaxation, keeps each phase’s population alive from wave tables through its child spawners under a spawn budget, and detects the wipe. An entity becomes a director through the manifold-ai:director component, (def: "<key>"), and is driven through its I/O inputs (Start, SetPhase, TriggerWave, Event, …). Intensities are ten-thousandths of the maximum. Loaded by the server only.
| Registry | manifold-ai:director-def |
| Files | data/directors/*.ron, *.update.ron, *.final.ron |
| Sides | server: only the server loads it |
| Reads | nothing |
| Contract | Population, data stage |
Entry
A record, written Director(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The definition’s key, <mod-id>:<name>. | |
intensity | Intensity | no | no sources, decaying 400 a second while no enemy is | How intensity rises and decays. engaged, peak at 8500, fade below 5000. |
pacing | Pacing | no | peak 3 to 5 s, relaxation 30 to 45 s | How long the peak and the relaxation last. |
population | Population | no | none in every phase | How many creatures each phase keeps alive. |
budget | Budget | no | 40 to start, 1.5 a second, at most 60 | The spawn budget, in points. |
spawn | DirectorSpawn | no | at least 16 blocks away, behind the party, from spawners | Where waves spawn. within 64 blocks. |
wipe | Wipe | no | (when: AllParticipantsDownOrGone) | When the encounter is lost. |
flow | bool | no | true | Whether a wave’s creatures share one flow field toward the party. |
Example
No bundled file declares one yet. From the reference’s test fixture, crates/manifold-server-state/tests/data-reference-fixture/data/directors/crypt.ron, which the data stage loads in its tests:
DirectorDef(id: "dataref-fixture:director/crypt")
Types
Intensity
How intensity rises and decays.
A record: Intensity(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
sources | list of IntensitySource | no | none | What raises a participant’s intensity. |
decay_per_sec | u16 | no | 400 | How much it falls per second. |
decay_only_when | DecayWhen | no | NoEngagedEnemies | When it falls. |
peak_threshold | u16 | no | 8500 | The intensity, the highest participant’s, at which the build-up turns to the peak, at most 10000. |
fade_threshold | u16 | no | 5000 | Below this the peak fades into relaxation, at most peak_threshold. |
IntensitySource
One source of intensity.
A record: IntensitySource(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
event | IntensityEvent | yes | What happened. | |
gain | Gain | yes | How much it adds. |
IntensityEvent
What raises a participant’s intensity.
| Variant | Written | Description |
|---|---|---|
DamageTaken | DamageTaken | The participant took damage. |
Downed | Downed | The participant went down. |
EnemyDiedNear | EnemyDiedNear(f32) | One of the encounter’s creatures died within this many blocks. |
Tagged | Tagged(string) | The director’s Event input with this tag. |
Gain
How much an event adds, in ten-thousandths.
| Variant | Written | Description |
|---|---|---|
Fixed | Fixed(u32) | A fixed amount. |
PerFractionOfMaxHealth | PerFractionOfMaxHealth(u32) | Scaled by the damage over the participant’s manifold:max_health: damage equal to its maximum health adds this much. |
DecayWhen
When intensity decays.
| Variant | Written | Description |
|---|---|---|
NoEngagedEnemies | NoEngagedEnemies | While none of the encounter’s creatures is engaged. |
Always | Always | Always. |
Pacing
How long the peak and the relaxation last.
A record: Pacing(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
sustain_peak_secs | (f32, f32) | no | (3.0, 5.0) | Seconds the peak is sustained, (min, max), drawn each time. |
relax_secs | (f32, f32) | no | (30.0, 45.0) | Seconds of relaxation, (min, max), drawn each time. |
relax_ends_on_progress | string or None | no | none | A tag whose Event input ends the relaxation early (the party reached the next room). |
Population
Each phase’s population.
A record: Population(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
build_up | Phase or None | no | none | While intensity builds. |
peak | Phase or None | no | none | While the peak is sustained. |
fade | Phase or None | no | none | While the peak fades. |
relax | Phase or None | no | none | While the encounter relaxes. |
Phase
One phase’s population.
A record: Phase(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
target_alive | TargetAlive | no | Fixed(0) | How many creatures it keeps alive; also written NumberProvider(..) around the value. |
wave_table | string or None | no | none | The wave table it spawns from (manifold-ai:wave-table key). An unknown key fails the data stage (DATA010). |
close_pools | list of string | no | none | Token pools (manifold-ai:token-pool keys) closed while the phase lasts, a relaxation’s respite. An unknown key fails the data stage (DATA010). |
TargetAlive
How many creatures a phase keeps alive.
| Variant | Written | Description |
|---|---|---|
Fixed | Fixed(u16) | This many. |
PerParticipant | PerParticipant(u16) | This many per living participant. |
Budget
The spawn budget, in points: each spawn costs its wave entry’s cost.
A record: Budget(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
initial | f32 | no | 40.0 | Points when the director starts. |
refill_per_sec | f32 | no | 1.5 | Points regained per second. |
max | f32 | no | 60.0 | The most points it holds, at least initial. |
DirectorSpawn
Where a director’s waves spawn.
A record: DirectorSpawn(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
min_distance | f32 | no | 16.0 | At least this many blocks from every participant. |
never_visible | bool | no | true | Spawns stay out of every player’s sight; must stay true. |
prefer_behind | bool | no | true | Prefer the spawner furthest behind the party’s direction of travel. |
active_radius | f32 | no | 64.0 | Child spawners this near a participant receive waves, above 0. |
Wipe
When an encounter is lost.
A record: Wipe(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
when | WipeWhen | no | AllParticipantsDownOrGone | The condition. |
WipeWhen
A wipe condition.
| Variant | Written | Description |
|---|---|---|
AllParticipantsDownOrGone | AllParticipantsDownOrGone | Every participant is down or has left. |
Never | Never | Never. |