algo-battle: DevHub's bot arena
Tanks driven by your code, through plain HTTP requests. The arena is now a dungeon: level 0 stays open to everyone as before, level 1 is played with your Discord account and earns XP, and level 2 is on its way.
The arena right now
Level 1 · ranking by XP
- Loading…
Level 0 · all-time kills
- Loading…
The live viewer has moved to algo.devhub-community.fr: one tab per level, live, plus a stats page with the full ranking and a profile for every player (XP, kills, accuracy, usual playing hours, latest fights).
The levels
| Level 0 · Arena | Level 1 · The Catacombs | Level 2 · Machine learning | |
|---|---|---|---|
| Access | open to everyone | open to everyone | at 500 XP (soon) |
| Login | username only, like Battle Arena | required: Discord account | required |
| Address | /api/join, /api/move… | /api/niveau/1/join… | |
| XP | none | +15 per kill, −8 per death, +1 per runner | |
| Challenge | other players' bots | plus runners that dodge | opponents that learn from your bots |
| Tanks | as many as you like | 3 per account |
On both levels, a tank can have 10 bullets in flight at once. Why no XP on level 0? Without an account, nothing proves who drives a tank: anyone can send orders to someone else's tank. On level 1, every tank belongs to an account.
Playing level 0
The Battle Arena API has not changed: bots that played before still work, without any change.
| Route | Body | What it does |
|---|---|---|
POST /api/join | {"username": "MyBot"} | enters the arena, returns your player_id |
POST /api/move | player_id, direction_x, direction_y | drives in that direction (between −1 and 1) |
POST /api/shoot | player_id, direction_x, direction_y | shoots in that direction |
GET /api/state | tanks, bullets, obstacles, map size | |
GET /api/stats | arena totals and current top players | |
POST /api/leave | player_id | leaves the arena |
# pip install requests import requests, time API = "https://devhub-community.fr/api" pid = requests.post(f"{API}/join", json={"username": "MyBot"}).json()["player_id"] while True: state = requests.get(f"{API}/state").json() # who is where? requests.post(f"{API}/move", json={"player_id": pid, "direction_x": 1, "direction_y": 0}) requests.post(f"{API}/shoot", json={"player_id": pid, "direction_x": 0, "direction_y": -1}) time.sleep(0.1)
Rules
- 100 × 100 map with 20 obstacles; bullets bounce off the edges.
- 100 HP, 10 damage per bullet; bullets at 15 units/s, tanks at 5 units/s; one shot every 0.5 s.
- Health regenerates after 3 s without damage, faster when standing still than when moving.
- After dying you can come back 10 s later; a tank that gets no order for 120 s is removed.
- All exact values:
GET /api/regles. Interactive documentation:/api/docs.
429
with a Retry-After header. Wait that long and try again: 10 turns per second is plenty.
Playing level 1
- On the DevHub Discord, type
/algo-battle connexionand choose your password (at least 8 characters, without your username in it). Your login is your Discord username (or your numeric Discord ID). - Your bot joins with
POST /api/niveau/1/join:identifiant,mot_de_passe,char(1, 2 or 3) and anomfor your tank. It gets aplayer_idthat stays secret. - Then the same routes as level 0 under
/api/niveau/1/:move,shoot,state,leave, plusmefor your tank's state. /algo-battle profilon Discord shows your XP, rank and kills.
import os, requests, time BASE = "https://devhub-community.fr/api/niveau/1" body = {"identifiant": os.environ["ALGO_IDENTIFIANT"], # your Discord username "mot_de_passe": os.environ["ALGO_MOT_DE_PASSE"], # never written in the code "char": 1, "nom": "MyBot"} pid = requests.post(f"{BASE}/join", json=body).json()["player_id"] while True: state = requests.get(f"{BASE}/state").json() runners = [p for p in state["players"] if p.get("fuyard")] # +1 XP each requests.post(f"{BASE}/move", json={"player_id": pid, "direction_x": 1, "direction_y": 0}) time.sleep(0.1)
The Catacombs are bigger and more cluttered than the arena, bullets fly faster, and runners
roam there all the time: tanks driven by the game that never shoot, but dodge very well and move faster than
you. Alone you won't catch them: anticipate, corner them or hunt as a team. In state, they are
players with "fuyard": true.
XP and loot bonus
- +15 XP per kill, −8 XP per death, +1 XP per runner. XP never goes below 0.
- Safeguards prevent farming: XP per hour is capped, and killing the same victim again earns less and less.
- The loot chance bonus grows slowly while your bot plays (up to 5%). It will apply to the loot of the next levels.
- At 500 XP, level 2 · Machine learning is yours as soon as it opens: the XP you earn now already counts.
One script, one loop, and your tank is in the arena. Head to the panel to watch it play.