Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

data/spawners/

A spawner placed by content: a region of the world, a set of points, or the ring around every player, kept stocked with creatures from spawn rules, one archetype or a wave table, checking every few seconds and respawning after deaths. It is created once in its space and then saved like any persistent entity. The PlayerAnchored shape is natural spawning, gated by the manifold:do-natural-spawning game rule as well as the ambient one. Loaded by the server only.

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

Entry

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

FieldTypeRequiredDefaultDescription
idstringyesThe spawner’s key, <mod-id>:<path>.
shapeSpawnerShapeyesWhere it spawns.
sourceSpawnSourceyesWhat it spawns. An Archetype or Pool source needs the Encounter or Persistent policy; a PlayerAnchored shape needs a Rules source and the Ambient policy.
policyPersistencePolicynoAmbientHow its creatures persist.
max_aliveu16no4The most creatures alive at once, at least 1; per player for a PlayerAnchored spawner.
cadencedurationno160 ticksHow often it checks, at least 1 tick.
attempts_per_evalu8no4Spawn attempts per check.
respawnRespawnno30 s, catching up 2 at a timeRespawns after deaths.
leashu16 or Nonenohalf the region’s horizontal diagonal; 16 around a singleHow far a creature may stray, in blocks, before it is led back. point; 32 for PlayerAnchored.
enabledboolnotrueWhether it spawns.

Example

From tools/test-mods/guide-creature/data/spawners/west_meadow.ron:

Spawner(
    id: "guide-creature:spawner/west_meadow",
    shape: Region(min: (-72, 48, 28), max: (-28, 84, 72)),
    source: Rules(["guide-creature:spawn/razorback"]),
    policy: Ambient,
    max_alive: 2,
    cadence: "4s",
    respawn: (delay: "60s", catch_up_max: 1),
    leash: Some(24),
)

Types

SpawnerShape

Where a spawner spawns.

VariantWrittenDescription
RegionRegion(min: .., max: ..)A box of blocks, corners inclusive.
PointsPoints([(i32, i32, i32)])Fixed points, the cells creatures stand in, 1 to 64; each holds at most one creature (a boss, an ambush closet).
PlayerAnchoredPlayerAnchoredAround every player in the spawner’s space: the ring between the picked rule’s distance.min and distance.max, each spawn counted against its player.

Region fields:

FieldTypeRequiredDefaultDescription
min(i32, i32, i32)yesOne corner, (x, y, z).
max(i32, i32, i32)yesThe other corner.

SpawnSource

What a spawner spawns.

VariantWrittenDescription
RulesRules([string])Spawn rules by key, at least one, picked by weight. An unknown key fails the data stage (DATA010).
ArchetypeArchetype(string)One archetype by key (a boss at a point). An unknown key fails the data stage (DATA010).
PoolPool(string)A wave table’s archetypes by weight (manifold-ai:wave-table key). An unknown key fails the data stage (DATA010).

PersistencePolicy

How a spawner’s creatures persist.

VariantWrittenDescription
AmbientAmbientNever saved: gone after a restart and spawned afresh; despawn by distance. Counted by the local, region and ambient caps, and gated by the manifold:do-ambient-spawning game rule.
EncounterEncounterNever saved and never despawned by distance; the spawner’s own state is saved, so a Points spawner restores its creatures after a restart. Counted by the space’s encounter ceiling (manifold:encounter-ceiling) and gated by manifold:do-encounter-spawning.
PersistentPersistentSaved and restored exactly. Counted only by the spawner’s max_alive; no game rule gates it.

Respawn

A spawner’s respawns.

A record: Respawn(..) or (..).

FieldTypeRequiredDefaultDescription
delaydurationno"30s"How long after a death before a replacement may spawn.
catch_up_maxu8no2The most spawns one check makes, so a returning player meets a filling area.

Value forms used here: duration.