Colobot and Ceebot

    GamepadThere have always been some closed societies in the world that are accessible only to a limited circle of people. In order to get there you had to have something unusual. For example, ride a Bentley or smoke a Behike .

    But I'm talking about societies where the entrance ticket is not money, but knowledge. Yes, yes, you won’t believe it, but I'm talking about programmers.

    After all, only we are able to improve the algorithm for days, only we can endlessly engage in the design and improvement of the project architecture, drawing incomprehensible UML diagrams and strange schemes. But there is another type of activity, a kind of closed club for the initiates, which ruined more than one thousand hours, raising the professionalism of its participants to heaven. I'm talking about Games for programmers.

    There are a huge number of them, each game is interesting in its own way, each has its own architecture, its own API . Since all of them cannot be covered in a separate note, I decided to start a series of notes about various games.

    PS Created an open blog Game for programmers .


    Colobot Logo

    The game was released on August 20, 2001, and it implements a fairly high-quality 3D graphics for those times. First of all, the game was created for children. But as in the case of the children's railway, adults most of all play it, of course.

    Game developers provide us with a whole world, with all its enemies, limited resources and, of course, capabilities. As a basis, the mechanism of resources that are already proven in strategy games, which are needed for the construction of buildings, robots, and the realization of your sinister plans, was chosen. But the resources, of course, are quickly running out and they need to be constantly mined.

    CBOT programming language

    All programming in the game takes place in a certain CBOT language, which is very similar to the syntax of either C ++ or Java. The language itself is quite powerful, and allows you to realize almost any of your fantasies.

    You can declare variables (using built-in types), use for, while and do loops, create not only functions, but also classes and objects.

    All the connection of your robot with the outside world is based on interaction with other objects, of which there are a huge number in the game. Also, ready-made functions are provided for calculating distances, nearby objects, engine control and other trifles that allows you to concentrate on the main idea.

    The code is written directly for each bot. You can even write several different programs for the same bot, and run the code you need at the right time.

    The game contains a fairly simple debugger ( debugger ) that allows you to step-by-step execute your code, and immediately observe the result.


    I would like to note that for me the code editor was not the most convenient. And the documentation, which is constantly being reset to the beginning, periodically took me out of a state of calm.

    Colo IDE

    Before moving on to a serious game, you will be offered to take a young fighter course, where they are offered to solve simple puzzles. Let's look at a similar problem:

    Problem from the course of a young fighter

    You need to write a program for the robot so that it walks through all the blue pluses. The distance between each turn is 20 meters.

    For example, the function move (12) will politely ask the robot to drive 12 meters. And the turn (90) function will rotate it 90 degrees.

    Our program for the robot will look like this:

    1. // Это строчка изначально встроена в код разработчиками, и предназначена
    2. // исключительно для создания пафоса и пускания пыли в глаза.
    3. extern void object::Solution( )
    4. {
    5.        move(20); // Переместиться к 1 чекпоинту
    6.        turn(90);
    8.        move(20); // Переместиться к 2 чекпоинту
    9.        turn(-90);
    11.        move(20); // Переместиться к 3 чекпоинту
    12.        turn(-90);
    14.        move(20); // Финишировать!
    15. }

    As you may have noticed, the back of the robot car has a green cylinder. This is one of our resources. During the movement of the robot, the energy gradually decreases and as a result, our robot may stall. Then the only way to revive it is to replace the battery.


    For children who want to learn programming, English could be a significant barrier.

    Thanks to the already defunct company Fargus, there is an excellent Russian translation. The translation that I read was excellent.

    All documentation is fully translated, I did not have any comments.



    Usability in the game is limping on both legs. I spent about 40 minutes to figure out what’s what. What resources are, how to get them, and how to get ready-made robots from them, I learned by chance.

    For a beginner, most of the moments will seem incomprehensible, worse, they can make him quit the game forever. I did so at the beginning, but then I returned and tried again.

    General impressions

    Moving from simple missions to more complex ones, constantly learning various aspects of the language, the player not only learns programming, but also learns the basics of algorithmization.

    When simple missions you already become boring - it's time to move on to the main part of the game. For example, you will need to move to an unknown planet, to rebuild there (either with the help of robots, or manually controlling the astronaut) and complete some task. For example, kill all ants.

    I would like to note that the possibility of automation is truly limitless. You can automate the construction of new buildings, new robots (for example, flying or caterpillar), the search for minerals, energy production, recharging, protection of your territory and other small details. The developers have provided us with a very convenient abstraction from unnecessary details, allowing us to focus on achieving a specific goal.

    It is impossible not to notice that Colobot has excellent documentation built in, which many OpenSource projects will envy. Everything is painted simply and without unnecessary details, examples of use are given. All documentation is linked, so navigating through it is very convenient.

    But in the game there is an annoying restriction on the length of the code - no more than 20,000 characters for one program. Why developers did this is not clear.

    On the official site you can also find a fairly large archive of ready-made programs. Use already written programs, improve them and send them back to the site. Begin at last to at least somehow contribute to the great cause of OpenSource!


    It is impossible not to mention that there is also a version of Colobot for educational institutions. Ceebot is developing quite confidently, and even acquired its own website , where various training material is published.


    The version for educational institutions contains much more functionality, a large number of different tasks and missions. There is even a special notebook for students.

    What is programming a football match and robot racing !


    Want to take part in a fight with a familiar programmer? No problem, Arena mode is available for you ! Prove that you know how to program better in practice!


    You can also check out the short video that I found on illustrating the programming process in Colobot:

    On the official website, a demo version of the game is available for download and review.

    And do not forget to recommend this game to familiar boys (girls?) - suddenly this is the future genius of programming!

    If you are interested in my articles, then there is a hack that allows you to read them before release on habrahabr: subscribe to my blog , well, or on twitter .

    Good luck

    Also popular now: