data/token_pools/
A token pool: a limited number of permissions to act against one scope at once, so attackers take turns (at most two melee attackers on a player). A brain’s AcquireToken task asks for a token each tick it waits; requests are granted by score within the pool’s capacity and spacing, and a much better request may steal an unused lease. A director closes pools while its encounter relaxes. Loaded by the server only.
| Registry | manifold-ai:token-pool |
| Files | data/token_pools/*.ron, *.update.ron, *.final.ron |
| Sides | server: only the server loads it |
| Reads | nothing |
| Contract | Population, data stage |
Entry
A record, written TokenPool(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The pool’s key, <mod-id>:<name>. | |
capacity | token-capacity | no | 1 | How many tokens the scope holds at once. |
lease_secs | f32 | no | 4.0 | Seconds an unused lease lasts; a lease whose ability started lasts until its holder releases it. Above 0. |
grant_spacing_secs | f32 | no | 0.4 | Seconds between two grants on one scope. |
steal | Steal | no | enabled, a margin of 250, after 1 s | Stealing. |
on_scope | TokenScope | no | Player | Which entity holds the pool. |
Example
No bundled file declares one yet. From the reference’s test fixture, crates/manifold-server-state/tests/data-reference-fixture/data/token_pools/melee.ron, which the data stage loads in its tests:
TokenPoolDef(id: "dataref-fixture:tokens/melee")
Types
Steal
Stealing: a request may take the lowest unused lease.
A record: Steal(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
enabled | bool | no | true | Whether requests may steal. |
margin | i32 | no | 250 | How much a request’s score must exceed the lease’s. |
min_hold_secs | f32 | no | 1.0 | Seconds a lease is held before it may be stolen. |
TokenScope
Which entity holds a pool.
| Variant | Written | Description |
|---|---|---|
Player | Player | The target the requester attacks, usually a player. |
Group | Group | The requester’s squad: “at most one caster at a time”. |
Encounter | Encounter | The requester’s encounter director, which closes the pool while the encounter relaxes and gates it on a boss’s phase change. |
Value forms used here: token-capacity.