Megabots — Combat Flow
Order of operations for a single battle. Calculations are listed with their inputs only —
concrete formulas live in combat-formulas.md
(see notes.md for stat/move definitions).
Participants
- PIL-A / PIL-B — the two Pilots (players)
- BOT-A / BOT-B — their Megabots
- ENGINE — combat engine (state, calculations, rolls)
Zone Model
The battlefield is a shared distance track with one marker: CQ ↔ Mid ↔ Long
— the relative distance between the two bots. Battle starts at Mid.
- Advance moves the marker toward CQ; retreat toward Long. Mobility 2–3 may
move two zones in one turn (a two-step option is offered only when two full
steps of track remain — chasers can close Long→CQ in one turn).
- Zone changes resolve in priority order within the turn — so "both retreat"
from Mid means: first mover shifts Mid→Long, then the second mover's retreat is
already at the edge and clamps.
- Clamp & proceed: a zone change that can't happen at resolution time fizzles,
but the attack still fires from the current zone. Direction riders
("+X if retreating") trigger only if the zone actually changed.
- Track edges filter selection: at Long, retreat direction options are greyed
out; at CQ, advance options are.
- Off-balance resolution (round 19): if the first mover shifts the track so the
second mover's attack now fires from a zone its mobility gate disallows, the
attack still resolves but off-balance: −15 hit and ×0.85 damage [tunable].
(Full NOT-POSSIBLE enforcement was A/B'd: it inverts the meta into kiter
monoculture; zero enforcement lets mobility-1 melee ignore the gates entirely —
the audit measured 43–47% of tank damage as gate-illegal.)
- Turn-cap sudden death (round 19): if a battle reaches the 40-turn cap, the
judges award the win to the bot with the higher HP fraction (exact tie = draw).
Draw-forcing stall was a measured exploit (85–90% forced draws in waterlog
mirrors); now a stall must also win the HP race.
Wheel Composition
Arms and legs each put 2 moves on the wheel. A head puts 1 — it carries
two and you load one of them before the fight. So a full build shows 5.
Any part slot may be left empty (2 fewer wheel moves, weight saved). Cobra
builds are forcibly armless — a cobra head requires a lizard chassis + cobra
legs — and so that frame is not left short, a cobra head loads both of its
moves. A cobra still shows 4.
Top-Level Turn Loop
PIL-A BOT-A ENGINE BOT-B PIL-B | | | | | ═══╪═══════════════╪═══════ TURN START ═══════════════════╪═══════════════╪═══ | | | | | | | read state | read state | | | |<-----------------|------------------>| | | | (charges, mobility, parts, | | | | active effects, zone) | | | | | | | | | [C1] MOVE AVAILABILITY | | | | (computed per pilot) | | | | | | | | move wheel UI (6 moves, | move wheel UI (6 moves, | | each enabled/disabled) | each enabled/disabled) | |<---------------------------------|--------------------------------->| | | | | | | select: move OR inspect, | select: move OR inspect, | | + advance / retreat / hold | + advance / retreat / hold | |--------------------------------->|<---------------------------------| | | | | | | | [C2] PRIORITY CALC | | | | (computed ONCE per turn; | | | | tie -> random roll) | | | | | | | | | ┌──────────────┴────────────────┐ | | | | │ RESOLVE MOVE: first mover │ | | | | │ (see MOVE RESOLUTION below) │ | | | | └──────────────┬────────────────┘ | | | | | | | | | ── KO CHECK: defender at 0 HP? ── | | | | YES -> COMBAT ENDS IMMEDIATELY | | | | (second mover never acts) | | | | | | | | | revalidate second mover's move | | | | (validity recomputed, priority | | | | is NOT recomputed) | | | | | | | | | ┌──────────────┴────────────────┐ | | | | │ RESOLVE MOVE: second mover │ | | | | │ (see MOVE RESOLUTION below) │ | | | | └──────────────┬────────────────┘ | | | | | | | | | ── KO CHECK: defender at 0 HP? ── | | | | YES -> COMBAT ENDS IMMEDIATELY | | | | | | | ═══╪═══════════════╪═══════ TURN END — loop to TURN START ╪═══════════════╪═══
Notes on selection:
- Inspect replaces the move for that turn. It burns the turn unless the enemy is
below half health (then it is free and the pilot still selects a move).
Inspect gives a full rundown of all the enemy's part stats. Double inspect is
not possible — once inspected, the option is no longer available.
- If no move is valid (all disabled by effects / insufficient charges), a weak
Struggle fallback is always available: 10 atk, no elemental type, no CC,
costs 0 charges.
- Vent replaces the move for that turn: the bot skips acting, burns 5 HP
(the core runs hot when force-cycled), and recovers 3 charges. A
plant-stacked bot cannot vent — vines clog the vents — and **neither can a held
bot (no venting in a clinch); a vent voided mid-turn simply fizzles. Ice
cores vent at no HP cost** — cold cores run cool. Venting breaks the synergy
chain.
- Direction options are filtered per move (e.g. grapple cannot retreat,
Charge Headbutt cannot be used in retreat) and per track edge (no retreat
at Long, no advance at CQ).
Move Resolution (per bot, runs once for each mover)
ATTACKER ENGINE DEFENDER
| | |
| [C3] PREMOVE CALC | |
|<-----------------------------|----------------------------->|
| (reads both bots' state) | |
| | |
| result: HIT | DEFLECTED | MISS | NOT POSSIBLE |
| (DEFLECTED = full resolution, but damage, elemental CC |
| chance, and active-effect chances are halved AFTER |
| each is calculated) |
| | |
────┼── NOT POSSIBLE ──────────────┼──────────────────────────────┼────
| nothing happens: no zone change, no charge cost. |
| Resolution ends. | |
| | |
────┼── MISS ──────────────────────┼──────────────────────────────┼────
| zone change still applied ([C4] ordering) |
| skip damage / CC / effects, go directly to [C8] charges |
| | |
────┼── HIT / DEFLECTED ───────────┼──────────────────────────────┼────
| | |
| (a) PRE-ATTACK ZONE CHANGE, if [C4] says move-then-attack |
|------------------------------> |
| | |
| (b) [C5] DAMAGE CALC | |
| (DEFLECTED: halve result after calculation) |
| |------- apply damage -------->|
| | |
| >> KO CHECK: 0 HP? -> COMBAT ENDS IMMEDIATELY << |
| | |
| (c) [C6] ELEMENTAL CC CHANCE |
| (DEFLECTED: halve chance after calculation) |
| |---- roll; apply CC if ------>|
| | roll succeeds |
| | |
| (d) [C7] ACTIVE EFFECT TRIGGER CHANCES |
| (DEFLECTED: halve chances after calculation) |
| one chance per candidate effect; |
| roll every non-zero chance; |
| if multiple succeed -> apply ONLY the |
| highest-chance one |
| |---- apply winning effect --->|
| | |
| (e) POST-ATTACK ZONE CHANGE, if [C4] says attack-then-move|
|------------------------------> |
| | |
────┼── ALL PATHS except NOT POSSIBLE ────────────────────────────┼────
| | |
| (f) [C8] CHARGE COST CALC | |
|<----- deduct charges --------| |
| (full cost on HIT, DEFLECTED, and MISS) |
| | |
[C4] Zone Change Ordering (direction × move type)
| Direction | Move types | Order |
|---|---|---|
| Advancing | grapple, cut, strike, beam, breath, ensnare, hex | move zone → attack |
| Retreating | cut, strike | attack → move zone |
| Retreating | beam, breath, ensnare, hex | move zone → attack |
| Retreating | grapple | not allowed |
| Hold | any (beam explicitly may attack without a zone change) | attack only |
Ensnare is only usable from mid or long range — since it attacks after moving, an
advance that lands in CQ is invalid (so it can only advance from long range).
Hex moves (pure CC) run the same resolution but **skip step (b) — no damage is
dealt and no KO check occurs**; they proceed straight to elemental CC (c) and active
effects (d). Their zone-change riders (extra debuff, or a one-turn self-buff) apply
during (c)/(d) based on the direction chosen.
Calculations (inputs only — formulas TBD)
[C1] Move Availability (per move, at selection time)
- Mobility sufficient for the zone change the move needs — after active effects
(e.g. water CC lowering mobility, "held" blocking zone change)
- Active effects that disable the move (disabled part, held, etc.)
- Charge count vs the move's cost
- Also filters the advance/retreat options available per move
[C2] Priority (once per turn, after both selections)
- Bot total weight
- Bot mobility (mobility 3 grants a higher priority value)
- Active effects applied to the bot
- Secondary effects from the selected move (e.g. "+20 priority retreating")
- Higher value acts first; tie → random roll
[C3] Premove (immediately before each bot's move resolves)
Produces one of: HIT / DEFLECTED (half damage) / MISS / NOT POSSIBLE
- Zone + move-type rules (long-range breath miss %, beam vs opponent mobility,
CQ breath debuff, mobility gates per zone)
- Defender mobility (miss chance) and durability (deflect chance)
- Active effects on both bots
- Attacker charge count and part state (insufficient charges / disabled part
→ NOT POSSIBLE)
[C5] Damage
- \+ Atk of the move
- \+ Atk of the part
- \+ Buffs from move or part secondary effects
- − Defender's durability
- DEFLECTED: halve the result after calculation
[C6] Elemental CC Chance
- Attacking part
- Selected move (its CC atk, direction bonuses)
- Defender's durability
- DEFLECTED: halve the chance after calculation
- Constraint: elemental CC can only be applied by moves matching the attacker's
core element
[C7] Active Effect Trigger Chance (one per candidate effect)
- Elemental CC chances
- Move active-effect chances
- Part-type active-effect chances
- Current active effects already on the defender
- Defender's durability (as a reducer of the chance)
- DEFLECTED: halve each chance after calculation
- Roll each non-zero chance; if several succeed, apply only the highest-chance one
[C8] Charge Cost
- Base usage of the move
- Secondary effects from the move or parts
- Active effects on the attacking bot (e.g. lingering charge debuff after a
grapple ends)
- Paid in full on HIT, DEFLECTED, and MISS; nothing on NOT POSSIBLE
Standing Rules
- KO ends combat immediately — checked right after damage application of every
move; a KO'd bot's pending move never resolves.
- Priority is locked once per turn; validity is recomputed before the second
mover acts (via its [C3] premove).
- Effects have no automatic expiry — elemental CC and active effects persist
until the battle ends, a move undoes them, or a move ticks them down.
- Struggle — always-available 0-charge fallback when nothing else is valid.
- Synergy state — each bot tracks its own last move (type, element, landed?,
CC applied?). A move whose synergy trigger matches the bot's previous landed move
gets its combo payoff (evaluated in [C5], [C6], or [C7] depending on payoff class);
misses, NOT POSSIBLE, inspect, and Struggle break the chain.
- DEFLECTED runs the full resolution, but the damage ([C5]), elemental CC
chance ([C6]), and each active-effect trigger chance ([C7]) are halved after
they are calculated.