Game Manual

Build a Better Bot — design pages, rendered from the repo docs.

Level Scheduling — choosing and running encounters

settled decided — build to this page

Level scheduling is the loop that decides which levels the player may attempt, runs the chosen one, and returns to selection when it is over. The game is played one encounter at a time: between encounters the player is at level select and picks a level to attempt next from a short list. Choosing one sends a bot into the arena to fight it; when the fight ends, the bot returns and a new list is offered.

Two things share that loop. The core is the same everywhere: eligibility, the record of what was played and won, the offer’s lifecycle, and the single path every ending takes. A mode answers one question over it: which levels the offer holds right now. The game ships three. Two are the zone’s own, chosen by whether it declares a schedule; the third, the Sixteen’s bracket run, is entered over the zone when its gate opens and composes matches nobody authored.

The offer

Each roll of the list holds at most three levels from the player’s current zone, with no repeats. A level is a candidate only once the player has met its prerequisites: any levels it requires completed, any bots it requires owned, any scenes it requires played, and enough levels won, open stars, unlocked threads, researched mods, unspent thread tokens and bracket runs entered. Five gates ask the other way, for a state not yet reached — a building still shut, a bot still unowned, a thread still dormant, a node still unpowered, a glitch still unowned — which is how a hand-over names a change before it is made rather than after. A gate that waits on the story may wait only on story every player is shown: a level naming a voice-gated scene, or a bot only voice-gated scenes recruit, is refused at load (../story-format.md § The voices: gate). In a zone that runs a schedule a fixture is also held back until its own group opens (below). The mode then says which candidates the list holds. If nothing qualifies, the offer is empty, and the engine treats that as a normal state. A scene played in town that meets the last prerequisite of a level whose scenes name it rolls the offer again, so that level is offered at once; a scene that brings no level leaves the offer as rolled (LOF-020).

The free mode is the plain composition, and what a zone with no schedule gets for good. Levels the player has not yet beaten come first; a cleared level is included only to fill the list when fewer than three unbeaten ones qualify. A cleared tutorial level leaves the rotation permanently: its first win is a one-time gate, so it never backfills.

Sites and waiting levels

Every level is fought at a site: a building other than log, or a road site, a place on the roads with no building and no surface — your gate (front_gate) or one of the four roadblocks. A level’s site is arena when it names none, and a level naming any other is refused when the game data loads (LSL-011). Cinderbowl (grand_loop), Vesper IV (hill_9) and Persephone (deepwell_station) are buildings, locked at boot and opened by a scene’s unlock_building (PRG-013). Wherever a level is sited, its bot checks out to the arena station; only a level sited at arena waits on the Arena being unlocked (PRG-012).

A level file may also carry a one-sentence description, the glitches its part plays and a bench. The glitches grant and gate nothing; level select marks them. A level naming a glitch or a mod the code does not provide is refused when its content is built (LSL-013). Each level-select choice carries its level’s site, description and glitches (LSL-012), and, while its site’s building is locked, opened_by: the level whose win plays the first scene, in scene order, that opens the building, or null (LSL-016).

A level with a waiting_line whose prerequisites are all met but its scenes is waiting: level_selection.waiting names the first such level in catalog order, with its title, site, line and bench, and the level is offered only once its scenes are met (LOF-018, LOF-019). While a level declaring a bench is offered or waiting, research admits only the mods on such a bench (progression economy, RES-016).

level_selection.locked lists each level not offered that is sited at the Cinderbowl, Vesper IV or Persephone while that building is unlocked, with its title, site and level card (LSL-015). progression.cleared_sites holds each road site at which at least one level is sited and every level sited there is won; a roadblock stands on the map until its site is cleared (LSL-014).

The round robin

A zone may declare a schedule in data/zones/<zone>.yaml: an ordered list of groups, each holding a set of fixtures — the zone’s levels, assigned to a tier of the ramp. A group may declare an entry: gate in the same prerequisite vocabulary a level uses.

zone: qualifier-circuit
schedule:
  groups:
    - levels: [firing-range, guarded-gap, iron-hedge]
      entry:
        levels: [arena-bridge]
    - levels: [dock-edge, crossfire-bank, repair-pen]
    - levels: [pit-ring]
    - levels: [trench-bunker, flow-crossing]
      entry:
        levels: [pit-ring]
    - levels: [main-stage]

Two rules are engine law rather than configuration; only the banding above is tuning.

  • A group is passed when every fixture in it has been played at least once and at least half of them have been won (⌈n/2⌉). Both clauses: a group half won but not played out is not passed, and neither is one played out under the win bar.
  • A group opens when the group before it is passed and its own entry gate is met. The first group answers to its gate alone, opening cascades in one evaluation, and an open group never closes — a gate that stops being met, such as a Star Slot spent, cannot shut a group the player has already entered.

A group of one is a gate: passing it means winning it, which is what a gate has always meant.

The circuit mode runs once a zone’s first group has opened. It draws from the open pool — every fixture of every open group the player has not yet won, in schedule order. A win leaves the pool for good and a loss does not, so an unwon fixture keeps coming back until it is won and the group converges. When the pool is thinner than the offer, levels already won anywhere in the zone backfill behind it as repeats, cleared tutorials excepted, exactly as the free mode backfills. Once the whole schedule is passed the pool is set aside and every slot backfills, so a finished circuit still offers a fight.

The player fights the open groups in any order and chooses which half of a group to win. Losing costs nothing but the fight: it marks the fixture played, which is progress toward the group, and no progression fact records it.

The schedule is what paces the player, so its fixtures carry no prerequisites encoding their own position in the ramp; the group carries that. A fixture’s own gate is still asked, because every mode asks the one gate vocabulary, but it is not where ordering lives. The qualifier circuit makes one exception: iron-hedge and guarded-gap list firing-range among their prerequisites, so its first group offers firing-range alone until it is won, and no other fixture names a circuit level (RRB-027).

Before the first group opens, a scheduled zone runs the free mode, but only over the levels no group names. That is what carries the qualifier circuit’s tutorial chain: the tutorials are not fixtures, so they are offered from day zero, while a deep venue is withheld by its group rather than by a prerequisite list. One rule for whoever authors a zone follows from that: once the circuit opens, the pool holds only fixtures and the backfill only won levels, so a level no group names is reachable only while it is unwon and the circuit is still shut. Every non-fixture level of a scheduled zone therefore belongs to what the first group’s entry gate requires.

The bracket run

The third mode is the Sweet 16’s, and it is the one a player enters rather than a zone declares. Once its declared gate is met — today, the circuit finished — it stands over whichever mode the zone was running, and the offer answers to how far the run has got:

  • Between runs it is not exclusive. The zone composes its own levels as it would without the bracket, and the Sixteen’s next match stands beside them as the entry, so the offer can hold four cards. Choosing the entry begins the run.
  • During a run it is exclusive: the zone is handed none of its levels and the offer is exactly one match, the next round. That is the lock — town stations stay open, the circuit does not.
  • A run ends at the championship or the first defeat. The lock releases, the player is handed back the zone they entered from, and the next offer is that zone’s own composition plus a fresh entry.

The draw seats the fifteen by tier: the player’s own pool holds the three conference teams, the sibling pool the four semifinal teams, and the opposing conference the eight finals bosses — so the four rounds meet one of 3, the same 3, one of 4, and one of 8.

The Sixteen, seated by tier Who stands in which seat is drawn fresh each run; the pools themselves never change — the fifteen, read live from data/teams/.
Your pool
  • You
  • The Floor Crew
  • The Hot Lap
  • The Thornworks
The sibling pool
  • The Far Side
  • The Hook Shop
  • The Long Hold
  • The Tie-Down
The opposing conference
  • The Arrears
  • The Blackout
  • The Foundry
  • The Long Arm
  • The Magazine
  • The Rev Limiter
  • The Smoke House
  • The Survey
  1. Round of 16 one of your pool
  2. Quarterfinal your pool's other survivor
  3. Semifinal the sibling pool's advancer
  4. Final the opposing conference's survivor

The mode is entered once and never left: what changes is only whether a season is live.

A match is composed at draw time: an opposing team’s roster on a drawn board, built into an ordinary level, never authored. Its name is its round’s (sixteen-final, not the opponent’s), so a round won stays won across seasons, and a saved offer holding one is stood back up by composing it again rather than by finding it in a catalog.

Reward previews

Each offered level shows the haul it will pay — its first-victory table if it is unbeaten, and nothing if it has been cleared, since a repeat pays nothing. A table is a plain list, so the preview is the payout itself: every entry, in declared order, granted unchanged when the level is completed. Choosing a level that was not on the list reads its table the same way.

The gates declare a table, and so do the levels whose first victory pays a Star Slot beside its mod cores — workshop-gnawers, iron-hedge, repair-pen, trench-bunker and the bracket’s Round of 16. Beside the table, each offered level carries the mod cores its first victory pays: its declared mod_cores, one unless it says otherwise, and zero once it is cleared or when it is a gate, which the offer also says (LOF-012). While a base level is offered, the offer names its number in the base levels’ prerequisite chain and their count (LOF-013). The tables and the tokens they grant belong to Progression & Economy; level scheduling shows the preview and grants what a win pays.

Each offered level also carries its level card’s data: every battle’s map (LOF-016) and each distinct rival with its motivation, danger zone and question (LOF-017, LOF-022); Circuit rivals § The level card gives the fields.

Selecting a level

A bot enters the arena only by being selected for a level; there is no other checkout path. Selection checks that the level is one of the current choices, checks the bot out, and can assign a shop bot in the same call. If any part fails, the whole assignment is undone. A bot that is in a level cannot be edited until it returns.

Each battle starts with its arena’s first part chosen, a thread turn or an idle run (idle and clash § Idle runs). Where the player’s shop bot is posted and a screen watches, it then stands in its opening, under the opening hold, until the player fights or the count ends (pip sources § The opening); the shop chooses as the opening ends. Otherwise the shop chooses as the battle starts and the first step follows the curtain.

The scene handshake

The arena and level select are separate scenes. When the scene changes, the engine increments a scene version, and the curtain, one of the game’s holds (occasions.md § Holds), stays down until every watching client acknowledges that version; combat does not advance meanwhile. This stops a level that finishes quickly from returning to level select before the client has drawn the arena. Acknowledging an old version, a future version, or the same version twice all leave the curtain in the correct state. The version moves only when the scene changes, since a client stages the result curtain on every version that does not enter the arena: a level pick held while a gating scene plays, a held pick dropped back to selection, and quick-start all stay at level select and leave it unchanged (SCN-010).

Endings

One path. A win, a loss, a stalemate, and a bot recalled mid-fight all end the level the same way: the result is recorded, the level marked played, a victory’s haul and mod cores granted, LEVEL_END narrated, the mode told, and the bot returned to the stable at full stamina before a new offer is drawn and control comes back to the player.

Recall. A recall is a forfeit, which is a defeat like any other. Checking the arena bot back in mid-fight aborts it out of combat at the next tick, the arena choosing its next thread turn in place of the bot’s choice (TTN-016), and ends the level down that same path: it heals the bot, ends the Power Station’s encounter and any aiming hold with it, and narrates LEVEL_END with a defeat. The ending’s outcome, victory or defeat, rides the story moment the engine builds at level end, so a story scene can meet the player on exactly the ending it names; a scene narrowed to a defeat can be owed by a recall. No progression fact records a loss, however it was reached.

Stalemate. A battle whose clashing bots take no net loss for STALEMATE_ROUNDS rounds of their clash forfeits the level, and the result stays PLAYER_DIED: a draw is a failure and reports as one, so neither the result nor the story outcome grows a member for it. Only the turns of bots clashing a rival count, over a window of STALEMATE_ROUNDS times the bodies clashing one (BTL-017); an idle run, a harm clash and a standstill count nothing, so exploring never times a level out (idle and clash). Walking is not progress, so clashing bots that keep apart stall as surely as bots that stand still. The count starts over only when the stamina of the bots taking turns falls below where it stood when the count last started, so a hit that only takes back a heal does not restart it. Breaking rubble or a decoy is no fight, and neither is a glitch changing the ground. What the stall does earn is a word of its own on the wire — LEVEL_END carries whether the ending was the stall, set there and nowhere else. The ceremony reads that flag because the two defeats ask the player for different things: a death for a hardier bot, a stall for a kit that can land a blow on this board.

Modes are engine state

A mode is named, the name is saved with the game, and the snapshot publishes it. Two more things a mode decides:

  • Whether it is exclusive. An exclusive mode is handed none of the zone’s levels and shows only what it composes — the lock a live bracket run holds. Neither the free mode nor the circuit is ever exclusive, and the bracket run is exclusive only while a season is live, so exclusivity is a question asked at every roll rather than a property of the name.
  • Whether it composes its levels. A mode may build a level and offer it like any other, so the offer is never limited to what data/levels/ holds, and hands the built level back when a saved offer naming it is stood up again.

A mode may also fill in a gate fact only it holds — how many bracket runs have been entered is the shipped example — so a gate reads one snapshot of facts whoever knows them.

The free mode and the circuit are the two the zone’s schedule chooses for itself, re-read at every roll; a mode entered over the zone holds until it is left. Because a save carries only the mode’s name, a mode must be registered with the engine to be resumable — a game put down in a mode the build does not know is refused rather than quietly dropped back to the free offer.

