- Templates — a named, rich
SpawnRequest(40+ optional fields: mesh, color, health, team, combat, AI, role, …) stored in aTemplateRegistryat runtime, then spawned with a position override. - Prefabs — a static, minimal
Prefab(aVec<ComponentData>: position/health/team/name/speed/ damage) registered in code in aPrefabRegistry. Type-safe and serializable.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /template/create | Define a named template (a SpawnRequest) |
POST | /template/spawn | Instantiate a template at a position |
GET | /template/list | List defined templates |
POST | /prefab/spawn | Spawn a registered prefab |
GET | /prefab/list | List registered prefabs |
Example
On the stock headless server these return
ok (create) / not found (spawn) because no
TemplateRegistry is registered. For a richer, data-defined world without templates, a whole world
can be loaded from one scenario document.Status
- ✅
TemplateRegistry(rich runtime templates) andPrefabRegistry(static compiled prefabs) — the types, handlers, and spawn logic are shipped. - 🟡 The reference
headless_serverexample registers neither registry, so the endpoints no-op there. This is a server-wiring gap, not a missing feature.
Template & prefab endpoints
Create, spawn, and list endpoints with schemas.