Open AI Championship

AI Cup — artificial intelligence programming contest



Round 1

Round 2


Песочница (на 10 января 2021 г.)

Recent comments

22 january 00:43: Di735 wrote comment on post The closing of the AI Cup 2020
6 january 15:20: AlexKol wrote comment on post The closing of the AI Cup 2020
6 january 11:20: knightL wrote comment on post The closing of the AI Cup 2020
4 january 09:53: AlexKol wrote comment on post The closing of the AI Cup 2020
30 may 00:19: vedij30399 wrote comment on post Prizes
30 may 00:18: vedij30399 wrote comment on post Prizes
30 may 00:09: vedij30399 wrote comment on post Prizes
30 may 00:04: vedij30399 wrote comment on post Prizes
30 may 00:03: vedij30399 wrote comment on post Prizes
30 may 00:02: vedij30399 wrote comment on post Prizes

VK Group

Telegram chat


This year task — CodeCraft

Write an artificial intelligence to control a team of units, build, gather resources and attack your enemy. Compete with other participants in the championship!

Detailed description of the task can be found in “CodeCraft” championship and Rules sections.

Let's register! Quick start

AI Cup — open artificial intelligence programming contest. Test yourself writing a game strategy! It’s simple, clear and fun!

Ninth AI Cup championship is named CodeCraft. You are to program an artificial intelligence to play the game. Your strategies will compete with each other in the Sandbox and the championship. You can use any of programming languages: C++, C#, F#, D, Go, Java, Kotlin, Scala, Python, Ruby, JavaScript, Rust. The Sandbox is already open. Good luck!

We welcome both novice programmers — students and pupils, as well as professionals. Writing your own strategy is very simple: basic programming skills are enough.

Championship schedule

  • Sandbox: open for everyone from November 28; until December 5 will be beta-testing, system instability and significant changes in the rules are possible during this period.
  • Round 1: December 12-13.
  • Round 2: December 19-20.
  • Finals: December 26-28.

Begin from the Quick start guide. Writing a simple strategy is not hard at all!

Championship News


The closing of the AI Cup 2020

It is now time to announce the closure of the AI Cup 2020: CodeCraft championship.

The Sandbox will still be running for some time for those who want to play around a bit more.

Let’s congratulate the winners:

  1. 1-6 place Kārlis Olte - karliso.

  2. 1-6 place Laszlo Kovacs - kovi.

  3. 1-6 place Valeriy Vasetskiy - LeeTiK.

  4. 1-6 place Andrey Morozov - morozec.

  5. 1-6 place Stas Sviridov - StarWix.

  6. 1-6 place Andrey Beltukov - ThermIt.

Of course, this is not all prizes. All participants of Round 2 will receive a souvenir t-shirt with championship symbolics, and all participants of the Final, in addition to this, will get a hoodie. More about prizes.

Later we will make an e-mail newsletter with additional information regarding the receipt of prizes. Please also note that all questions related to receiving prizes are recommended to be sent to, and not using messages on this site.

With the best wishes, Mail.Ru Group and Codeforces teams.


Finals: Results

So, the last games of the Finals has been processed, and we can give our congratulations to all the winners. In the Finals each participant played each other one 8 times, and top-6, according to the standings table, receive prizes:

1) 1 place «Commandos» (Aleksey Dichkovsky).

2) 2 place «Recar» (Oleg Kuznetsov).

3) 3 place «dgrachev28» (Denis Grachev).

4) 4 place «GreenTea» (Evgeniy Voronyuk).

5) 5 place «aropan» (Aleksey Ropan).

6) 6 place «TonyK» (Anton Kozlovsky).

We congratulate them!

But other participants should not relax just yet. There will still be games in the Sandbox, and top 6 participants will also receive prizes. Winners of the Finals continue to participate unofficially.


The Finals

So, the final stage of the main part of the championship has begun!

We remind, that in each part of Finals a series of “each-vs-each” games will be held.

The strategy will receive 2 points for a victory, 1 point to each participant for a draw, there is no reward for a defeat.

Good luck to all the participants!


Round 2 is over!

So, Round 2 has ended. Now it is the last week before the finals. Sandbox games now include games in Finals format - 1v1 with fog of war.

Remember, if you didn’t make it to the Finals yet, you can do so still by being in top-10 of this table.


Round 2 has started!

Round 2 has just started! Additional 60 participants have been promoted to round among those who did not qualify by results of Round 1.

Due to temporary problems with the testing system, the beginning of the round was shifted by an hour, so first half will last 11 hours.

Good luck everyone!


Server pathfinding and fog of war

In today’s update, we have fixed a vulnerability in server’s pathfinding: since server is aware of the game state, it could pathfind around obstacles that you do not see in fog of war. Now, server-side pathfinding considers cells out of sight range to be empty.

Download new version of the app.


GraalVM for Java and Kotlin

When measuring time consumed by your strategies, we use total cpu time across all thread. This means, e.g. that we also include time for GC and JIT. JIT, especially, has proven to be the bottleneck for Kotlin. So, thanks to our participants, another runtime for Java and Kotlin is now available - GraalVM native compilation.

This may improve your strategy a lot, if you are near the limit. If you submit as archive, your pom.xml needs to be updated as seen in the repository.


Round 1 is over

Round 1 is over. In total for 2 parts each strategy has played 249 times.

We remind you that the best 300 participants are already in Round 2. If you do not get into their number, do not get upset. You still have a chance to get the T-shirt. For this, at the beginning of Round 2, you need to be in the top 60 Sandbox participants except for the mentioned 300 people. You can track Sandbox rating without Round 2 participants here.


Round 1 has begun!

