Code Game Challenge

    Quite often, student olympiads consist not only of a competition in the ACM ICPC format, but are also accompanied by other competitions, which in no way affect the overall result, and serve to increase interest in competitions.

    Among these competitions, I want to stop at the Code Game Challenge.


    Competitions of the Code Game Challenge format are competitions in writing a strategy (roughly speaking, artificial intelligence) for some proposed world.

    A team of 3 people is given one computer on which the following software is installed:
    • development environment;
    • Software for sending decisions and viewing results;
    • project template for strategy.


    The set of languages ​​varies from Olympiad to Olympiad, but it always includes languages ​​that are allowed by the rules of ACM ICPC.

    Software for sending decisions and viewing results allows you to send your solution to the server and view the simulation results.

    The strategy project template usually contains a file in which all the necessary libraries are connected, and containing an empty strategy (the managed unit stands still).

    In addition, in a day or two, participants are given the rules of the game world, which describe the physics of the game world, they determine the basic constants (for example, maximum acceleration) and, most importantly, the rules provide the API for managing units and interacting with the outside world.

    Strategy development time is usually 4 hours. During this time, participants can send decisions to the server as many times as they like. Penalty points are not awarded. The final decision sent by the participants is considered final.

    To assess the quality of strategies, participants send a solution to the server where it is compiled and, after that, you can see how your unit resists the enemy. To do this, there is a special visualization module that can play battles between units.

    Simulation of combat step by step. Those. time in the game world is discrete. Each turn, the simulator interrogates game strategies (usually in the order of the players in the list of battle participants), the strategy fills in some structure that describes the “desires” of the active unit, after which the values ​​of this structure are adjusted to the limits, and then applied.

    Now, to make it clearer, let’s take an example.

    Classics of the genre were competitions with tanks. So in more detail I will consider their example.

    So, you are given the game world, which is a rectangle of 2048 x 1536. During the battle, bonuses can appear on the field - objects with a radius of 10, when they hit a unit they get an increase of 5 units to the current HP level.

    In battle, 4 units take part.

    Each unit is a circle with a radius of 20 units. The unit is equipped with weapons aimed in the direction of movement. Weapons reload within 10 turns. The projectile flies at a speed of 3 units / cycle.

    The battle consists of 500 moves.

    Usually, the rules are written on 10-15 sheets, but here is a brief summary.

    For such a game world, one would expect the following API:
    Functions for obtaining information about the game world:
    • get the dimensions of the game world
    • get information about bonuses currently located on the map
    • get information about enemy units
    • get a link to your unit
    • get information about shells on the map
    • get current move
    • get the duration of the battle


    Unit Control Function:
    • set speed
    • rotate at a given angle
    • Fire
    • get information about the condition of the gun
    • get unit location information
    • get unit status information


    Functions for obtaining information about enemy units:
    • get unit status information
    • get unit location information


    Functions for receiving bonus information:
    • get bonus location information
    • get information about bonus lifetime


    That's all. A fairly short API, but enough of it)

    Everything else you need to implement yourself.

    Here is a brief list of the tasks that you will have to solve:
    • unit type selection strategy (usually, at the beginning of the battle you are invited to make a choice of unit type. Different types of units have different characteristics.)
    • obstacle avoidance
    • predicting the location of objects (for example, for firing ahead)
    • calculation of the trajectory of its movement
    • ...


    These 4 hours have passed, after this there is usually a break of several hours, so that the participants would relax a bit, have a bite and warm up. In the evening, they are again assembled in the hall with a large screen, and the most colorful stage of the CGC - Code Game Show. Participants are grouped into groups at random, and the display of all battles begins. As a rule, from the group the winning team goes to the next stage, the losers remain overboard. And so on, until a winner is determined.

    And finally, a few videos of such competitions, not all videos are in good quality, so don’t be angry.

    In general, CGC is interesting, ACM ICPC is interesting.

    CGC held in 2007 at the TTI SFU Olympiad


    CGC held in 2007 at the quarter finals in Saratov


    CGC held in 2007 in Volzhsky


    CGC held in 2009 in Volgograd


    UPD.1 CGC held in 2009 at the quarter-final for the southern region in the city of Saratov


    Where to go if you are interested (links are provided by as-is):
    1. http://antru.ru/crobots3d/
    2. http://robocode.sourceforge.net/
    3. http://www.pureai.com/tankai/default.aspx

    Also popular now: