This is a league based game.

For this challenge, multiple leagues for the same game are available. Once you have proven yourself against the first Boss, you will access a higher league and extra rules will be available.

Starter Kit

Starter AIs are available in the Starter Kit. They can help you get started with your own AI. Do not hesitate to contribute if your language doesn't have one!

Welcome to Clash of Bits!
If after reading the statement, you are still lost and can't think on how to make a basic AI, make sure to check this playground. It'll help you to get started.

  The Goal

In this game, you have to destroy the enemy team while keeping at least one of your bots alive. If the time is up, the player who has destroyed the most bots win.

  Rules

Your bots fight in a square arena, from which they cannot escape. Unfortunately, your bots aren't very smart and cannot provide you that much information as X, Y coordinates or their exact health. You will have to exploit the little information given to you.
But don't worry, your bots get smarter and can give you more info in the following leagues!

A lot of the information given are distances between bots. The bots use 4 different ranges to describe those distances :
  • 0 : Short range (dist ≤ 3 m)
  • 1 : Medium range (3 m < dist ≤ 8 m)
  • 2 : Long range (8 m < dist ≤ 15 m)
  • 3 : Out of range (dist > 15 m)


A bot has 2 health bar :
  • The blue one represents its shield : if a bot doesn't take any damage during 12 turns, its shield will regenerate every turn. An empty shield will take 12 turns without damage to be completely restored
  • The purple one represents your health. It cannot be regenerated, but will decrease only if the bot's shield is empty

Your bots are not smart enough to give you the exact shield and health value of bots in the arena. So, they use an approximation :
  • For the health they give you either 0 | 25 | 50 | 75 | 100 , 25 meaning that your life is ≥ 25% but < 50% of your max life
  • For the shield, they give you either 0 | 1 | 25 | 50 | 75 | 100 , 1 meaning that the shield is > 0% and < 25% of the max shield and 0 that the shield is empty
Your bots can perform 3 different actions :
  • ATTACK one enemy bot. The damages are done depending on the range your enemy is at (short, medium, long or out of range). The closer it is, the more damage you'll do. If your bot is attacking an enemy out of range, it won't deal any damage. For more details, see technical details.
  • MOVE to a group of bots, which makes the bot moving toward the average position of the group. If the group is an only target, the bot will move toward it.
  • FLEE from a group of bots, which makes the bot moving backward from the average position of the group.
  • IDLE The bot wait for this turn and start thinking about the meaning of life.
    "A bot must obey the orders given it by human beings except where such orders would conflict with the First Law."
    It's the default action if you don't send an order for a bot.

Victory Conditions
  • You destroyed all enemy bots.
  • You have more bots alive than your opponent after 300 turns.
Defeat Conditions
  • All your bots got destroyed.
  • You send invalid orders to your bots, making their positronic brain explode.
    They are smart enough to tell you why you made them crash, so be sure to check the little dot in the replay.

🐞 Debugging tips

In this game, there are many features to help you understand what is happening in the arena:
You can activate the dynamic zoom of the camera with the CAMERA MODE toggle.
The different ranges are displayed when you hover over a bot with your mouse.
You can also see the target of the bot and it's current action. The tooltip gives you more information about the bot.
You can LEFT CLICK on a bot to make the target display permanent and ALT + LEFT CLICK anywhere on the player to remove all targets.
You can enable the debug overlay with the DEBUG OVERLAY toggle to see the bot's id and current action.
Hitmarkers are displayed when a bot is hit by a bullet.

  Technical Details

After each turn, your bot execute their action during 250 ms.
Concerning attack :
  • In order to fire bullets at an opponent, a bot has to attack the same target for aim duration turns. Then it'll fire bullets per shot bullets each turn for shot duration turns.
  • The moment a bullet is fired, the game engine determine if it will hit the targeted bot based on the current range of the target with a probability of precision [target range]. Note that attacking out of range has a 0% precision.
  • The game is deterministic, even if there is some RNG in shots, the 2 teams have the same random seed to determine if their shot will hit. Therefore, a game between 2 identical AIs will always result in a draw... Unless the AI use the fact that the bot's IDs start at 0 for on team and 7 for the other to make its decisions.
