Game Manual

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

Idle and Clash — how a bot on the arena acts with no rival near, and when it clashes

iterating under active debate — expect movement

Every bot on the arena with a thread is idle or clashing. A clashing bot holds at least one clash, a pairing with an opposed bot or with the harm on its way, and its threads search plans as the thread decision model says. An idle bot’s threads search nothing: each thread turn walks to the player’s oldest positive point, else to the bot’s motivation goal, else heals, else waits. A body with no thread (rubble, the decoy, a nest) is neither, and takes its turns as the arena says (CLH-007).

Idle turns pass quickly. The idle thread turns that come next in the turn order are carried out together as one idle run, in one step, so while every bot is idle one step is one round, idle_step.length on screen, with no sound and no choice bar. A clash’s thread turns play one a step, thread_turn.length each. The shop keeps its own pace while the arena idles.

Danger zones

A danger zone is declared by aggro, in a bot file or a placement, the placement’s winning; with neither a bot uses sight (CLH-001). A bot on the player’s side always uses its reach zone, whatever it declares.

aggrothe zone
sightThe reach zone, and every cell within clash.sight_range king moves that a clear line reaches from the bot, a dark tile only from beside it (CLH-003). Walls, shut doors, darkness and cover block it as they block sight.
{sight: N}As sight, within N king moves.
reachThe eight cells beside the bot, and every cell a damaging action offered at any of its threads’ current stars covers from any tile its walk reaches within clash.lead_turns turns of walking, its own tile included (CLH-002). A bot that cannot move counts its own tile alone.
noneNo zone: the bot is dormant until a blow or a close clash wakes it, and then uses its reach zone.

A body stands inside a zone only where the zone’s bot sees it (Arena.sees, CLH-004). Lighting a dark tile widens a sight zone, and a bot in the dark beyond the eight cells beside a rival is never inside its zone. A zone is worked out when asked, off the board as it stands (foresight/zones.py).

Clashes

A clash starts and ends only between turns: at the close of a bot’s turn, for that bot against every rival, and at the battle’s first round opening and as reinforcements enter, for every pair (CLH-005). So no bot gets a free hit from a clash starting in the middle of a turn. A clash starts between two opposed bots where one stands inside the other’s zone, where one’s blow hit the other during the turn that closed, or where a clash it could join is close: it stands inside the reach zone of a rival that clashes, or a rival its ally clashes with stands inside its own reach zone. A dormant bot wakes where a blow hits it or where the last rule holds for the reach zone it would have. Light, the round clock, an ally’s blow and a point start none. CLASH_STARTED names both bots and the cause.

A clash ends once both bots are a full move clear: at the close of either’s turn, once neither’s walk reaches a cell of the other’s zone within clash.release_turns turns of walking, or as either leaves the board (CLH-006). A point ends none. CLASH_ENDED names both bots.

A bot whose clash starts plans at the next choose phase, as an entrant does, and a bot whose last clash ends advertises nothing from that close (ADV-013). Idle bots advertise no plan, so a clashing bot’s plan’s board holds each idle bot where it stands until it clashes (IDL-008).

Harm

Harm, for a bot, is a cell that would damage it as it stands or moves there (CLH-008): thorns; the cells the round clock will hit as the next round opens, a barrage’s painted marks and the cells a machine a round trigger fires next round covers; and, for a bot on the player’s side, the tiles a negative point warns. A pit and flow are not harm; an idle walk never enters them.

Idle walks go around harm wherever another way exists. Where every walk to an idle bot’s point or goal crosses harm, and the least harmful of them would leave the bot standing, a harm clash starts before its turn, CLASH_STARTED naming the bot and the harm’s cells (CLH-009). The bot’s threads then search plans, which weigh the harm against the goal, one of the bot’s points of interest: it may cross, wait or turn back. Where every such walk would bring the bot to 0, the harm is a wall to its idle walks.

A harm clash ends once the bot’s walk to its point or goal crosses no harm (CLH-010). After clash.harm_turns of its turns in the harm clash with that walk no shorter than when it started, the bot gives up: CLASH_ENDED writes gave_up, and the harm’s cells are walls to its idle walks while that harm stands on them.

The idle tree

Each thread turn of an idle bot plays the first check that applies (IDL-001). Nothing in the tree searches plans, scores or draws.

  1. The bot is on the player’s side, a positive point stands that its walk reaches, and the thread may move: the next action of the idle walk to the oldest such point.
  2. The bot stands away from its motivation goal, the thread may move, and the battle awaits no point (AWP-001): the next action of the idle walk to the goal.
  3. The bot is hurt and the thread may heal: the heal basic.
  4. Otherwise the thread passes.

