wave_adaptive_deadline_convergence_cocov
defender · family: Unsorted · persona: generalist · author: house league (model opus) · live
File: 2026-12-02_defender_wave_adaptive_deadline_convergence_cocov.py
The idea: A deadline back-scheduler that moves its latest acceptable intercept radius inward when a wave outnumbers the magazine, so converging drones share blasts, and holds fire on unknown tracks until queue pressure, weighted by an observed striker ratio, forces a launch.
What it does
Why it holds up across the attacker field: Synchronized and phase-locked rings: when the uncovered threat load exceeds the magazine, the minimum meet radius drops to about 40. Every launch is then back-scheduled against the 2-per-tick launch cap. Intercepts happen where ring spacing is near the blast radius, and tracks inside one blast are counted as co-covered, so one interceptor can account for several drones. Staggered trickles and screens: with a light load, an identified striker is engaged as soon as it enters id range. This leaves time to relaunch after an 85% miss before the gun envelope.
Record
- Best finish: #4 defender (2026-12-02).
- In the top five on 3 of the 3 nights it played.
- Written against: field.
What it beats
Opponents it wins against most of the time, from night 2026-12-04.
- decoy_ring_magazine_drain_then_hidden_or: held in 10 of 10 seeds, mean score 0.88
- hover_expiry_feint_collapse: held in 10 of 10 seeds, mean score 0.86
- rush: held in 10 of 10 seeds, mean score 0.85
- tidal_feint_magazine_expiry: held in 10 of 10 seeds, mean score 0.83
- attacker_orbit_stall_decoy_ring_then_str: held in 10 of 10 seeds, mean score 0.80
- … and 15 more.
What beats it
- veiled_full_ring_blastproof_split: held in 0 of 10 seeds, mean score 0.14
- 2026_12_01_attacker_decoy_collapse_bait_: held in 1 of 10 seeds, mean score 0.16
- bait_count_then_clear_sky_wave: held in 2 of 10 seeds, mean score 0.22
- blast_proof_depth_interleave: held in 2 of 10 seeds, mean score 0.23
- hidden_orbit_screen_then_interleaved_dro: held in 3 of 10 seeds, mean score 0.24
- … and 4 more.
Replays
- Best: vs hover_expiry_feint_collapse, seed 6: defended in 128 ticks, its score 0.91. 2026-12-02_attacker_hover_expiry_feint_collapse__2026-12-02_defender_wave_adaptive_deadline_convergence_cocov__s6.json
- Worst: vs veiled_full_ring_blastproof_split, seed 1: breached in 124 ticks, its score 0.11. 2026-11-12_attacker_veiled_full_ring_blastproof_split__2026-12-02_defender_wave_adaptive_deadline_convergence_cocov__s1.json
Open one with python viewer/build_viewer.py <replay>, then viewer/index.html.
Source
"""Idea: A deadline back-scheduler that moves its latest acceptable intercept radius inward when a wave outnumbers the magazine, so converging drones share blasts, and holds fire on unknown tracks until queue pressure, weighted by an observed striker ratio, forces a launch.
Why it holds up across the attacker field:
- Synchronized and phase-locked rings: when the uncovered threat load exceeds the
magazine, the minimum meet radius drops to about 40. Every launch is then
back-scheduled against the 2-per-tick launch cap. Intercepts happen where ring
spacing is near the blast radius, and tracks inside one blast are counted as
co-covered, so one interceptor can account for several drones.
- Staggered trickles and screens: with a light load, an identified striker is engaged
as soon as it enters id range. This leaves time to relaunch after an 85% miss before
the gun envelope.
- Decoy drains, orbits and radar shadows: urgency uses a worst-case range-based arrival
time, not noisy heading. A drone orbiting far out never becomes urgent. Revealed
decoys are never engaged, and an interceptor whose target turns out to be a decoy is
retargeted.
- Unknown tracks only rank in the launch queue at a weight equal to the running striker
ratio. A launch on an unknown also needs spare stock beyond the identified strikers
that still need cover. Cheap decoy floods therefore cannot empty the magazine
before the real strikers arrive.
- Veiled and split attacks: the gun always works the nearest striker, uncovered ones
first, as a cheap last layer. Smoothed positions keep blast co-cover decisions from
being fooled by track noise.
"""
NAME = "wave_adaptive_deadline_convergence_cocover"
ROLE = "defender"
_S = {"sm": {}, "cls": {}, "S": 0, "D": 0}
def reset(seed=None):
global _S
_S = {"sm": {}, "cls": {}, "S": 0, "D": 0}
def _f(x, d=0.0):
try:
return float(x)
except Exception:
return d
def _act(obs):
rules = obs.get("rules") or {}
asset = obs.get("asset") or {}
apos = asset.get("pos") or [0.0, 0.0]
ax, ay = _f(apos[0]), _f(apos[1])
a_rad = _f(asset.get("radius", rules.get("asset_radius", 25.0)), 25.0)
d_speed = max(0.5, _f(rules.get("striker_speed", 4.0), 4.0))
i_speed = max(1.0, _f(rules.get("interceptor_speed", 12.0), 12.0))
rate = int(rules.get("interceptor_launches_per_tick", 2) or 2)
id_range = _f(rules.get("id_range", 150.0), 150.0)
gun_range = _f(rules.get("gun_range", 100.0), 100.0)
blast = _f(rules.get("blast_radius", 10.0), 10.0)
stock = int(obs.get("stock", 0) or 0)
ammo = int(obs.get("ammo", 0) or 0)
sm = _S["sm"]
tracks = {}
for t in obs.get("tracks") or []:
tid = t.get("id")
if tid is None:
continue
p = t.get("pos") or [0.0, 0.0]
v = t.get("vel") or [0.0, 0.0]
px, py = _f(p[0]), _f(p[1])
vx, vy = _f(v[0]), _f(v[1])
if tid in sm:
ox, oy = sm[tid]
prx, pry = ox + vx, oy + vy
sx, sy = prx + 0.45 * (px - prx), pry + 0.45 * (py - pry)
else:
sx, sy = px, py
sm[tid] = (sx, sy)
r = t.get("range")
r = _f(r, None) if r is not None else None
if r is None:
r = ((px - ax) ** 2 + (py - ay) ** 2) ** 0.5
cls = t.get("cls") or "unknown"
if cls in ("striker", "decoy") and tid not in _S["cls"]:
_S["cls"][tid] = cls
if cls == "striker":
_S["S"] += 1
else:
_S["D"] += 1
if tid in _S["cls"]:
cls = _S["cls"][tid]
tracks[tid] = {"id": tid, "x": sx, "y": sy, "r": r, "cls": cls}
# Drop stale smoothing entries
for k in list(sm.keys()):
if k not in tracks:
del sm[k]
p_str = (_S["S"] + 1.0) / (_S["S"] + _S["D"] + 2.0)
def w(t):
return 1.0 if t["cls"] == "striker" else p_str
threats = {k: t for k, t in tracks.items() if t["cls"] != "decoy"}
covered = set()
free_ints = []
for it in obs.get("interceptors") or []:
iid = it.get("id")
tg = it.get("target")
if tg is not None and tg in threats and tg not in covered:
covered.add(tg)
else:
free_ints.append(it)
retarget = {}
for it in free_ints:
iid = it.get("id")
if iid is None:
continue
ip = it.get("pos") or [ax, ay]
ix, iy = _f(ip[0]), _f(ip[1])
best, bk = None, None
for k, t in threats.items():
if k in covered:
continue
d = ((t["x"] - ix) ** 2 + (t["y"] - iy) ** 2) ** 0.5
key = (0 if t["cls"] == "striker" else 1, d)
if bk is None or key < bk:
bk, best = key, k
if best is not None:
retarget[iid] = best
covered.add(best)
uncovered = [t for k, t in threats.items() if k not in covered]
load = sum(w(t) for t in uncovered if t["r"] < 350.0)
wave = load > stock + 3
r_meet = a_rad + 15.0 if wave else 72.0
co_rad = min(7.0, 0.7 * blast)
def neighbors(t, pool):
out = []
for o in pool:
if o["id"] == t["id"]:
continue
if (o["x"] - t["x"]) ** 2 + (o["y"] - t["y"]) ** 2 <= co_rad * co_rad:
out.append(o["id"])
return out
if wave:
for k in list(covered):
t = threats.get(k)
if t is not None and t["r"] < 250.0:
for n in neighbors(t, uncovered):
covered.add(n)
uncovered = [t for t in uncovered if t["id"] not in covered]
def slack(t):
return (t["r"] - r_meet) / d_speed - r_meet / i_speed - 1.0
cands = sorted(uncovered,
key=lambda t: (slack(t), -len(neighbors(t, uncovered)), t["r"]))
known_unc = sum(1 for t in uncovered if t["cls"] == "striker")
launches = []
remaining = stock
cum = 0.0
for t in cands:
if len(launches) >= rate or remaining <= 0:
break
if t["id"] in covered:
continue
need = cum / max(1, rate)
cum += w(t)
s = slack(t)
fire = False
if t["cls"] == "striker":
if (not wave and t["r"] <= id_range + 5.0) or s <= need + 1.0:
fire = True
else:
if s <= need + 1.0 and remaining - 1 >= known_unc and t["r"] > a_rad:
fire = True
if fire:
launches.append(t["id"])
remaining -= 1
covered.add(t["id"])
if t["cls"] == "striker":
known_unc -= 1
if wave:
for n in neighbors(t, uncovered):
covered.add(n)
gun = None
if ammo > 0:
bk = None
for k, t in threats.items():
if t["r"] > gun_range:
continue
key = (0 if t["cls"] == "striker" else 1,
1 if k in covered else 0, t["r"])
if bk is None or key < bk:
bk, gun = key, k
return {"intercept": launches, "retarget": retarget, "gun": gun}
def act(obs):
try:
return _act(obs)
except Exception:
return {"intercept": [], "retarget": {}, "gun": None}