Thread decision model — how a thread scores its plans, searches for them and picks one
settled decided — build to this page
A thread decides its turn by scoring the plans it could play with one equation, foresight, and picking among the best. The arena and the shop run the same search and pick, and score with the same equation; the shop reads its terms on the generator board.
At the arena only a clashing bot’s threads plan. An idle bot’s threads plan nothing: each of their thread turns plays the idle tree, which walks to a positive point or the bot’s motivation goal, heals or waits, and searches, scores and draws nothing (idle and clash, IDL-001). 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).
Foresight: how a thread scores a plan
To evaluate their turn, threads gather possible plans and score them using the foresight equation:
Blue terms are facts, the same for every thread. Gold terms are the thread’s preferences.
The thread picks a plan by these scores, fires its first action, and advertises the rest, so that other threads plan around it. A chosen plan is public board knowledge.
If a plan predicts the bot will die, it does not score future turns. The plan up to death is still required since there may not be a better plan.
On each turn, a plan may move the bot to any tile the move can reach, and may aim a mod at any target it can reach. The search tries each action’s best-ranked targets first, as Searching for plans describes. The plan’s board on each turn includes the results of advertised actions occurring before the projected turn, so a plan only aims at targets still standing.
The arena’s own rules play the plan’s board. Planning plays each action through the same rules the live battle runs, on a copy of the arena, and no action played for one plan reaches another plan’s board. Payoff, denial and threat are measured from what the rules changed on that board. No mod has a second implementation of what it does. The copy carries none of the player’s armed glitches, so no plan counts on one firing.
Factual Parameters (same across all threads)
Payoff is the stamina change the plan’s action causes: stamina rivals lose, minus stamina the planning bot and its allies lose, plus stamina they gain. It includes the stamina change the action adds to allies’ advertised turns, such as extra damage from a buff, and the stamina change it adds to an ally’s rot or bloom landing as another body’s turn closes, such as an ally’s rot landing deeper on a rival the plan marked. Damage based on bot positioning and rival actions is accounted for in threat, not payoff. Rubble is not counted.
- damage dealt (overkill damage does not count)
- repairs / healing (overheal does not count)
- stamina created through buffs
- stamina created through allies joining
Payoff on turn is whatever stamina change the planning bot’s effects cause on that turn’s board: the action it takes that turn, and anything its earlier actions left running, such as a bleed ticking or an ally hitting harder under its buff.
Denial is the value of the rival actions the plan prevents, except damage to the planning bot and its allies, which threat counts. Each prevented action is credited at its advertised payoff and denial, scaled by the share of it the plan prevents. Kills, stuns, terrain occlusion and push/pull all deny. A plan earns denial for stopping a foe’s action only if the action would have landed. A strike aimed at a tile its target has already left would miss anyway, so stopping it earns nothing. A nest’s advertised print is a rival action too: a plan that breaks the nest is credited its pest’s advertised turn, damage to the planning bot included, since that pest publishes no reach on a plan’s board (
circuit-terrain.md§ Nest).Projected damage is the most damage rivals could do to one bot’s tile on turn . It includes:
foe actions. Each of a foe’s threads uses its most damaging action against the tile, with any buffs it advertised. Its actions are the ones valid for it on that turn, at the star its advertisement puts it on. Any action that can damage a bot on the tile counts, including one that moves the bot first, along with damage where the bot lands. Basic mods count. Foes replan every turn, so this includes what a foe would do if the planning bot or an ally came into its range.
Each thread publishes this with its advertisement as its reach damage: for each advertised turn, each damaging action at that turn’s star, with the tiles it reaches and its blows before defenses. A turn that resets has its first star’s. A plan places each reach at the foe’s tile on its board. Where a body that blocks sight stands between the foe and a tile on the plan’s board, the action’s own targeting judges that tile again there, so a block placed across the line ends the threat of an action that needs sight, the winch without a REBAR among them, and leaves one that does not. Every bot publishes reach damage the same way; the planning bot decides which bots are its foes.
A tile is in an action’s reach when the action’s own targeting would accept a body standing there, from the bot’s tile on the board before that turn. Line of sight, a dash’s lanes and posts decide it, as they decide a live action’s targets. An action that takes no target, such as a retaliation or a burst, reaches the ground it declares, and its own rule decides what it catches.
The blows are measured on a plain body with no buffs, and on each rival as it stands, with its own buffs and the thread’s own history. A stressed rival takes a discharge, and a rival that took stamina off the bot takes its revenge. A rival’s blows are published where they differ from the plain body’s, and the plan reads the blows published for each bot it threatens. A bot with none of its own, such as one that entered after the foe advertised, reads the plain body’s. A forced move’s blows depend on where the body lands, so it publishes the plain body’s blows at each tile of its reach, each kept off a body that refuses the force, a stabilized or rooted one, since a refused slide deals nothing. Each blow names the buffs that keep it off a body.
terrain the bot enters or stands on: thorns, pits and flow. For a bot on the player’s side it includes
point.warning_damagewhere the bot ends the turn on a tile a negative point warns, once however many warn it (PNT-008, point).damage over time on the bot.
retaliation the plan’s own action provokes, where the public board shows it.
Buffs and debuffs raise or lower it as they would on the board, and guards, dodges, taunts and blocks subtract what they prevent, blow by blow with foes in initiative order: each guard blocks only the first targeted strike it meets. Whether a guard blocks a strike or a dodge avoids it is decided by the rule the arena applies to a live blow. Rock form and the deflector turn only the blows of their class, and a dodge steps the bot to an opening, where the foes after it reach for the bot. Allies never threaten. Dead bots cannot threaten, a stunned bot cannot threaten on the turn it loses, and a taunted foe threatens only its taunter. Threads act as if allies will avoid them, whether true or not. Death is calculated from projected stamina.
A disrupted foe. A plan disrupts a foe when it takes the foe’s turn, changes its side, or leaves it off its advertised tile, by moving it or blocking its path. A foe the plan moves before its own turn plays that turn from where it was moved, and walks its advertised move only where the move still carries it the way it advertised, toward the nearest bot it opposes or away from it; otherwise it stands there. So a foe dragged into contact while closing in stays in contact. From then on, on each turn it begins off the tile its advertisement stands it on, it steps toward that tile with its own move basic, and that turn’s advertised action is denied. A root withholds the step, and the move’s own rules stop it at a wall or a body in the way. Back on the tile, it plays its advertised turns from there. A rooted foe’s advertised moves and the forced moves aimed at it do not play, so it walks back only once the root ends: a root denies a foe that meant to walk, and earns nothing against one that meant to stand and swing, while a shove costs a foe only the turns it spends walking back. A turn the plan takes from it, such as a stun, keeps it on the same star: on its next turn it plays the advertised turn it lost, from that star, and moves on from there a turn behind. A foe brought to the plan’s side plays none of its remaining advertised actions, and each is denied. On every turn a disrupted foe threatens with the reach damage published for the star it would act from that turn, from the tile it stands on as the turn begins. Stripping a foe’s buff does not lower its published blows; the strip earns denial instead. An ally the plan disrupts walks back the same way, and the actions it does not play earn the plan no denial.
A target that steps away. Where a bot’s advertised action names a body that has left the tile the action was aimed at, for one the action’s reach from where the bot stands no longer covers, the bot moves toward that body instead, if its thread may move from that star. That leaves it off its advertised tile, so it is disrupted: on its next turn it threatens from where it now stands, and steps back toward its advertised tile. A step out of a foe’s reach buys a turn, not safety.
If the planning bot holds an effect a hit sets off, such as ooze form, each foe that threatens it and threw no blow at it on its advertised turn fires its most damaging action at it, whatever that action would deal. The foes fire in acting order on one copy of the board for each scored turn, so a guard the first blow spends stays spent for the next, as projected damage spends it, and what the effect returns there counts for the plan. If a blow leaves the foe stunned, as when remorse sets off the foe’s armed pile, the foe is stunned as the plan’s next turn begins and loses that turn as it would to any stun the plan lays.
- is the planning bot or an ally.
- foes are the threads of every foe whose reach covers ’s tile on turn .
- damage is what the action’s published blows deal after ’s defenses.
- prevented is the damage stopped on the plan’s board.
Projected stamina is a bot’s stamina on turn after its projected damage and the known repairs up to that turn, never above its max stamina. A bot that leaves the plan’s board is at 0.
Threat is the sum of projected damage across the planning bot and its allies, each weighted by preservation, for the foresight equation.
Fade is the uncertainty about our predictions for turn . It stays near 1 because we have high trust in advertised plans, but because threads replan every turn, more distant turns in the plan have higher fade discounts. Turn 0 is certain and should not be faded. Its default is 0.9.
Urgency raises the weight of payoff, denial and interest and lowers the weight of threat, with time. It counts rounds from the start of the battle (not ) and is the same for every thread: 0.5 in the first round, rising evenly to 0.8 at round 20, the length of the stalemate window. It never resets, so a long battle stays at 0.8 from then on.
Interest measures how far a plan’s turn leaves its bot from the thread’s points of interest. It is their weighted average distance, scaled to run from 0 to 3 and subtracted, so a turn that leaves the bot nearer its points scores higher, and many rivals pull no harder than one. The arena makes every rival a walk from the thread’s bot reaches a point of weight 1, decoys included. The bot’s motivation goal is one more point of weight 1: a patrol’s stop, a post’s tile or a visit’s next target, keyed by the bot and the goal, so a plan’s board that reaches the goal stops its pull from that turn; a
seekgoal adds none, since its rival is a point already (MTV-005, FRS-010). For a bot on the player’s side, the player’s positive points join them inpoints_of_interest, keyed by the point’s id and sharing a weight of 1 evenly, so together they pull as one more rival; the player’s negative points add projected damage instead (§ Projected damage, point).- is a point of interest when the thread plans, fixed at its rival’s tile then, or at a positive point’s tile; is its weight.
- is the length of the shortest walk from the planning bot’s tile after its action on turn to ’s tile, on the board that turn leaves. A walk takes king moves, and each tile it enters costs what a move pays to enter it, so difficult ground costs more; a rubble block costs its stamina more, since it stands until broken. Rock, pits, flow, a duct’s grates and a held relay’s empty pad end a walk. Other bodies do not, since bodies move. A shut door ends a rival’s walk; one of the player’s bots crosses it at one step more than floor, the turn its
interacttakes to open it (point § Doors). A step into a pad of an open relay lands on its other pad at that step’s cost, and no walk stands on the pad itself; the planning bot’s own body holds no relay on its walk (Vesper IV § The relay). For a positive point on a target no walk enters, such as a machine, is the walk to the nearest tile beside it. Where that board leaves no walk to ’s tile, is the Chebyshev distance, king moves ignoring walls and terrain. - is the first turn at whose end ’s rival is off the plan’s board or no longer on the other side, or its positive point is spent. For every , .
- of the arena: the longest walk across its open floor.
So a rival that dies or changes sides stops pulling, and that does not change interest on turn ; a kill is valued by payoff, denial and threat alone. Interest is 0 with no points, or on a turn whose own action removes the planning bot; otherwise it is 0 when every , 3 when every , and more than 3 where walls and costly ground make the walks longer than .
Urgency weighs interest as it weighs payoff, so the pull toward the points grows as the battle goes on while threat’s weight falls. Early in a battle, a thread steps into a foe’s reach only when its plan pays for the threat there; late in a battle, the pull alone can.
Personality Parameters (differ across threads)
Affinity is the thread’s personality preference for an action. Threads can declare affinities for specific power colors or specific mods, allowing their behavior to “lean” powerfully in a direction of play. These values are normalized between all available mods at each choice, by dividing by the highest, so affinity is always relative. A colorless basic takes the average of the thread’s color affinities, so a thread prefers its favored colors to basics, and basics to colors it disfavors. A turn that passes fires nothing to prefer, so what it earns from actions fired earlier in the plan counts at affinity 1. A thread that declares no color affinity has affinity 1 for every color, and a color a thread leaves out of its declaration takes that default.
Immediacy is the thread’s bias away from planning. It discounts later turns as fade does, but it is the thread’s preference, where fade is the game’s uncertainty about the future. High immediacy means little planning; low immediacy weighs later turns nearly as much as this one.
Preservation is how much the planning thread cares about threat. It weights each bot’s projected damage in the threat sum. Low preservation discounts threat, high preservation maintains it. Preservation scales the thread’s constant by the percent of max stamina the threatened bot is projected to have before that turn’s damage: this makes stamina loss more costly for a bot near death, and less important near full health. Preservation only affects threat and does not multiply into payoff scoring (such as the value of healing).
where is the thread’s preservation constant (0 – 1). Turn ’s damage is weighed by the bot’s stamina before it lands; on turn 0 that is its current stamina.
Where actions and effects count
Every action and effect is played out on the plan’s board, for the turns it lasts. The equation reads three things from that board, and each is counted in one term only:
- Payoff is the stamina the plan’s own action changes, except damage that threat counts.
- Threat is all damage the planning bot and its allies could take.
- Denial is every rival action the plan prevents, other than damage to the planning bot and its allies.
Buffs, debuffs, terrain and forced movement have no value of their own. They change the board, and count only through these three terms. Vulnerable on our bot raises threat on its later turns; a guard lowers it; a stun removes the stunned bot’s threat and denies its other actions. An effect set off by being hit, such as ooze form, is set off once by each threatening foe that threw no blow at its holder, whatever that foe’s blow would deal, in acting order on one copy of the board per scored turn (PDM-007). Stress is the one fixed value: each stress a plan adds to a rival’s pile is 0.3 denial. Stress that lands on an armed pile adds nothing to it: it explodes the pile, and its stun counts as any stun does. No mod or effect adds a term or a bonus to the equation.
Searching for plans
A plan walks the thread’s star paths: each turn stands on the next star, and when the walk ends the thread resets as its next turn begins, and that turn stands on its first star, so a reset takes no turn of its own. On each turn the thread can pass, or fire any mod installed on that star or any basic it has not disabled, at a target in its reach from where the bot stands on the plan’s board. A thread that holds engagement is offered no move on a turn a rival stands on one of the eight tiles beside its bot (TCT-011). An action that takes no target fires at none. An action with no target in reach is not offered, unless it also holds an effect that acts without one, such as a strike that mends its own bot; then it fires at none. An action’s payoff reads the plan’s board on that turn, including buffs and previous mod activation states.
Each turn a thread plans, the search builds a plan from every first action: the pass and each action at its best-ranked target.
- The plan that passes every turn is scored first. It is the baseline the pick normalizes against.
- A plan is completed depth first. From each turn the search plays the pass and each action at its best-ranked target, and continues from the one that scores highest for that turn alone, until the plan reaches the last advertised turn. Because every first action gets a plan, a setup whose payoff lands on a later turn is weighed even when it scores least on its own turn.
- Every other turn a plan did not continue from is an alternative. Until the search continues from it, an alternative ranks by a quick guess: the plan it branched from, with this turn swapped in and that plan’s later moves played after it. The guess only orders the search. A later turn the rules no longer offer there, and every later turn once the budget is spent, scores as it did on the plan it branched from. An action’s next-ranked target stands in that ranking at the score of the target ranked above it, and is played only when it reaches the top.
- The search continues from whatever ranks highest, choosing each later turn from that alternative’s own board, so an alternative is scored by its own future. A complete plan that scores no higher than one already built with the same first action is dropped, since the pick keeps only the best. An alternative is dropped on its guess only where later turns count for nothing in the score (immediacy 1), because only then is the guess its final score. The search stops when nothing is left, or once no guess comes within
relative_cutoffof the best plan’s gain over passing. That stop keeps planning affordable, and can skip a setup whose guess is poor.
Ranking targets. Each action declares a board template, the tiles a fire at a target covers, and a value, a simple function of what those tiles hold: the stamina of the rivals there, the damage the action’s strike would deal them, each counted at most at its stamina and with the strike’s conditional bonus read by the same rule the strike lands by, the charge the rivals there hold, the stamina of the allies there, the stamina the bot’s side has lost there, the number of rivals there, the number of rivals beside the target, or how near the target stands to the points of interest. The values live in station/arena/board/value.py, and a request kind or a mod declares one of them by name. An action may also declare further values, and is listed again ranked by each: the move lists its steps nearest the points of interest first, as interest measures them, the player’s positive points among them for a bot on the player’s side, and again with the least reach damage the rivals published on them first, so every turn weighs approaching, holding and retreating. An action that pushes or pulls is listed again by what the hazards its slides cross would take: the whole stamina of a rival driven into a pit or flow, and the thorns a rival is dragged through. So every turn weighs the hazard play beside the ordinary one, where it would otherwise wait behind a target that scores less and might never be played. Only the targets in the action’s reach are valued. An action that aims several distinct bodies lists each set of them as one target, valued as the sum of what its value makes at each body, so every body it aims is the plan’s pick (REQ-008). The value only orders the targets; foresight scores every plan. A shop action declares a value read from the generator board and the bins (station/shop/foresight/value.py): travel ranks a dock whose stock holds a pip the team’s first unfinished ticket lacks first, then the nearer, and each shop mod ranks its docks or tickets by the pips there (SEL-008).
Scoring. Projected damage is read from published reach damage, so scoring a turn costs only its play. The arena gives the search no bounds; it scores every turn it plays.
A compute budget. Once a thread’s search has used plan_budget copies of its station’s board, arena or shop, it plays and completes no alternative. The plan from every first action is always completed. The budget counts copies, not time, so a battle replays the same on any machine.
The search is one replaceable part, shared by the arena and the shop. It is given the thread’s position, the actions the thread can take on each star, a way to play an action on a board, and the score of one turn, and it returns complete plans. A smarter search can replace it without changing scoring, the pick or the rules.
Picking a plan
Threads calculate plan scores to determine the best scoring plan. Only the best scoring plan for each first action is kept. Plans that result in death are not considered unless all available plans result in death. A heedless thread is the exception: it weighs a plan that results in death as any other, and its search ranks that plan by score alone (PIK-007). Its plan still ends at the death, and passing every turn stays its baseline.
Plan scores are normalized from 0 to 1 after collection (raw plan scores are unbounded), by their improvement over doing nothing: the plan where the bot passes every turn. The best plan scores 1, and a plan no better than doing nothing scores 0 or less. If no plan improves on doing nothing, pass. When passing predicts death and no surviving plan improves on it, the lowest surviving plan takes passing’s place as the baseline, so the thread does not pass into its death.
Once the best scoring plan is determined (normalized score of 1), all normalized plans that score less than relative_cutoff (0.85) are discarded.
The winning plan is chosen from the remaining candidates, with odds proportional to how far their normalized score exceeds relative_cutoff. Its first action fires at the target and tile the plan names.
The choice is made ahead. As soon as a station has carried out one part, it chooses the next, and the next step carries it out. At the arena the next part is an idle run where the next turn is an idle bot’s, which writes IDLE_RUN and no THREAD_CHOICE (IDL-004). A thread turn’s choice is carried out as drawn: the plan’s first action fires at the target and tile the plan names, with no second draw (phased turn § The step). Each choice is logged as THREAD_CHOICE, naming the thread, its star, the actions the rules offer it at the star its first turn plays and the first action it drew. Each listed action carries its chance, the probability the draw picks it: the odds of the candidates that open with it over the odds of every candidate. An action no candidate opens with has no chance. A thread that passes or has a single contender chooses with a chance of 1. A thread due for reset lists the actions of its first star, where its turn plays. A thread turn its bot plays while it holds STUN or SLEEP is lost: its THREAD_CHOICE names the lockdown and lists no action, and carrying it out fires nothing. So is each thread turn of a downed player bot’s death pass, whose THREAD_CHOICE names it down (BTL-016).
Design Decisions
- All bots should plan for as many turns as needed for the board advertisement. The number of advertised turns should be a tunable parameter — default it to 4. All threads in a game should honor the same parameter.
- The equation is summed over each turn in the plan. Each turn’s action for that path is scored separately, and the sum is the plan’s score.
- Threat is all damage the planning bot and its allies could take; denial is every other rival action the plan prevents. Prevention (guards, dodges, taunts, blocks) counts in threat, not payoff. Threat is calculated on the plan’s board, so prevention reduces threat on the turns it stops damage. Killing a foe that threatens an ally pays through threat.
- A payoff needs reach. The ability must be valid from the plan’s board position on that turn.
- Basic mods are available. Unless explicitly disabled, all basic mods are available to all threads on all turns of a plan, except
movefor a thread that holds engagement on a turn a rival stands on one of the eight tiles beside its bot (TCT-011). - No suicide plans. Plans that result in death are not considered unless there are no plans that do not result in death (a defeated state). A heedless thread, given to a bot with a reason not to care whether it lives, considers them on every turn (TCT-013).
- Threads trust the advertisements. The advertisements save computation time and are the game’s best guess about the future. Threads trust it, except when behavior will trigger known replanning. Threat, in particular: when evaluating bot movement to threatened tiles, must expect that rival bots will adjust their plans to attack in the most effective manner. No waltzing into enemy territory without expecting the worst!
- Several threads can play one bot. A bot with more than one thread is expected. Its threads huddle: each thread plans on a board that includes the plans already chosen by the bot’s other threads, and respects their advertisements as it would an ally’s. Each thread’s action resolves before the next thread plans. Its threads plan in order of immediacy, highest first; threads with equal immediacy plan in alphabetical order of their names. A thread due for reset resets on its own thread turn, as that turn is carried out and before it fires, so a sibling that plans before it does not see the holds it will release.
- Every bot plans the same way. Every bot lists actions, ranks targets, searches and publishes its reach damage with the same code. No mod, action, side or turn is handled specially.
The shop’s reading of the arena’s terms
At the shop a thread scores its plans with the arena’s equation, searches with the arena’s search (Searching for plans) and picks by the arena’s rule, and its personality values mean the same thing at both stations. A shop bot’s first job is to fill its owner’s bin; its second is to charge the player’s Power Station hand. What each term reads at the shop on a generator board (docs/design/pip-sources.md § How a shop bot decides):
- Payoff is the worth of the pips the turn draws: those its action draws and those its drip takes after every shop thread turn until its next turn, each where the order of payment sends it. A pip paying a ticket is worth the slot’s want (
want_requestedfor a ticket the player assigned,want_autofor a rival’s automatic pick) over the ticket’s pip count, so a finished ticket is worth its slot’s want and a short ticket’s pips are worth more. A pip charging the hand is worthpip_base+pip_needwhere it pays an unpaid pip of the hand,pip_baseotherwise. A wasted pip is worth nothing (SDC-016). - Denial is the payoff a rival loses because of the plan, and threat the payoff the plan hands a rival. Both compare what each rival owner draws on the turn with what it draws on the board where the planning thread plays the turn it advertised instead, the floor the rivals planned on: the shortfall is denial, the excess threat. A turn that is the advertised one counts neither (SDC-017). A shop bot takes no damage, so the thread’s preservation weighs threat whole.
- Disruption plays as at the arena: a rival whose advertisement stands it on a tile it is not on as its turn begins plays none of the turn’s advertised actions and travels back to that tile with
travel, which moves it there in one action, so a rival held off its advertised dock loses the draws it advertised from there (SDC-018). - Interest pulls toward the docks of the generators whose stock holds a pip the team’s first unfinished ticket lacks, as a penalty for the walk to each from the tile the turn leaves the bot on, weighed by urgency and scaled by the floor’s larger side less one. The docks are fixed as the thread plans, as the arena fixes its points: a dock the plan’s draws leave holding nothing the team needs keeps the walk of the turn it stopped being wanted, so a walk that ends in a draw is not scored as stranding the bot. A team whose stocks hold nothing it needs declares no interest (SDC-019).
- Urgency grows with the battle’s arena rounds passed, as at the arena (SDC-020).
- Fade, immediacy, affinity and preservation are as in the arena. Affinity reads the colors of the shop mods.
A plan’s board plays every action through the same rules the station carries it out with, on a copy of the board (MSR-001, SDC-015). Between two of the thread’s turns it plays every thread turn the live shop carries out: its bot’s later threads’ advertised turns, every other shop bot’s in the shop’s turn order, and its earlier threads’ next turns as they chose them this turn, with a rival’s automatic pick into its empty ticket slots and the drip after each; the player’s assignments are never advertised, so a plan plays none. Before a thread turn where an arena round is projected to open, at the pace of the battle’s last whole round counted in the shop’s thread turns, each team’s ticket pool swaps its offer furthest left (SDC-021). An idle run’s step carries out no thread turn at the shop (PCE-002), so it brings no projected round nearer.
What the plan’s board knows. Played as certain: every chosen next turn, the drip, and the stocks it can see. Played as advertised: each rival’s turns and the fighters’ spends. Past the visible stock a generator restocks with nothing on a plan’s board, so no plan counts a pip nobody can see (SDC-021). Shop mods read the board through the shop view, rebuilt on every board the plan plays to, in the arena’s BoardView shape (SDC-014). What else a plan reads of a shop mod is its declaration, its candidates and the value they rank by; no scoring code names a mod (SEL-008).
Shop bots with the same owner are not rivals. Each plans on its own turn in the shop’s order, after the bots before it have acted and advertised (SDC-015).
Term Definitions
Each equation term and the engine terms around it. Every parameter is held to the range its row gives; for a term that is normalized, the range is after normalizing.
Foresight Parameters
| Term | Definition | Range |
|---|---|---|
| Foresight | The equation that generates a score for a plan. It is the same equation for every thread in the arena. It is a combination of Factual parameters and Personality parameters. | −unbounded – unbounded; at most 1 once normalized |
| Turns () | A plan is composed of sequential turns, representing actions taken as the thread walks its constellation. Plans start at , the current action that is about to occur. | 0 – unbounded |
| Fade | A turn-based scaling factor to account for uncertainty in the prediction of future turns (). | 0.5 – 1 |
| Immediacy | Personality bias away from planning. Same mechanism as fade: discounting the value of future turns in favor of the present. Do not confuse with fade: immediacy is a personality trait, fade is an uncertainty. | 0 – 1 |
| Urgency | A board-wide factor based on the number of rounds passed, scaling up payoff, denial and interest and scaling down threat as the battle drags on. | 0.5 – 0.8 |
| Affinity | The thread’s personality preference for an action. Threads can declare affinities for power colors or mods, that weigh on payoffs so the affinity mods look better than others. Affinity weights are normalized between all available mods at the star, by dividing by the highest, so that they always represent a relative preference. | 0 – 1 |
| Payoff | The stamina change the plan’s action causes: stamina rivals lose, minus stamina the planning bot and its allies lose, plus stamina they gain. Damage based on bot positioning and rival actions is accounted for in threat. Friendly fire counts as stamina loss. Overkill/overheal does not count. | −unbounded – unbounded |
| Denial | The value of the rival actions the plan prevents, except damage to the planning bot and its allies. Each is credited at its advertised payoff and denial, scaled by the share prevented. A plan earns denial for stopping a foe’s action only if the action would have landed. A strike aimed at a tile its target has already left would miss anyway, so stopping it earns nothing. | 0 – unbounded |
| Threat | The sum of projected damage on the planning bot and its allies, each weighted by preservation. | 0 – unbounded |
| Preservation | How much the planning thread cares about threat, scaled by each threatened bot’s missing stamina. | 0 – 1 |
| Projected damage | The most damage rivals could do to one bot’s tile on turn , read from their published reach damage. With the plan’s known costs and repairs, it sets projected stamina, which decides death. | 0 – unbounded |
| Interest | The pull toward each declared point of interest, if any. Implemented as a penalty for the walk to each point from the plan’s turn position, weighed by urgency. Normalized across all points of interest; they are competing for relative attention. | 0 and up; 3 when every walk is |
Terms
| Term | Definition |
|---|---|
| Death | When the bot’s stamina reaches 0. A plan predicts death when the bot’s projected stamina reaches 0, with projected damage taken on the tile it stands on after each turn’s movement. Turns after death occurs do not score in foresight. A rival’s death removes its threat and denies its other advertised actions. |
| Heedless | A thread that keeps the plans that predict its bot’s death and weighs them as any other plan (heedless: true in its personality; TCT-013, PIK-007). It is thread design, not tuning, and goes only on a bot with a reason not to care whether it lives. |
| Reach | The tiles an action can hit from where its bot stands: each tile where the action’s own targeting would accept a body, so line of sight, a dash’s lanes and posts limit it. Projected damage counts an action only on the tiles of its reach. |
| Move | A basic mod that allows the bot to reposition. Positioning allows later mods in the combo to payoff, or avoids advertised damage. Move does not have direct payoff, but since threat is calculated on the post-move tile, the avoidance of damage is scored. |
| Pass | Skips a turn. Passing spends no thread energy and steps to the next star. |
| Reset | When a thread reaches the end of its walk, it returns to its first star, refills its thread energy, and clears its previous mod activation states, then fires or passes from its first star on the same turn: no reset spends a turn. A plan continues through the reset, and it plays as a reset on every board. A turn that resets carries its first star’s reach damage. |
| Advertised turns | The number of turns every plan covers and every thread advertises. It is the same for all threads in a game, default 4. |
| Board template | The tiles a fire at one target covers: the target alone, a ring around it, a ray toward it, or the whole board. With the action’s value it ranks the action’s targets, so the search plays the likely best first. |
| Value | A simple function of what an action’s board template covers at a target, such as the stamina the rivals there hold or the stamina the bot’s side has lost there. It orders targets and is never part of a score. |
| Plan budget | The board copies, of the arena or the shop, one thread’s search may play on before it stops working on alternatives, default 120. The plan from every first action is completed whatever the budget. It is the same for all threads in a game. |
| Advertisement | Each thread’s chosen plan, published turn by turn with the tile the bot stands on, the action, its target, the payoff and denial the plan measured, and the thread’s reach damage. A bot advertises as soon as it enters, one advertisement per thread, and advertises again when it is stunned or changes sides. Every advertisement covers the bot’s next advertised turns. After a thread fires, it advertises the rest of its plan followed by a pass on its next star, or, where its walk ends, a pass on its beginning star. A stunned bot’s advertisement starts with the turn it loses and drops its last turn. |
| Reach damage | Published with each advertised turn: each damaging action at that turn’s star, with its reach and its blows before defenses, measured on a plain body and on each rival as it stands. A rival reads its own blows where they differ from the plain body’s, and any other bot reads the plain body’s. Computed when the thread advertises. |
| Disruption | A plan disrupts a foe by taking its turn, changing its side, or leaving it off its advertised tile. Off its tile, the foe steps back toward it with its move basic, each such turn’s advertised action denied, and plays its advertised turns again once back; a root holds it off until the root ends. A turn taken from it, such as a stun, keeps it on the same star: it plays the lost turn from that star on its next turn and moves on from there. A foe brought to the plan’s side is denied every remaining advertised action. On each turn a disrupted foe threatens with the reach damage published for the star it would act from that turn. |
| (De)Buff | A bonus or penalty that persists on the bot. It counts through payoff, threat or denial on the plan turns it lasts. |
| Stun | Denies a bot its next round of thread evaluations: each of its threads plays a lost thread turn, and the stun ends after the last. It disrupts the bot, so on a plan’s board the lost turn is denied and the bot plays the rest of its advertisement a turn behind. The stunned bot advertises again on its stunned turn, with no action that turn. Any state that takes a bot’s turn follows this rule. |
| Stress | A type of debuff that needs to stack before it causes any effect. Each stress a plan adds to a rival’s pile is scored as denial, worth a constant 0.3; stress that explodes an armed pile counts only through its stun. |
| Rubble | A terrain block with stamina. Rubble has no side. It never threatens, and damage to rubble does not count toward payoff. Breaking rubble is worth only what it lets the plan’s later turns do. |
| Allies | Bots in arena that share allegiance with the planning bot. Spawning allies is credited for the stamina they bring, in payoff. For simplicity in plan scoring, turns after an ally is created are credited 1 denial, to account for their potential actions. A rival that changes sides joins as an ally, credited the same way, and its advertised actions for its old side count as denial. |
| Decoy | A summoned ally with no thread (SUM-001): its summoner’s plan picks its tile. It counts as no ally in scoring: summoning it is not payoff, and damage to it is not threat. Rivals count damage to it as payoff. It never threatens. |
What foresight leaves to the rules
Foresight is the whole of a thread’s decision; no behavior is special-cased outside it. The rules keep what is not a decision:
- Resolvers and targeting rules, live and on a plan’s board. They decide which targets are valid, and their geometry is the geometry reach and threat read. The plan picks among valid targets. A taunted bot aims every targeted ability that reaches its taunter’s side at the taunter (TGT-003), and every area ability it aims at that side covers the taunter (TGT-008). An action no plan aims keeps the target its own rule gives, such as a retaliation answering its attacker; where a rule has a choice, it takes the first valid target it lists.
- Board facts: deflect charges (each body’s guard charges and ward, which the rules apply to every blow a plan’s board plays), the stress ladder, supply bonuses and walk placement. None of them is part of payoff.
Derived specs — engine/bbsb_engine/test/constellation/threads_spec.yaml · TCT thread-catalog · FRS foresight · PSR plan-search · PIK plan-pick
· PBD plan-board · PAY payoff · DNL denial · PDM threat
· ADV advertisement · HDL coordination; engine/bbsb_engine/test/combat/combat_spec.yaml · TGT targets, MTV-005,
the goal as a point of interest, and IDL-008, idle bots advertise no plan; engine/bbsb_engine/test/mods/mods_spec.yaml · MSR payoff-boards; engine/bbsb_engine/test/shop/shop_spec.yaml · SDC shop-decisions.