A walk’s next action is interact where its next cell is a shut door the bot interacts with, or its target is a switch on or beside the bot that it may throw, and otherwise one step of the move basic. So a bot pointed at a switch walks there in idle steps and throws it, and a bot on the player’s side opens each shut door on its way. A thread may move or heal only where its station offers it the basic the action needs: a root, a thread that disables the move, and holds_engagement while engaged each withhold one.

The idle walk is the bot’s own walk to the target’s tile, or to a tile beside it where that tile cannot be stood on (IDL-002). It enters no pit or flow, and no harm where a walk without it exists. A patroller’s keeps to its route (PTL-003), a shy body’s enters no lit tile (LIT-002), and a bot on the player’s side enters a dark tile only toward a positive point or its side’s goal (LGT-010).

An idle thread turn spends no thread energy, leaves its thread on the star it stands on and holds no mod, so a bot starts every clash where it left off (IDL-003). It is carried out through the arena’s one act pipeline, so its move, heal and interact write the entries they write in a clash. A lockdown takes an idle thread turn as it takes any (TTN-009), and a bot’s turn closes as any turn closes, so timed buffs, rot and the round clock count every round, idle or not.

The ask. A bot on the player’s side whose idle thread passes with no positive point standing and no goal it stands away from asks for a point (IDL-007). AWAITING_POINT is written once as the ask starts, and the screen shows the ? over the bot until a positive point is placed or the bot next steps.

Motivations

A motivation is a bot’s one goal for the level, declared by a placement’s motivation; the battle’s motivation is the player’s side’s, and each defaults to seek (MTV-001).

motivationits goal
{patrol: <route>}The stop the patrol heads for (circuit terrain § Patrols).
{post: [x, y]}One tile the bot returns to and holds.
{visit: [<target>, …]}The first target not yet checked off: a cell, or the name of the battle’s door, switch or board region. None once every target is checked off.
seekThe tile of the nearest known rival by walk; none where the bot knows no rival.

A visit’s next switch is one its bot throws, rivals included: its walk crosses the switch by interact’s throw (MTV-004). A visit opens no door. A target is checked off when a bot of the motivation’s side stands on its cell, on a cell of its region, or in its door or beside it, the door open or shut, or throws its switch, live and on a plan’s board alike; VISITED names the target and the bot. Reaching a door checks it off whether or not anyone opens it.

Doors hold rivals. The player’s bots open doors; a rival opens only a door on the route it patrols, which the route’s design means it to pass through (DRS-005). Outside a visit a bot on the player’s side throws only a switch the player points at.

During a clash the goal still pulls. A bot’s patrol stop, post tile or next visit target is one of its points of interest at weight 1 (MTV-005); a seek goal adds none, since its rival is a point of interest already. So a bot on a post or a visit may break off a clash when its goal looks more worth it.

A trigger can change a motivation. A placement may declare a name, unique among the battle’s names (MTV-002, TRG-004). A trigger’s motivation effect gives the bot it names, or the player’s side with side: player, a new motivation, and a new danger zone where it names aggro, writing MOTIVATION_SET (MTV-006).

keywherewhat it does
aggrobot file, placementsight (the default), {sight: N}, reach or none. A placement’s overrides its bot file’s.
motivationplacement, battle{patrol: <route>}, {post: [x, y]}, {visit: [<target>, …]} or seek. The battle’s is the player’s side’s.
nameplacementLets a trigger name this bot.
motivationtrigger effectthen: {motivation: {bot: <name>, <motivation key>: …, aggro: …}}, side: player in place of bot, and seek: true for seek.
bots:
  - {bot: cellar-lurker, name: warden, location: [8, 0], motivation: {post: [8, 0]}, aggro: {sight: 4}}
  - {bot: cellar-lurker, name: sleeper, location: [0, 0], motivation: {post: [0, 0]}, aggro: none}
routes:
  - {name: yard, stops: [[8, 0], [6, 2], [2, 2]]}
motivation: {visit: [stall-door, alarm, exit]}   # the player's side
triggers:
  - {when: {fired: alarm}, then: {motivation: {bot: warden, patrol: yard, aggro: {sight: 5}}}}

The level editor paints each key, and the level card shows each rival’s motivation and danger zone (circuit rivals § The level card).

Idle runs

