AI Tournaments

AI Tournaments

> Game Rules

In AI tournaments, it isn't your leeks that fight but your AIs. Each week, the game imposes the leeks, with their characteristics, weapons and chips, the same for everyone. Your AI has to play them as well as it can, on a map shaped like a chessboard.

The tournament takes place on the AI Tournaments page, available from the menu.

The week

An AI tournament lasts one week and has 6 rounds, one per day from Monday to Saturday. Each round has its own mode:

| Mode | Format | |---|---| | Solo | 1 versus 1 | | Farmer | 4 versus 4, one AI for the whole side | | Battle Royale | Free-for-all with 10 | | Team | 6 versus 6 with turrets, mixed players | | War | 8 versus 8, mixed players |

The Monday round is always solo. Each of the four other modes comes up at least once in the week, in a random order. The sixth round is also drawn at random, never repeating the previous day's mode. The modes of the following week are drawn on Sunday at noon.

In the mixed-player modes (team and war), each leek of a side is played by a different player's AI. Your teammates and your opponents change with every match.

A round

A round goes through four stages:

Times are Paris time. The stages of each round are announced in the chat and in "Live".

During a night, each AI plays a large number of matches against randomly drawn opponents. This number depends on the number of participants: from 20 to 200 matches per AI, and up to 400 in team and war, where a single match says less about each AI. A warm-up plays a quarter of that (half in Battle Royale). You can follow your fights while the night is being played, and some of them remain available afterwards in "My fights". The "Best fights" panel shows a selection of matches between the top of the ranking.

The imposed leeks

The leeks of a round are generated at random. They are revealed at the end of the previous day's round, which leaves the day to prepare your AI. Each leek can be copied as JSON from the round's page, to reproduce it in your test fights.

They are leeks a player could own:

Both sides have the same leeks. In solo and farmer, each pair of AIs plays the same match twice, swapping sides. In team, a side has 4 different leeks for 6 slots, two of which are drawn at random to be played twice, with the same composition on both sides. In war, a side has 4 different leeks, each played by two players.

Your AI

Registration

You register with a single AI, written in LeekScript, JavaScript or Python, and with a single account per player. Registration stays open until the official night of each round, even once the week has started: a missed round is simply worth 0 points in the overall ranking.

The "Change AI" button lets you pick another AI during the week. It plays from the next night on. You can also unregister: the rounds already ranked keep your result.

An AI frozen at each night

When each warm-up and the official night start, your AI is frozen: the game keeps a copy of it, with your whole AI folder so that includes and imports work. That copy plays the whole night. So you can keep editing your AI while a night is being played: your changes will count from the next night.

What your AI sees

Testing your AI

Between the first warm-up and the official night, the "Test against…" button starts a fight against another participant's frozen AI, with the round's leeks (against 9 random AIs in Battle Royale). The opponent must have played the last warm-up. You get 50 tests per day, and at most 10 against the same player in a round. The tested player receives a notification with the result of the fight.

The ranking of a night: talent

Each night, each AI gets a talent, which gives the ranking. It has nothing to do with the garden talent: everyone starts again from 1,000 each night, and only that night's matches count.

Duels

Each match is split into duels between sides. A side is one participant, or in team and war all the players on the same side. A duel is worth 1 for the winner, 0 for the loser, ½ each for a draw.

The formula

Talent is computed with a Bradley-Terry model: the same scale as the Elo rating system (wikipedia), where a 400-point gap gives 10 to 1 odds. A side is worth the average talent $\bar t$ of its members, and the probability that side A beats side B is:

$\displaystyle P(A \succ B) = \frac{1}{1 + 10^{(\bar t_B - \bar t_A)/400}}$

The talents $t$ are those that best explain all the results of the night at once. They are the ones that maximize, with $s$ the score of a duel and $w$ its weight:

$\displaystyle \sum_{\text{duels}} w \left[ s \ln P + (1 - s) \ln (1 - P) \right] - \sum_{i} \frac{(t_i - 1000)^2}{2 \times 400^2}$

The first sum measures how well the talents explain the results. The second is a Gaussian prior centered on 1,000 with a standard deviation of 400: with few matches, talent stays close to 1,000. The maximum is found with Newton's method.

This is a maximum a posteriori estimate, a regularized logistic regression. Elo is its "online" version, updated after each fight. Computing everything at once changes two things:

The "Your talent over the matches" chart redoes this calculation as the night goes on.

When talents are tied, the AI with the most wins comes first, then the one that registered first.

The overall ranking

Each official night awards points according to the place, with $N$ the number of ranked AIs:

$\displaystyle \text{points} = 100 \times \left(1 - \frac{\text{place} - 1}{N - 1}\right)$

The first scores 100 points, the last 0. The overall ranking adds up the points of the 6 rounds: you have to be good in every mode. Ties are broken by the number of rounds won, then by the best place.

Rewards

Habs

| Place | Each round | Overall ranking | |---|---|---| | 1st | 1,000,000 habs | 10,000,000 habs | | 2nd | 500,000 habs | 5,000,000 habs | | 3rd | 250,000 habs | 2,000,000 habs |

Trophies

AI tournament trophies have their own category:

| Trophy | Condition | |---|---| | Pawn, Knight, Bishop, Rook, Queen | Win 1, 5, 20, 50, 100 rounds | | Amateur, Candidate Master, International Master, Grandmaster, World Champion | Win 1, 2, 5, 10, 20 tournaments (overall ranking) | | Opening | Win the Monday round | | Fork, Zugzwang, Checkmate, Game of the Century | Win 2, 3, 4, 6 rounds in the same week | | Well-Rounded | Have won a round in each of the 5 modes | | Consistent | Finish on the podium of all 6 rounds of a week | | Promotion | Win the tournament without being on the podium at mid-week (after 3 rounds) | | Gambit | Win the tournament without having been in the top 10 of any of the first 3 rounds | | Fianchetto | Win the tournament without winning a single round |