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.
| Registry | manifold-ai:spawner |
| Files | data/spawners/*.ron, *.update.ron, *.final.ron |
| Sides | server: only the server loads it |
| Reads | nothing |
| Contract | Population, data stage |
Entry
A record, written Spawner(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The spawner’s key, <mod-id>:<path>. | |
shape | SpawnerShape | yes | Where it spawns. | |
source | SpawnSource | yes | What it spawns. An Archetype or Pool source needs the Encounter or Persistent policy; a PlayerAnchored shape needs a Rules source and the Ambient policy. | |
policy | PersistencePolicy | no | Ambient | How its creatures persist. |
max_alive | u16 | no | 4 | The most creatures alive at once, at least 1; per player for a PlayerAnchored spawner. |
cadence | duration | no | 160 ticks | How often it checks, at least 1 tick. |
attempts_per_eval | u8 | no | 4 | Spawn attempts per check. |
respawn | Respawn | no | 30 s, catching up 2 at a time | Respawns after deaths. |
leash | u16 or None | no | half the region’s horizontal diagonal; 16 around a single | How far a creature may stray, in blocks, before it is led back. point; 32 for PlayerAnchored. |
enabled | bool | no | true | Whether 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.
| Variant | Written | Description |
|---|---|---|
Region | Region(min: .., max: ..) | A box of blocks, corners inclusive. |
Points | Points([(i32, i32, i32)]) | Fixed points, the cells creatures stand in, 1 to 64; each holds at most one creature (a boss, an ambush closet). |
PlayerAnchored | PlayerAnchored | Around 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:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
min | (i32, i32, i32) | yes | One corner, (x, y, z). | |
max | (i32, i32, i32) | yes | The other corner. |
SpawnSource
What a spawner spawns.
| Variant | Written | Description |
|---|---|---|
Rules | Rules([string]) | Spawn rules by key, at least one, picked by weight. An unknown key fails the data stage (DATA010). |
Archetype | Archetype(string) | One archetype by key (a boss at a point). An unknown key fails the data stage (DATA010). |
Pool | Pool(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.
| Variant | Written | Description |
|---|---|---|
Ambient | Ambient | Never 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. |
Encounter | Encounter | Never 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. |
Persistent | Persistent | Saved 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 (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
delay | duration | no | "30s" | How long after a death before a replacement may spawn. |
catch_up_max | u8 | no | 2 | The most spawns one check makes, so a returning player meets a filling area. |
Value forms used here: duration.