Mods — the equippable behaviors bots fire from constellation stars
settled decided — build to this page
A mod is a unit of behavior a bot can own. Installed in a slot at a star of the constellation, it does nothing until a thread’s walk arrives there and evaluates it. Everything a bot can do beyond the universal basics enters the game as a mod; when it happens is the thread’s business, so a mod supplies capability and never initiative. Each mod declares its power colors from the four that bind bots, mods, and research into one color economy, and those colors are its identity everywhere it appears: its pips on the stable’s declared-mod tiles, its rim on a star, the palette of the effect it throws.
What each color means lives in power-color-mechanics.md. Where a mod sits,
and what it looks like sitting there, is a star of a constellation: each star
declares the mods it may hold, and the player installs them in its slots
(star-slots).
The contract. A mod answers three calls: combat_start() as each
encounter opens, fire() when a thread fires it at its star, and release() when the holding thread resets. It acts by listing requests, which its station
carries out, and never mutates game state itself. This keeps every mod
station-portable and every outcome resolvable in one ordered place.
Self-description. A mod describes itself; systems read the description.
What firing it is worth to a plan is measured, never declared: the plan plays
the fire through its station’s rules on a copy of the board, and payoff,
denial and threat are read off what changed (MSR-001; the model is thread-decision-model.md). A mod that lists
targets declares a board template and a value, which rank its targets
so the search plays the likely best first; the ranking is never part of a
score (PSR-009, PSR-010). Capability tags say what kind of work it does, so
consumers find producers by capability rather than by name. engage_reach states the mod’s own positional need instead of leaving the
system to guess, and consumes_item names the supply it burns — what the
shop’s automatic wants are built from.
Held items. A held item enhances; it never gates. Most consumers are
spent-if-held: the mod fires with or without the item, the item is withdrawn
on fire whether or not the enhanced blow connects. A plan plays the fire
against the bin as it stands, so a stocked bin is worth the enhanced act and a
dry one the bare act, and a banked item can never buy a fire that would
accomplish nothing. Spends a Spare Cable from the bin to mend 5 stamina onto one hurt
adjacent ally.
Basics. Move, attack, shove, and heal are the floor; torch fires a turret beside its bot, and interact opens a shut door beside one of the player’s bots or a door on a rival’s patrol route, or throws the switch a bot’s visit names next (MTV-004). They are colorless and available at every open star a thread reaches, a mod installed or not, so a thread never has to pass for lack of an action. They are never held, never declared at a star, and firing one in a clashing bot’s thread turn spends the same single thread energy as firing any mod (THD-019, MDF-011). An idle thread turn’s move, heal or interact spends none (idle and clash, IDL-003). They exist so a bot always has a legal turn; a kit doing frequent basic attacks is a kit whose conditions the level isn’t feeding.
Fallbacks. A conditional act that misses its state pays the setup it skipped. A mod whose worth waits on a state — a hold that needs a rattled body, a spender that needs a pile — spends the turn on nothing wherever that state is missing, and a kit of them (slinky’s control line is the measured case) passes turns it was equipped to fight. The stress ladder’s fizzle is the shape the answer takes: a control the target’s pile refuses lands one stress instead, so the refused cast buys the setup the next one holds by. A fallback is never a consolation payout. It is the missing setup, so it is worth what the stress changes, below the act it stood in for; a situational mod with no such fallback is worth nothing where its state is missing.
Access. A player bot is built with only its player’s researched mods
(researched_mods), so no other mod exists for it; NPCs draw from every
mod.
The designed set. The mods designed for play are the ones a starter tree
places at its stars (starter-trees): fifty-four, each made
for its chassis, the thread that pilots it and the shape of its
constellation, and the only mods whose synergies are designed. Every other
mod in the catalog is a template: implemented and tested, homed at no star,
reachable by no player bot, kept for a future tree to draw on and reshape.
Per-mod behavior is specified as requirements in the mods spec files, each
carrying the board it is judged on — requirement and fixture fused — staged
through ArenaSandbox. The requirement text is what the behavior is: it
states the rule and names the levers it turns, never their values, so
retuning a magnitude is not a spec change.
Reach. A requirement states a reach as the number it is, because reach is shape: how far a mod acts is what the mod is. Briar-patch that stops at melee and discharge that stops at two tiles are different mods, not the same mod tuned twice. Everything a mod hits for is a lever and is named rather than restated. A spec pass that finds a bare distance in a requirement should leave it there.
The declaration. A mod is a declaration of requests (#445). The class
lists its Roots a target in sight, adding 1 stress. This bot may also
move 1. Blinks to any free tile in sight. ZAPPIES then deals 3 damage to
an adjacent target and detonates its charge. Adds 1 corrode on up to 3 targets in sight. Adds 1 stress to each of three targets in sight.requests, each a request of one of the arena’s kinds
(station/arena/actions/) carrying its declared numbers and its optional payload-flavor hint, with the target left open. Firing it raises them in
order; a mod writes its own fire only to fill in a number or a fact that
depends on the fire — an item boost spent from the bin, the loss record
revenge returns — from the fire’s facts. Each kind lists the targets it can
act on in one function, which both the plan and the handler read (REQ-004), and
picks its bodies or tiles as the fire resolves, never the mod. A mod may aim
its move apart from its action (REQ-007): it marks the move request apart,
the plan’s target pairs the action’s target with the move’s tile
(ArenaTarget.move), and a request listed after the move picks its bodies
from the tile the move goes to. picks, the rules list every set of that many bodies
its kind accepts, each led by one body with the rest in ArenaTarget.also,
and the plan ranks and measures each set, so every body it aims is the
plan’s pick. boards:), each board generating a test that plays the fire on a
staged board and checks the sign of the payoff, denial or threat it
measures against the same board where the bot passes (MSR-002). Authoring
happens at whichever of two first-class tiers the novelty needs: reuse a request kind with new numbers, or invent a kind — one module in station/arena/actions/ holding its dataclass, its handler and its log
entries. A new mechanic joins the vocabulary, never bypasses it.
Levers. Balance magnitudes are levers (MDF-004 to MDF-007, MDF-009,
MDF-010, balance-lab §2). Each mod is one module named
after it in its station’s mods/: a frozen, strict pydantic dataclass whose
fields are its levers, each declared with Lever — its bounds — and typed int or float. Building a station’s mods reads each
lever’s value out of data/balance/mods.yaml, one file keyed by mod name,
validates declaration and data against each other loudly, and refuses a value
out of range or of the wrong type. A mod with levers builds its requests from
its own fields, so its class carries none; a magnitude the mod’s behavior turns
on is a lever even when no request carries it, and a resolution site outside
the mod reads it off the built mod (remorse’s seeded stress). Structure
stays code: colors, tags, targeting shape (melee, reach, distance, charge_distance), the basics’ floor numbers (the basic
attack’s damage, heal’s heal_amount), which request kinds compose. A mod
whose numbers are all structural declares no lever and keeps a class-level
requests tuple — rock-form’s uncapped melee wall and deflector’s attack class
are shapes, not levers. The player-facing catalog_desc quotes magnitudes as {placeholder}s rendered from the mod’s own levers (MDF-010), so tooltips move
with tuning and can never quote a stale number. It says what the mod targets,
what it does and its numbers in one or two plain sentences, at most 200
characters with its levers filled (MDF-014); edge cases, other mods and design
notes stay in its requirements and its design page.
No pass bonuses. No mod pays for another mod fired earlier in the pass:
a combo comes from the states mods leave on the board and on their bots,
which every later fire reads (starter-tree-rules.md rule 24).
The wire. The engine declares what an act is; every rendering choice is AdminUI’s. The wire carries the semantics of each act. Per arena log entry that is:
- the mechanic — the event type (attack, push, drain, fracture, corrode, heal, stress, stun, …);
- the geometry —
source_location,target_locations, melee-vs-ranged, shape,anchor,trail,collided— from which targeting and delivery derive. An area blow states itsanchor, the tile its ring went off on (MVW-007): a mortar shell is bombed on any tile, so the ring is drawn where the damage landed rather than at the caster. Every ring declares it, the self-centered ones included, and it is null on every other blow; - the mod’s power identity — its primary power, stamped as
data.poweron every entry its fire writes (data.modnames the mod) — the renderer’s palette.
From those three facts the renderer composes a primitive: a melee strike sweeps, a ranged strike rides a ray, an area strike blasts, a push erupts a geyser, a pull reels a hook. Nothing below is a mockup — each figure plays canned wire events through the event modules a live battle draws with.
Held state announces itself as ARENA_BUFF carrying the buff type, the
holder’s shares of it after the landing and the turns the landing lasts
(MVW-003), the moment a badge is stamped
(stress, embolden, vulnerable, corrode, taunt, guard). None
of these prescribe a look: AdminUI owns primitive, palette, glyph, and
cadence, and can re-skin any act without an engine change.
data.visual. The hint is payload flavor, never a rendering directive.
It rides each arena entry from the request that wrote it (a mod listing
several flavors each independently, MVW-001) and each MOD_EVAL from the cast
(MVW-002). It names a distinctive payload variant the mechanic alone cannot
— a chain, a clamp, a whiteout — which the renderer maps and may remap or
ignore. It is optional and rare: most acts carry none, and the renderer
composes their look from mechanic + geometry + power color. The hint lives on
the request (each request’s flavor=), never a second copy on the mod class,
and the event’s own kind wins where the flavor belongs to the event (stress
static, overload burst, cleanse and shield rings, mend/decay ticks, the
arrivals a spawned or placed body makes). Color rides data.power and every
primitive derives from the mechanic, so data.visual carries only the
event-semantic set plus the variants the mechanic cannot name (chain, payoff, clamp, whip, punch-barrier).
A chained arc also carries chained_from, the position it leapt from
(EVP-033), so the renderer draws the leap from the earlier hit.
Stances
A stance mod’s fire takes a stance: a mode its bot holds until it takes another, apart from its buffs, declared in up to three clauses. A bot holds at most one. What a stance is, its grammar, the roster and how a thread values one are stances‘s.
How to add a mod
Design first: a new mod answers the seven angles of the authoring
doctrine (engine/bbsb_engine/station/AUTHORING.md) before any file below is
touched. The four tier-1 roots — barrier-punch, nanite-swarm, interrogate,
electric-spear — are the worked examples. Scaffold the starting files with just scaffold-mod <station> <name> --color <color>, then fill them in:
- Choose its mechanics. The mechanics it carries
(
power-color-mechanics.md) name the requests it needs. - Pick a request kind for each mechanic. Reuse an existing kind with
new numbers (
BasicAttack,SelfHeal,SelfBuff,Stress,Spear, …) or invent one instation/arena/actions/. A kind that lists targets registers them ondispatch.targetsand declares its board template and value (station/arena/board/board_template.py,station/arena/board/value.py; PSR-010). A shop mod’s kinds arestation/shop/actions/’s (Travel,TakePips,JamDock,Solder,Snatch,Divert); a new one registerscarry_outfor the live generator board andplayfor a plan’s. - Write its module,
station/<station>/mods/<name>.py(a dash becomes an underscore), and add its import and its entry inMODSto that folder’s__init__.py. The class carries the catalog metadata,power_sources(its power identity — the renderer’s palette), the positional need (melee/reach/engage_reach, MFS-004),consumes_itemand theitemfield the build fills with it (MFS-005), capabilitytags(MFS-003), its levers as fields declared withLever(curated magnitudes with their bounds — MDF-004), and its requests in a cachedrequestsproperty built from those fields (MDF-006). Write afireonly for a number or a fact that depends on the fire — it reads the fire’s facts (Firing: the trail, the bin, the board, the aim, the bot’s loss record) and answers the requests with it filled in (MDF-001, REQ-005), leaving every body or tile to its kind’s pick — and no worth: what a fire is worth is measured from the rules (MSR-001). A shop mod writesfire(target), the requests it lists at the target its plan names, and declares what a plan’s board reads of it: itscandidatesand thevaluethey rank by (station/shop/mods/shop_mod.py, SEL-008). Before it is built, it is worked throughstation/AUTHORING.md§ Shop mods. - Flavor the look only if the mechanic can’t (usually skip). The renderer
composes the look from the mechanic + geometry + your
power_sources, so most mods need noflavor=at all. Set aflavor=hint on a request only for a payload variant the mechanic can’t name (a chain, a clamp); when you do, add the token to@bbsb/stage’sderive.tsflavor set (theKEPTmap for an event-semantic look, or the mechanic’s own primitive for a variant likechain/payoff) and the engine carries it per-event (MVW-001). Event-semantic flavors (stress, overload, …) come from the event itself. - Place it in the data. Add an entry named for the mod to
data/balance/mods.yaml, in name order: itspower_sourcesfirst — the same set the class declares, every color it draws from, in no particular order, since the set is the mod’s color and a two-color mod has no single home — then a value for every lever. The build refuses an unvalued lever and an undeclared value alike (MDF-005), and an entry filed under a set that is not the class’s (MDF-012). A player mod gets a research node only under a starter tree’s column indata/research/surface.yaml, behind the mod above it, and a place on the constellation star that declares it; an opponent’s mod goes in the loadout that should carry it. If it consumes a supply item, make sure that item exists. - Author the spec entry in
test/mods/<color>_spec.yaml(a shop mod’s intest/shop/shop_mods_spec.yaml): a behavior named for the mod — a one-linedescription:and its payoff boards underboards:, at least one where firing it is worth something and one where it is worth nothing (MSR-002, MSR-003). Add arequirements:entry only for behavior its requests and payoff boards cannot show: emergent arena resolution (spawns, over-time ticks, multi-body or target selection, charge/arc geometry). A mod’s requests and contract are already pinned by its request kinds, its payoff boards andmods_spec.yaml— do not re-assert them per mod. - Verify.
just test(request, payoff board, contract, visual-wire, integration) and read the decision withpython -m bbsb_engine.test.mods.decision_preview --loadout <name>. The mod ships its starting values as defaults; authors never run the Balance Lab or ask it for anything (engine/bbsb_engine/station/AUTHORING.md§3).
File the work with the New mod issue template
(.github/ISSUE_TEMPLATE/new-mod.yml), which walks these same steps.
Derived specs — the mod contract is engine/bbsb_engine/test/mods/mods_spec.yaml · MOD mod-contract · MFS mod-self-description
· MBA basics-floor · MDF mod-definition-format · MVW mod-visual-wire
· MSR payoff-boards. Equipping is EQP in bot/bot_spec.yaml. The basics
read IDL-003 and MTV-004 in combat/combat_spec.yaml.
Each entry type’s module in adminui/src/lib/events/ composes its look from @bbsb/stage’s Effect descriptors (plus derive.ts’ small KEPT flavor map); color comes from data.power. Each mod’s own behavior lives in the per-color test/mods/{basic,black,blue,pink,yellow}_spec.yaml — one behavior per mod on
this same format, its payoff boards measuring what a fire changes through the
live rules (MSR-002), and a requirements: entry only where emergent
behavior escapes its requests and payoff boards.
Terms
| Term | Meaning |
|---|---|
| live mod | A mod the research tree offers or a bot in a qualifier-circuit level carries. |
| reference mod | A mod that is not live. Its code is kept to port when it is needed again, and no new requirement or test is written for it. |