data/encounter_templates/
An encounter template: named entities placed relative to an origin and the I/O links between them, such as a room whose trigger volume fills a spawner whose last death opens a door. Every link is checked when the template loads: its ports exist on the two entities’ components and its value converts. Placed with /ai encounter spawn or from code. Loaded by the server only.
| Registry | manifold-ai:encounter-template |
| Files | data/encounter_templates/*.ron, *.update.ron, *.final.ron |
| Sides | server: only the server loads it |
| Reads | manifold:archetype, manifold-ai:io-signature |
| Contract | Population, data stage |
Entry
A record, written EncounterTemplate(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The template’s key, <mod-id>:<name>. | |
entities | map of string to TemplateEntity | yes | The entities by name. | |
links | list of io-link | no | none | The links between them. |
Example
No bundled file declares one yet. From the reference’s test fixture, crates/manifold-server-state/tests/data-reference-fixture/data/encounter_templates/relay.ron, which the data stage loads in its tests:
EncounterTemplate(id: "dataref-fixture:enc/relay", entities: {"relay": (archetype: "manifold:logic/relay")})
Types
TemplateEntity
An entity of a template.
A record: TemplateEntity(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
archetype | string | yes | Its archetype (manifold:archetype key); E’s logic archetypes are manifold:logic/relay, counter, timer, trigger_volume, branch and spawner_points. An unknown key fails the data stage (DATA010). | |
at | (f32, f32, f32) | no | (0, 0, 0) | Its position from the template’s origin, (x, y, z). |
yaw | f32 | no | 0 | Its yaw, in degrees. |
parent | string or None | no | none | Another entity of the template this one is ChildOf (a director’s spawners). |
member_of | string or None | no | none | Another entity of the template this one is MemberOf. |
extra | map of string to component-value | no | none | Values for E’s logic components by component key, which patch the archetype’s or add them: manifold-ai:spawner, counter, timer, trigger-volume, branch, logic-relay, stat-watch and director ((def: "<director def>")). A spawner’s shape is template-local, and it defaults to the Encounter policy, one creature, disabled, and one point at its entity’s cell. |
Value forms used here: component-value, io-link.