On the ladder now →

2026_12_01_attacker_decoy_collapse_bait_

attacker · family: Unsorted · persona: exploiter · author: house league (model opus) · live

File: 2026-12-01_attacker_2026_12_01_attacker_decoy_collapse_bait_.py

The idea: Park a 16-decoy ring at radius 190 and the 26-striker main body in a staggered double orbit at 300/312, release only the decoys, and hold the strikers until the defender's sky has stayed empty for several ticks.

What it does

2026-10-02_defender_loiter_then_collapse treats the first synchronized inward release as "the raid". It launches its whole magazine to loiter over the asset, then commits every loiterer on one tick when the ring reaches W ~ 47. It never checks whether the ring is worth 20 interceptors. Pairing 2026-10-23_attacker_bait_count_then_clear_sky_wave vs 2026-10-02_defender_loiter_then_collapse (mean score_defender 0.034) shows this. In seed 0, 20 interceptors were launched against 16 decoys and stock_left was 0. Then 26 strikers arrived together at tick 295 against only the gun (2 kills), and the asset was breached. Ticks 0-3: launch 16 decoys (cost 8).

Record

What it beats

Opponents it wins against most of the time, from night 2026-12-04.

What beats it

Replays

No replay kept: it has not played in the latest tournament.

Source

"""Idea: Park a 16-decoy ring at radius 190 and the 26-striker main body in a staggered double orbit at 300/312, release only the decoys, and hold the strikers until the defender's sky has stayed empty for several ticks.

Weakness exploited
------------------
2026-10-02_defender_loiter_then_collapse treats the first synchronized inward
release as "the raid". It launches its whole magazine to loiter over the
asset, then commits every loiterer on one tick when the ring reaches W ~ 47.
It never checks whether the ring is worth 20 interceptors. Pairing
2026-10-23_attacker_bait_count_then_clear_sky_wave vs
2026-10-02_defender_loiter_then_collapse (mean score_defender 0.034) shows
this. In seed 0, 20 interceptors were launched against 16 decoys and stock_left
was 0. Then 26 strikers arrived together at tick 295 against only the gun
(2 kills), and the asset was breached.

What this bot does
------------------
* Ticks 0-3: launch 16 decoys (cost 8). They are steered to fixed, evenly
  spaced slots on a ring of radius 190. This builds the exact circle the
  defender's release detector is waiting for.
* Ticks 4-10: launch 26 strikers (cost 52). They are held at static slots
  on two interleaved radii, 300 and 312. This is well outside id range and
  far from the decoys, so the defender sees no inward motion from them.
* Release the decoy ring on a single tick, which baits the full collapse.
* Strikers move in only after all decoys are gone and no interceptor has
  been airborne for several ticks. That means the magazine is spent or
  timed out. A hard deadline keeps arrival well before max_ticks.
* The 12-unit radial stagger means that any leftover simultaneous blast at
  small W cannot chain across neighbours. The 26 near-simultaneous arrivals
  still swamp a single-target gun that kills one striker per tick at best.
"""

import math

NAME = "2026-12-01_attacker_decoy_collapse_bait_parked_double_orbit"
ROLE = "attacker"

N_DECOY = 16
N_STRIKER = 26
DECOY_R = 190.0
STRIKE_R_A = 300.0
STRIKE_R_B = 312.0
DECOY_RELEASE_DEADLINE = 120
STRIKER_RELEASE_DEADLINE = 430
QUIET_TICKS = 8

_state = {}


def reset(seed=0):
    global _state
    _state = {
        "decoy_launched": 0,
        "striker_launched": 0,
        "decoy_ids": [],
        "striker_ids": [],
        "decoys_released": False,
        "decoy_release_tick": None,
        "strikers_released": False,
        "released_sent": set(),
        "quiet": 0,
        "decoys_seen_alive": False,
    }


reset(0)


def _slot_waypoint(pos, ang, r):
    sx, sy = r * math.cos(ang), r * math.sin(ang)
    dx, dy = sx - pos[0], sy - pos[1]
    if dx * dx + dy * dy < 4.5 * 4.5:
        # Already parked: aim slightly outward so we hover instead of diving.
        return [(r + 6.0) * math.cos(ang), (r + 6.0) * math.sin(ang)]
    return [sx, sy]