Each step carries out one part at each station (IDL-004). At the arena the part is a clashing bot’s thread turn, chosen a step ahead as the phased turn says, or an idle run: where the arena’s next turn is an idle bot’s, that bot’s idle thread turns and those of each idle bot after it in the turn order, each chosen on a copy of the board as the earlier ones leave it, up to the next clashing bot’s turn, the close of a turn where a clash would start, or the round’s end. A bot’s turn is in a run whole or not at all, and a threadless body’s turn inside the run opens and closes empty in it. Choosing the run writes IDLE_RUN, naming its step and each idle thread turn, and no THREAD_CHOICE; the entries its turns write follow it.

A run draws nothing, so choosing it again gives the same run on the same board (IDL-005). It is chosen again whole when a fire lands (TTN-011) and when a point command chooses again (PNT-010), and the preview carries it out as the step will (PVW-002). The arena’s read of the steps ahead counts a standing run as one step that spends nothing (ADV-015). The victory pass and the death pass choose and carry out their thread turns one a step, never as a run.

An idle walk raises the board occasions moved_into and switch_thrown as any move or throw does, and a gating scene they owe holds from the next step, once the run’s step has finished (occasions § Holds).

The standstill. A run of only passes, in which no turn of its bots closes on a timed buff or rot, no round-clock phase, reinforcement or machine falls due as the next round opens, and no standing shop choice due at the step fires an action, is not carried out (IDL-006). Nothing moves and no turns pass until a point command, a fire or a recall changes the run. The standstill is not a hold: it refuses no command.

The approach. As it chooses a run, the arena plays the idle tree on for up to two more rounds on the run’s copy (IDL-009). Where a clash would start within them with a rival the player’s side sees, or a harm clash for a bot on the player’s side, the run is one or two rounds from a clash, and names the rival or the harm’s cells. A clash the player’s side cannot see coming never slows the game.

The station pace

Each step has a span, in seconds from game.yaml (PCE-001):

the arena’s partspan
an idle runidle_step.length; idle_step.approach’s second length two rounds from a clash and its first one round from it; its first and then its second for the first two idle steps after the player’s side stops clashing
a thread turnthread_turn.length, or thread_turn.quiet_length where no part carried out at the step fires an action; plus clash_start at the first thread turn after the player’s side starts clashing

The shop has a clash pace and an idle pace (PCE-002). While any bot on the arena clashes, the shop carries out its thread turn at every step whose arena part is a thread turn, and at no idle run’s step. While no bot clashes, it carries one out only once the spans since the step that carried out its last reach that turn’s length; its first in a battle comes at the first step it can. At every other step its part is empty. The engine counts spans from game.yaml, never from the screen’s reports, so a game carries out the same steps watched or not (PCE-005). The snapshot’s thread turn block names the next step’s span and parts (PCE-003).

The shop restocks only after a clash. At an arena round’s start the generators restock, each team’s offer swaps and each jam counts a restock only where the round before had a clashing bot’s thread turn (GEN-009), and a plan’s board projects a restock only while a bot clashes (SDC-021). So while the player explores, the shop uses up its stock and then goes quiet.

Only clash turns count toward a stalemate (BTL-017): the window is STALEMATE_ROUNDS times the bodies clashing a rival, and an idle run, a harm clash and a standstill count nothing (level scheduling § Endings). A simulated fight ends stalled at a standstill its scripted player has no point for, or after idle.max_rounds idle rounds in a row with no clash and no target checked off (FGT-013).

On screen

The screen keeps one clock per station. A station’s part starts on its own clock once its last turn there has played its length, and the screen reports a step shown once every part due at it has reached its report moment: an idle run its glide’s start, a thread turn its Action (WCH-020). While the arena’s part is a thread turn, both stations’ turns at one step start together.

momenton screen and in soundlength
idleEvery idle bot moves at once along its run, over idle_step.glide. No sound, no choice bar.idle_step.length a round
two rounds, then one, from a clashThe steps slow, and the rival’s zone shows, or the harm’s cells ahead are outlined. It pulses two rounds away and holds steady one round away.idle_step.approach
a clash startsA yellow ! (ui/clash) over each rival a CLASH_STARTED names; a ring in --warning on both bots; the turn order slides in; fx/clash-in plays. Harm gets no !.clash_start, then the clash’s turns
a rival joins a clash under wayThe ! over the rival and its ring.its first turn
clashThe thread turns of the phased turn.thread_turn.length a turn
a clash endsThe rings fade, fx/clash-out plays, and the steps speed back up.idle_step.approach, then idle_step.length
the standstillNothing moves and no turns pass. The asking bot shows the ? (ui/awaiting-point).until the player acts

The ! marks each rival that starts or joins a clash with the player’s side: it stands from the moment the board shows the clash until the rival’s first turn in it has played, whether the clash opens the side’s fight or joins one under way.

