Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

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.

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

Entry

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

FieldTypeRequiredDefaultDescription
idstringyesThe definition’s key, <mod-id>:<name>.
intensityIntensitynono sources, decaying 400 a second while no enemy isHow intensity rises and decays. engaged, peak at 8500, fade below 5000.
pacingPacingnopeak 3 to 5 s, relaxation 30 to 45 sHow long the peak and the relaxation last.
populationPopulationnonone in every phaseHow many creatures each phase keeps alive.
budgetBudgetno40 to start, 1.5 a second, at most 60The spawn budget, in points.
spawnDirectorSpawnnoat least 16 blocks away, behind the party, from spawnersWhere waves spawn. within 64 blocks.
wipeWipeno(when: AllParticipantsDownOrGone)When the encounter is lost.
flowboolnotrueWhether 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 (..).

FieldTypeRequiredDefaultDescription
sourceslist of IntensitySourcenononeWhat raises a participant’s intensity.
decay_per_secu16no400How much it falls per second.
decay_only_whenDecayWhennoNoEngagedEnemiesWhen it falls.
peak_thresholdu16no8500The intensity, the highest participant’s, at which the build-up turns to the peak, at most 10000.
fade_thresholdu16no5000Below this the peak fades into relaxation, at most peak_threshold.

IntensitySource

One source of intensity.

A record: IntensitySource(..) or (..).

FieldTypeRequiredDefaultDescription
eventIntensityEventyesWhat happened.
gainGainyesHow much it adds.

IntensityEvent

What raises a participant’s intensity.

VariantWrittenDescription
DamageTakenDamageTakenThe participant took damage.
DownedDownedThe participant went down.
EnemyDiedNearEnemyDiedNear(f32)One of the encounter’s creatures died within this many blocks.
TaggedTagged(string)The director’s Event input with this tag.

Gain

How much an event adds, in ten-thousandths.

VariantWrittenDescription
FixedFixed(u32)A fixed amount.
PerFractionOfMaxHealthPerFractionOfMaxHealth(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.

VariantWrittenDescription
NoEngagedEnemiesNoEngagedEnemiesWhile none of the encounter’s creatures is engaged.
AlwaysAlwaysAlways.

Pacing

How long the peak and the relaxation last.

A record: Pacing(..) or (..).

FieldTypeRequiredDefaultDescription
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_progressstring or NonenononeA tag whose Event input ends the relaxation early (the party reached the next room).

Population

Each phase’s population.

A record: Population(..) or (..).

FieldTypeRequiredDefaultDescription
build_upPhase or NonenononeWhile intensity builds.
peakPhase or NonenononeWhile the peak is sustained.
fadePhase or NonenononeWhile the peak fades.
relaxPhase or NonenononeWhile the encounter relaxes.

Phase

One phase’s population.

A record: Phase(..) or (..).

FieldTypeRequiredDefaultDescription
target_aliveTargetAlivenoFixed(0)How many creatures it keeps alive; also written NumberProvider(..) around the value.
wave_tablestring or NonenononeThe wave table it spawns from (manifold-ai:wave-table key). An unknown key fails the data stage (DATA010).
close_poolslist of stringnononeToken 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.

VariantWrittenDescription
FixedFixed(u16)This many.
PerParticipantPerParticipant(u16)This many per living participant.

Budget

The spawn budget, in points: each spawn costs its wave entry’s cost.

A record: Budget(..) or (..).

FieldTypeRequiredDefaultDescription
initialf32no40.0Points when the director starts.
refill_per_secf32no1.5Points regained per second.
maxf32no60.0The most points it holds, at least initial.

DirectorSpawn

Where a director’s waves spawn.

A record: DirectorSpawn(..) or (..).

FieldTypeRequiredDefaultDescription
min_distancef32no16.0At least this many blocks from every participant.
never_visibleboolnotrueSpawns stay out of every player’s sight; must stay true.
prefer_behindboolnotruePrefer the spawner furthest behind the party’s direction of travel.
active_radiusf32no64.0Child spawners this near a participant receive waves, above 0.

Wipe

When an encounter is lost.

A record: Wipe(..) or (..).

FieldTypeRequiredDefaultDescription
whenWipeWhennoAllParticipantsDownOrGoneThe condition.

WipeWhen

A wipe condition.

VariantWrittenDescription
AllParticipantsDownOrGoneAllParticipantsDownOrGoneEvery participant is down or has left.
NeverNeverNever.