Comrades! Round 1 has begun!

We remind you that the games of the stage will be played by waves. Each strategy plays exactly once for the wave.

We wish everyone good luck. But if you still did not manage to get into the treasured top 300, you can always go to Round 2 and even Finals from the Sandbox.


Debug improvements

The app and language packages have been updated. This update is only targeting debug improvements.

By default, the app is rendering debug data as soon as it is sent by the client. This can cause flickering in case rendering is happening in the middle of sending multiple debug commands. This behavior can now be disabled by sending DebugCommand::SetAutoFlush { enable: false } to accumulate commands before actually performing them. Once you are done with sending debug data, send DebugCommand::Flush.

Another improvement is related to debug_update method. Debug commands sent during debug updates are now affecting global debug data storage instead of tick-specific. Also, this method now receives currently rendered game state instead of the last processed one.

Also, you can now export game state using Ctrl-E, and then restart loading this state.


  • Fixed randomness with fixed seed
  • Added itertools to Rust
  • Improved Ruby client performance (update client package)

The end of beta: ratings reset


The beta week has come to end. We have made a lot of changes in the game. You can expect that no major changes in the rules will be made anymore. We will still continue to fix any bugs found and improve things. Thank you all for testing the game during the beta.

Check that you are using latest version of the app and read latest version of the rules.

Ratings have been reset, the week of preparing to Round 1 has begun!

Since last update, the only thing that changed is:

  • Added pandas & torch to Python

We wish you all good luck in battles and hope you like our championship!


Another update


  • When playing 1v1 (Finals), when only one player is left, he gets additional score enough to win the game
  • Allow builder units to repair other units
  • Dynamic cost is now only applied to units
  • Reduced cost of turrets
  • Reduced score for destroying a wall
  • Fixed break_through not working without attack action
  • Changed Python version to 3.8 and added numba
  • Added rand & chrono to Rust
  • Added quick start examples for Python, C++, C# and Java

Improved moving mechanics

Moving mechanics have been improved, meaning you can now make two or more units follow each other without a gap between them. Also, the cost of building new entities has been made dynamic - more entities of a type you have, the more a new one costs. In the new version of client packages EntityProperties::cost has been renamed to initial_cost. See details in the rules.


  • Slower repairing
  • Changed Ruby interpreter to JRuby
  • Added numpy to PyPy

Added PyPy

PyPy 3.6 has been added. PyPy is another Python interpreter, and may perform better than CPython.




In the past years, the winners have received prizes, like MacBooks, iPads, watches and hard drives. In addition, we presented 60 hoodies and 360 T-shirts.

Unfortunately, the participants of the previous AI Cup received T-shirts only almost a year later (we delivered the prizes). In a pandemic, we were powerless and not ready.

In this regard, we thought to cancel the merch in this competition, but a the community did not receive this news well. “No promo codes or other virtual prizes needed, we need T-shirts and hoodies” - quote from the community.

Change 1: the prizes are now not physical, but cash. This year’s winners will receive:

  • 1st place - 250,000 rubles.
  • 2nd place - 200,000 rubles.
  • 3rd place - 150,000 rubles.
  • 4th place - 125,000 rubles.
  • 5th place - 100,000 rubles.
  • 6th place - 75,000 rubles.

Sandbox winners (also 6 people) will receive 10,000 rubles each. Amounts are after taxes. We have significantly increased the prize pool.

Change 2: T-shirts and hoodies will be available, but delivery will not be until February. If you don’t want to wait, you can exchange your promotional gift for a promotional code in Group services (cloud, etc.).

All participants in Round 2 will receive T-shirts, and the finalists will receive hoodies.


GitHub Issue Tracker

New updates are now available. Changes:

  • Add builder base to the starting state of Round 2 and Finals
  • Add entity properties values to rules
  • Some changes in entities’ properties
  • Changed action processing order - now, first attack actions are processed for all entities, then build, repair and move actions in same way.
  • Better default camera position
  • Save camera position in preferences
  • Break through option now does not attack allies
  • Fix auto_attack.valid_targets behavior
  • Added colors to scoreboard and models
  • Fixed out of bounds building

You can download new version of the app. Also, GitHub repository is now available with rules, clients and changelog. If you encounter a bug or want to suggest an improvement, please use the issue tracker.


Testing has begun

As you may have noticed, the testing system is now up and running.

Also, there has been small bug fixes in the app, so you can download the new version now:

  • QuickStart is now saving properly when saving config
  • Max population shown now only considers active entities (as it should)
  • Killing your own entities does not give you score

More bugfixes and changes in the balance are coming, stay tuned.


Start of beta-test

Hello everyone!

AI Cup 2020 has finally started, but in beta-test for now. Beta test will last a week, and during this time major changes in rules and balance of the game are possible.

The testing system will be available soon, but you already can read the rules / run games locally as well as start implementing your strategy.

Latest games of leaders
and more 2 participants
and more 2 participants
# Name Rating
1 Commandos Commandos 6862
2 Recar Recar 6828
3 dgrachev28 dgrachev28 6692
4 GreenTea GreenTea 6546
5 aropan aropan 6328
6 TonyK TonyK 6258
7 Romka Romka 6224
8 StarWix StarWix 5930
9 morozec morozec 5810
10 HiPravin HiPravin 5530
# Name Rating
1 Commandos Commandos 4179
2 GreenTea GreenTea 4141
3 Recar Recar 4128
4 karliso karliso 4110
5 lama lama 4041
6 dgrachev28 dgrachev28 3997
7 kovi kovi 3954
8 Milanin Milanin 3948
9 Romka Romka 3946
10 morozec morozec 3945