The core is built for more modes than these three: a dungeon crawl, a linear campaign or a league would each be a mode over it, never a second scheduler.

What the client draws

Level select renders by mode, not by whether a schedule exists. A scheduled zone whose first group has not opened publishes a schedule block with no group in it while the mode is still free, and the client draws that zone flat — “a schedule exists” and “the circuit is running” are different facts.

Under the circuit, a group strip sits over the level ahead: the group the player is standing in, of the groups the schedule holds, and what the group still needs to open the next (landscape-stage.md § 7). The record’s needed is the win bar that passes the group, not the wins still owed — a passed group keeps reporting the bar it cleared, so a zone whose last group holds several fixtures can read more wins than its bar asks. The strip resolves what is left for the reader rather than the snapshot, which subtracts nothing: the wins still owed, the fights still to play once the bar is met, and both while more fixtures are unplayed than wins are owed. While a base level is offered the strip reads its description, or, for a level with none, its place in the chain.

Each tab of the draw says how the player has met that level before: won (a repeat is a level already won, backfilling a slot the pool could not fill), lost (a rematch is a fixture fought and not yet won, which the circuit keeps putting back), or new. Returning to the town chooses the first level of the draw not yet won.

Under bracket-run, for the Sixteen’s match, the client draws the bracket board in place of the level’s card and the team — the sixteen, the results as they roll, the player’s path, and the next match as a team card. The snapshot carries that block whole; nothing about a season is derived client side. While a run is under way its match is the whole offer, so the board stands alone. Between runs the offer is the zone’s draw plus the entry, so the client draws the circuit’s level ahead and draw with the entry as one more tab, whose choice shows the board in the level’s place, and the eliminated player still sees where they stand in the circuit they have been handed back to. The strip therefore keys off the schedule readout the snapshot carries, not off the mode’s name.

The difficulty ramp

In a scheduled zone the schedule is the ramp, and the pass rule is what paces the player through it. Where a zone declares none, prerequisites and the unbeaten-first ordering still pace it. The qualifier circuit is the shipped example of the first: a prerequisite-chained tutorial, the thirteen Base Levels offered one at a time under the free offer, then five groups — the three opening venues, the three electives behind them, the star gate, the two deep venues behind its victory, and the finale.

The Sixteen is the third kind of ramp, and the one a mode carries: no schedule, no prerequisites per fixture, four rounds whose opposition steps up by tier. Losing is expected — a run ends and the circuit reopens — so the ramp is paced by how much the player has grown between seasons rather than by what the zone withholds.

The ramp, group by group Every fixture of a group must be played and half of them won before the next opens — the qualifier-circuit schedule, read live from data/zones/.
firing-rangeguarded-gapiron-hedge

win 2 of 3 opens on arena-bridge won

dock-edgecrossfire-bankrepair-pen

win 2 of 3

pit-ring

win 1 of 1

trench-bunkerflow-crossing

win 1 of 2 opens on pit-ring won

main-stage

win 1 of 1

Derived specs — engine/bbsb_engine/test/scheduling/scheduling_spec.yaml · LOF level-offer · SCN scene-handshake · LSL selection-lifecycle · RRB round-robin · TEM team-catalog · BRK bracket · RUN bracket-run · AUT npc-autonomy · RIV circuit-rivals · PCE station-pace; combat/combat_spec.yaml · BTL-017 and BTL-018, the stalemate’s window. Implemented by LevelScheduler (level/scheduler.py), the modes (level/mode.py, level/bracket.py), the round robin’s rules (level/round_robin.py) over the schedule and its standing (state/zone.py), the bracket’s rules (level/sixteen.py) and its rostering (level/roster.py) over its records (state/tournament.py, state/team.py, state/venue.py), and the engine’s level-select and scene handshake. Inner battle mechanics (BTL) stay in combat/combat_spec.yaml; what a win pays (RWD, RWC) lives in progression.

Terms

TermMeaning
siteWhere a level is fought: a building or a road site. A level’s site, arena when it names none.
road siteA site on the roads with no building and no surface: your gate (front_gate) or a roadblock. ROAD_SITES.
cleared siteA road site at which at least one level is sited and every level sited there is won. cleared_sites in the snapshot.
waiting lineA level’s waiting_line: the level ahead’s row’s line while the scene that brings the level waits on the player.
benchA level’s bench: the mods the Workshop alone offers while that level is offered or waiting.