Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

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.

Registrymanifold-ai:token-pool
Filesdata/token_pools/*.ron, *.update.ron, *.final.ron
Sidesserver: only the server loads it
Readsnothing
ContractPopulation, data stage

Entry

A record, written TokenPool(..); the name before the parentheses is optional.

FieldTypeRequiredDefaultDescription
idstringyesThe pool’s key, <mod-id>:<name>.
capacitytoken-capacityno1How many tokens the scope holds at once.
lease_secsf32no4.0Seconds an unused lease lasts; a lease whose ability started lasts until its holder releases it. Above 0.
grant_spacing_secsf32no0.4Seconds between two grants on one scope.
stealStealnoenabled, a margin of 250, after 1 sStealing.
on_scopeTokenScopenoPlayerWhich 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 (..).

FieldTypeRequiredDefaultDescription
enabledboolnotrueWhether requests may steal.
margini32no250How much a request’s score must exceed the lease’s.
min_hold_secsf32no1.0Seconds a lease is held before it may be stolen.

TokenScope

Which entity holds a pool.

VariantWrittenDescription
PlayerPlayerThe target the requester attacks, usually a player.
GroupGroupThe requester’s squad: “at most one caster at a time”.
EncounterEncounterThe 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.