data/spawners/
A spawner placed by content: a region of the world that keeps a number of creatures alive from its spawn rules, checking every few seconds and respawning after deaths. It is created once in its space and then saved like any persistent entity. 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. | |
policy | PersistencePolicy | no | Ambient | How its creatures persist. Only Ambient is available. |
max_alive | u16 | no | 4 | The most creatures alive at once, at least 1. |
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 | How far a creature may stray, in blocks, before it is led back. |
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. |
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. |
PersistencePolicy
How a spawner’s creatures persist.
| Variant | Written | Description |
|---|---|---|
Ambient | Ambient | Never saved: gone after a restart and spawned afresh; despawn by distance. |
Encounter | Encounter | Not available yet (Talos E2): refused at load. |
Persistent | Persistent | Not available yet (Talos E4): refused at load. |
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.