Sound. Idle moves, heals and waits play no sound; doors, switches, lights and glitches still do. fx/clash-in and fx/clash-out play only when the player’s side as a whole starts or stops clashing, never once per rival (game audio).

The turn order is hidden while no bot on the player’s side clashes, and slides in when one starts (landscape stage).

Danger zones are hidden until asked for. Hovering or pressing a rival shows its zone, and a tap pins it. The Danger toggle beside Point’s slot shows every rival’s zone, and the rival one or two rounds from a clash shows its zone on its own (PixiJS center § Draw order).

Terms

TermMeaning
idleOf a bot with a thread on the arena: holding no clash, so each of its thread turns plays the idle tree. Distinct from the idle_in_town occasion (OCC-015), which counts free time in town, and from the snapshot’s idle stub between levels.
clashA pairing of two opposed bots, or of one bot and harm, that makes each of its bots search plans for its thread turns; it starts and ends only between turns. Distinct from the FIGHT › command (OPN-006) and from a simulated fight (sim/fight.py).
clashingOf a bot: holding at least one clash.
harm clashA clash between one bot and the harm on every walk to its point or goal.
danger zoneThe cells a bot’s aggro covers, inside which a rival it sees starts a clash with it: a sight zone, a reach zone, or none.
reach zoneThe eight cells beside a bot and every cell its damaging actions cover from any tile its walk reaches within clash.lead_turns turns of walking. Distinct from an action’s reach, the tiles it can hit from where its bot stands now.
turn of walkingThe tiles a bot’s walk reaches in one of its turns: one step of the move basic for each of its threads that may move. clash.lead_turns and clash.release_turns count in it. Distinct from a thread turn, of which a bot turn holds one for each thread.
sight zoneA reach zone and every cell within its range that a clear line reaches from the bot.
dormantOf a bot whose aggro is none: holding no zone until a blow or a close clash wakes it, then using its reach zone. Distinct from SLEEP, a buff that takes thread turns.
harmA cell that would damage a bot standing or moving there: thorns, the round clock’s next fire, and, for the player’s side, warned tiles. A pit and flow are not harm.
idle treeThe four checks an idle bot’s thread plays in order: the oldest positive point, the motivation goal, a heal, a wait. It searches, scores and draws nothing.
idle walkThe shortest walk an idle tree steps along, entering no pit or flow and no harm where another way exists.
idle runThe idle thread turns one step carries out together: from the next idle bot’s turn up to the next clashing bot’s turn, a clash’s start or the round’s end.
idle stepA step whose arena part is an idle run. Its game.yaml timings are idle_step; its movement plays over idle_step.glide. Distinct from the thread glide (constellation-chart.md).
standstillA step not carried out because the arena’s idle run is only waits and nothing timed lands; it holds until a point command, a fire or a recall. Not a hold: it refuses no command.
askA bot on the player’s side asking for a positive point: started by its pass while it has nowhere to head (IDL-007), or while the battle awaits a point (AWP-002) or it is lost (LGT-012), with one AWAITING_POINT; it stands, the snapshot’s asking, until a positive point is placed or the bot steps. The screen draws it as the ?.
approachThe one or two idle rounds before a clash the player’s side can see coming, when the steps slow and the rival’s zone shows.
Danger toggleThe button beside Point’s slot in the hand (hand.danger, the zones store’s danger) that shows every rival’s danger zone on the board while it is on. A tap on a rival pins that rival’s zone alone.
motivationA bot’s one goal for the level: patrol, post, visit or seek; the battle’s is the player’s side’s.
motivation goalThe tile a motivation heads for now: the patrol’s next stop, the post, the visit’s next target, or the nearest known rival for seek.
known rivalA rival a bot’s walk reaches, unless it stands on a dark tile not beside the bot (FRS-008, LGT-011): one of the bot’s points of interest, and what seek heads for.
visit targetOne entry of a visit: a cell, or a named door, switch or board region, checked off when a bot of its side arrives. Distinct from a town visit.
spanThe seconds a step takes in the engine’s count, from game.yaml: an idle step’s length or a thread turn’s.
partWhat one station carries out at a step: a thread turn, an idle run (the arena’s), or nothing.

Derived specs — engine/bbsb_engine/test/combat/combat_spec.yaml § clashes (CLH-001 to CLH-010), § idle (IDL-001 to IDL-009) and § motivations (MTV-001 to MTV-007); scheduling/scheduling_spec.yaml § station-pace (PCE-001 to PCE-005); sim/sim_spec.yaml · FGT-013; editors/design_spec.yaml · EDB-006.