Submitting a bot to Swarm Colosseum

Submissions are not open yet. The sandbox review planned for 2026-10-24 has not happened, and submissions open only after it passes. This page will give the new date once it does. Until then there is no way to send a file in, but everything below already works on your own machine, so you can get a bot ready.

Swarm Colosseum is a strategy game played by programs. You write one Python file. Every night it plays every bot on the other side, ten times each, and its results go on a public ladder. It's a game on a blank 2D map with made-up units, and it doesn't model any real equipment or place.

The game in one minute

Your file

One .py file with exactly these at the top level:

"""Idea: one sentence saying what your bot does differently. This line shows up on the
site, so make it good."""

NAME = "slow_pincer"        # 2-40 characters: lowercase letters, digits, _
ROLE = "attacker"           # or "defender"


def reset(seed):            # optional: called once before each match
    pass


def act(obs):               # called every tick; must return an action dict
    return {"launch": [], "steer": {}}

act gets one argument, obs (what your bot can see this tick), and returns a dictionary saying what to do. That's the whole interface.

If you're the attacker

obs contains:

keywhat it is
tickthe current tick, 1 to 600
budgetcredits you have left
asset{"pos": [0, 0], "hp": 30, "radius": 25}
dronesyour drones: {"id", "type", "pos", "vel", "waypoint"} each
interceptorspositions [x, y] of the defender's interceptors in the air
rulesevery number in the game, e.g. obs["rules"]["striker_cost"]

Return:

{"launch": [{"type": "striker", "bearing": 90.0}],   # up to 4 launches per tick
 "steer": {12: [100.0, -40.0]}}                      # optional: drone 12 flies there first

bearing is in degrees: 0 is to the right (+x), 90 is up (+y). A drone flies to its waypoint if it has one, then straight at the asset. Set a waypoint to None to clear it.

If you're the defender

obs contains:

keywhat it is
tickthe current tick
assetas above, with the current hp
tracksradar contacts: {"id", "pos", "vel", "range", "cls"} each. Positions are a bit noisy. cls is "unknown" until the drone is inside 150 u, then "striker" or "decoy".
interceptorsyours in the air: {"id", "target", "pos", "age"}
stockinterceptors left to launch
ammogun rounds left
rulesevery number in the game

Return:

{"intercept": [7, 9],        # launch at tracks 7 and 9 (up to 2 launches per tick)
 "retarget": {3: 11},        # interceptor 3 now chases track 11
 "gun": 7}                   # fire one round at track 7, or None

Rules for act

What you can and can't use

Allowed imports (and nothing else): math, random, itertools, functools, collections, heapq, bisect, statistics, dataclasses, typing, enum, operator.

Not allowed, and the checker will tell you which line it found:

Why so strict? Your bot runs on our machine next to everyone else's. The checks catch honest mistakes with a clear message, and every bot also runs inside a locked box: no internet, no files, 128 MB of memory, half a CPU core.

Limits

file size64 KB
time per act call2 seconds (hard limit)
memory128 MB
CPUhalf a core
network, files, other programsnone

Before you start

  1. git clone <this repo> && cd swarm-colosseum
  2. Python 3.9 or newer. There's nothing to pip install: the checker uses only the standard library. If python isn't found, type python3 instead.
  3. Docker installed and running. The test match in step 2 below runs inside it, and the first run downloads the python:3.12-slim image.
  4. Save the bot from "A complete first bot" at the end of this page as my_bot.py in that folder, then run the command below.

Submitting

Once submissions open, you send a bot as a pull request that adds one file:

bots/submitted/pr/<your login>/<NAME>.py

<your login> is your GitHub login in lowercase, and the file name is your bot's NAME plus .py. One pull request can hold one attacker and one defender, and nothing else: if it changes any other file, the check fails. Send other changes as a separate pull request. To update a bot, change the same file in a new pull request.

An automatic check runs on the pull request. It only reads your file, the same checks as step 1 below, plus the abstract-only rule, and it tells you which line is wrong. It never runs your code. A maintainer then reviews the code and merges it. After that, the league's machine runs the checks again, then the test match in the locked box (steps 2 and 3).

You can run the same checks on your own machine first:

python -m colosseum.submit my_bot.py --side attacker --author yourhandle

Your handle is 2–24 characters: lowercase letters, digits, _ and -.

What happens:

  1. Checks. Your file is read (not run) and checked against the rules above. If something's wrong you get a plain-English reason with a line number, and nothing is kept.
  2. Test match. Your bot plays one match against a built-in bot, inside the locked box. If it crashes on every tick or stops answering, it's rejected, with the reason.
  3. Accepted. It's saved as yourhandle__yourbotname with a record of who sent it, when, and a fingerprint of the file (its SHA-256). Sending the exact same file again does nothing. Sending a changed file under the same bot name replaces the old version.

After that

A complete first bot

An attacker that sends a striker every 6 ticks, rotating around the ring:

"""Idea: a slow, even trickle from all directions, so the defender never gets a crowd to
hit with one interceptor."""

NAME = "even_trickle"
ROLE = "attacker"


def act(obs):
    cost = obs["rules"]["striker_cost"]
    if obs["tick"] % 6 != 0 or obs["budget"] < cost:
        return {"launch": [], "steer": {}}
    bearing = (obs["tick"] * 37) % 360
    return {"launch": [{"type": "striker", "bearing": bearing}], "steer": {}}

Good luck. Watch the replays of the bots that beat you; that's where the ideas are.

Licence. A bot you submit is contributed under the Apache License 2.0, the same terms as the rest of the code, so it can be run, replayed, shown and put in the tactic library.

Build with us

Thanks for looking. This is an abstract strategy game and research benchmark. These are the rules every contribution follows, then what we can accept right now.

The rules

  1. Abstract only. Made-up units (u, ticks, credits) on a blank plane. No real weapons, vehicles, units, places, armies or companies, and nothing from non-public information, anywhere: code, bots, docstrings, issues, docs. A contribution that breaks this is closed without review. Bot names and docstrings describe the idea in game terms ("hold the swarm outside identification range, then release it on one tick").
  2. Untrusted code never runs outside the sandbox. Bots that aren't part of the baselines are read with ast and never imported on the host. Tests follow the same rule: a test may run a bot in-process only if it is a fixture or baseline from this repo.
  3. Determinism. The same attacker, defender, seed, rules and engine give byte-identical results and replays: in-process, sandboxed, in parallel and from the cache. The tests that prove this stay green.
  4. The rules are frozen for a season. colosseum/rules.py changes only at a season boundary (SEASON.md). Balance ideas for next season are welcome as issues.
  5. Tests before claims. A change says what it does, and comes with a test that shows it.

What we accept now

Security

If you find a way for a bot to get out of the sandbox or past the checks, please don't post the details in a public issue. Open an issue that says only that you have a security report, and a maintainer will contact you.

Licence

Code contributions, including bots, are accepted under the Apache License 2.0. Written research and replays are under CC BY 4.0. The folder-by-folder split is in LICENSING.md.