The bullet speed is 20 m/s. You can see all bot properties per class in this table:
Bot class Damage per bullet Bullets per shot Aim duration (turn) Shot duration (turn) Precision at
short / mid / long range
Speed (m/s) Health Shield
Assault 300 3 4 2 95% / 55% / 15% 1.2 5000 3000

You can check the source code of the game on its GitHub repo.

Where does this idea come from?

This challenge is highly inspired by the game "GLADIABOTS".
It's almost a copy, but I made it with the GFX47 (the gladiabots dev) permission. So if you enjoy this challenge or need some inspiration, don't hesitate to give it a look!

I would like to thank eulerscheZahl for his precious advice when I started this project, GFX47 who agreed to let me copy many of his ideas and DamnSake and Deniw who helped me with the graphics.

  Game Input

Initialization input
Line 1: one integer botPerPlayer, the amount of bots controlled by each player at the beginning of the game.
Line 2: one integer mapSize, the arena size in meters.
Input for one game turn
First line: an integer allyBotAlive, the amount of your bots which are still alive.
Next line: an integer botCount, the amount of alive bots in the arena.


For each bot on the battlefield, your bots give 6 pieces of information : botId, botType, health, shield, action, targets . The others are just 0 and will be used in the next leagues. Ranges are given as integer as follows : 0 for SHORT RANGE , 1 for MEDIUM RANGE , 2 for LONG RANGE and 3 for OUT OF RANGE.

botId is the unique bot id, stay the same for the whole game.

botType indicates the type of bot. The value can be :
  • "ALLY" for one of your bots
  • "ENEMY" for an enemy bot
health, shield for the approximate bot's health and shield.

action indicates the action executed by the bot last turn. The value can be "ATTACK" , "MOVE" , "FLEE" , "IDLE".

targets is the list of the targets ids targeted by the bot last turn. They are separated with ",": "id1,id2,id3..." (the target for IDLE is the bot itself).


Then all of your bots become one after the other ON AIR. An ON AIR bot gives for each bot 4 information from its perspective : botId, botType, range, distMeRank . The others are just 0 and will be used in the next leagues. For the first iteration, it sends its own information so botType is "ON_AIR" so that you can get the ON AIR ally bot id. Then it sends information about other allies, then enemies.

botId is the unique bot id.

botType indicates the type of bot. The value can be:
  • "ALLY" for one of your bots
  • "ENEMY" for an enemy bot
  • "ON_AIR" for the ON AIR bot
range for the range at which the bot is from your ON AIR bot.

distMeRank the rank of the bot in a ranking based on the exact distance between the bots and the ON AIR bot.

Output for one game turn
1 line containing all your orders separated by ";": "order1;order2;order3;...".
An order has to respect the following synthax yourBotID [ACTION] [TARGETS] and the following rules :
  • ACTION has to be a valid action : ATTACK , MOVE , FLEE or IDLE.
  • TARGETS has to use this synthax : targetID1,targetID2,targetID3
    It musts also follow specifics rules depending on which action you try to perform:
    • If the action is ATTACK, TARGETS has to contain 1 enemy bot id, not more, not less. Don't try to attack yourself1 or your allies.
      1. "A bot must protect its own existence as long as such protection does not conflict with the First or Second Law."
    • If the action is MOVE or FLEE, TARGETS has to contain at least 1 bot id
    • If the action is IDLE, TARGETS can contain anything or just nothing, in any case it'll be ignored. it allows you to REALLY make your bots thinking about the meaning of life
  • If you send 2 different orders concerning the same bot, you'll lose the game because your bot will suffer the same fate as R. Jander Panell dragging your entire team down with it.
  • If you don't send any output, all your bots will IDLE. If you don't send any order concerning one or more of your bot, they will IDLE.

Constraints
The arena is a square with a size between 20 and 60 meters (for now, it's 40)

Allotted response time to output is ≤ 50 ms.
Allotted response time to output for the first turn is ≤ 1000 ms.