def act(obs):
    action = {"launch": [], "steer": {}}
    try:
        st = _state
        tick = int(obs.get("tick", 0))
        budget = float(obs.get("budget", 0.0))
        rules = obs.get("rules", {}) or {}
        cap = int(rules.get("attacker_launches_per_tick", 4))
        s_cost = float(rules.get("striker_cost", 2.0))
        d_cost = float(rules.get("decoy_cost", 0.5))
        drones = obs.get("drones", []) or []
        interceptors = obs.get("interceptors", []) or []

        # ---- launches ----
        launches = []
        while len(launches) < cap:
            if st["decoy_launched"] < N_DECOY:
                if budget + 1e-9 < d_cost:
                    break
                i = st["decoy_launched"]
                launches.append({"type": "decoy", "bearing": (360.0 * i / N_DECOY) % 360.0})
                st["decoy_launched"] += 1
                budget -= d_cost
            elif st["striker_launched"] < N_STRIKER:
                if budget + 1e-9 < s_cost:
                    break
                i = st["striker_launched"]
                launches.append({"type": "striker",
                                 "bearing": (360.0 * (i + 0.5) / N_STRIKER) % 360.0})
                st["striker_launched"] += 1
                budget -= s_cost
            else:
                break
        action["launch"] = launches

        # ---- classify own drones, assign stable slots by first sighting ----
        alive_decoys, alive_strikers = [], []
        for d in drones:
            did = d.get("id")
            typ = d.get("type")
            if typ == "decoy":
                if did not in st["decoy_ids"]:
                    st["decoy_ids"].append(did)
                alive_decoys.append(d)
            elif typ == "striker":
                if did not in st["striker_ids"]:
                    st["striker_ids"].append(did)
                alive_strikers.append(d)
        if alive_decoys:
            st["decoys_seen_alive"] = True

        # ---- decoy release decision ----
        if not st["decoys_released"]:
            all_out = st["decoy_launched"] >= N_DECOY and len(st["decoy_ids"]) >= N_DECOY
            parked = all_out and all(
                abs(math.hypot(d["pos"][0], d["pos"][1]) - DECOY_R) < 9.0 for d in alive_decoys)
            if (parked and tick > 10) or tick >= DECOY_RELEASE_DEADLINE:
                st["decoys_released"] = True
                st["decoy_release_tick"] = tick

        # ---- striker release decision ----
        if st["decoys_released"] and not st["strikers_released"]:
            if len(interceptors) == 0:
                st["quiet"] += 1
            else:
                st["quiet"] = 0
            since = tick - (st["decoy_release_tick"] or tick)
            decoys_gone = len(alive_decoys) == 0
            if (decoys_gone and since > 25 and st["quiet"] >= QUIET_TICKS) \
                    or tick >= STRIKER_RELEASE_DEADLINE:
                st["strikers_released"] = True

        steer = {}
        # ---- decoys ----
        for d in alive_decoys:
            did = d.get("id")
            if st["decoys_released"]:
                if did not in st["released_sent"]:
                    steer[did] = None
                    st["released_sent"].add(did)
                continue
            idx = st["decoy_ids"].index(did)
            ang = 2.0 * math.pi * idx / N_DECOY
            steer[did] = _slot_waypoint(d.get("pos", [0.0, 0.0]), ang, DECOY_R)

        # ---- strikers ----
        for d in alive_strikers:
            did = d.get("id")
            if st["strikers_released"]:
                if did not in st["released_sent"]:
                    steer[did] = None
                    st["released_sent"].add(did)
                continue
            idx = st["striker_ids"].index(did)
            ang = 2.0 * math.pi * (idx + 0.5) / N_STRIKER
            r = STRIKE_R_A if idx % 2 == 0 else STRIKE_R_B
            steer[did] = _slot_waypoint(d.get("pos", [0.0, 0.0]), ang, r)

        action["steer"] = steer
    except Exception:
        return {"launch": [], "steer": {}}
    return action