November 20 - launch of the first strategic MMO game for ... programmers

    Next Thursday, the launch of the project we have been working on over the past few months will take place. Screeps is the first strategic MMO sandbox game I know was made for programmers . Instead of the traditional Point'n'click, the gameplay consists in writing and constantly improving the program for the AI ​​of your units in JavaScript, which controls them continuously and autonomously - even when you are not online . This is a radically new idea, and if you are a programmer, you should definitely take a look at this.



    If you are a programmer, did you think the previous time you played your favorite online game so that it would be great to automate it somehow? Why spend the time of your life performing actions that are easily performed by a bot? Why do you have to go into the game every day to get a reward if the script could easily cope with this? No more wasting time on actions that are within the power of the child, we are capable of more. Screeps doesn’t just allow scripts; Screeps is a scripting game!

    Under the cutter technical and game details.

    What does it look like


    In Screeps, each player, using a special in-game editor, writes a program in full JavaScript, which controls his game. You have the resources, the base, the units, you are fighting for control of the game space in a single big sandbox world working in real time, and to manage all this, you write something like this:

    var scout = require('scout');
    // Производство нового юнитаvar name = Game.spawns.Spawn1.createCreep(['attack','move']);
    Memory.creeps[name] = { role: 'scout' };
    // Раздача команд каждому юнитуfor(var i in Game.creeps) {
        var creep = Game.creeps[i];
        if(creep.memory.role == 'scout') {
            // AI разведчика вынесен в отдельный модуль
            scout(creep);
        }
        else {
            // Добыча и транспортировка ресурсаif(creep.energy < creep.energyCapacity) {
                var target = creep.pos.findNearest(Game.SOURCES_ACTIVE);
                creep.moveTo(target);
                creep.harvest(target);
            }
            else {
                creep.moveTo(Game.spawns.Spawn1);
                creep.transferEnergy(Game.spawns.Spawn1);
            }
        }
    }
    


    At the same time, your units live their own lives, even when you are not online! They will mine and build, capture and defend while you are at work, sleeping or walking with your dog. You can build an entire empire with a developed system of roads, supplies, production, production and border protection, only occasionally entering the game to analyze the situation and hone your scripts.

    Screeps can be called a platform game. It's like writing applications based on some kind of framework, only as a framework is the game world, and as an application is your gameplay.

    Game concept


    Screeps has a lot of programming and few game mechanics that you need to understand, so I'll list them all below.

    The game world consists of interconnected rooms. A room is an enclosed space of 50 by 50 cells, in which there can be from 1 to 4 exits to other rooms. The number of rooms in the world is limited, but increases as new players arrive. Therefore, a single game world is huge and constantly expanding, like the Universe.

    What is in the rooms? Five types of surface (earth, roads, swamps, fortifications and walls), energy sources (game resource) and, of course, your units and buildings.

    Spawns are the centers of your colonies. They are able to accumulate extracted energy.and spend it on creating your units. In one room there can be no more than three spawns, therefore, having built three of your spawn in the room, you can say, capture it.

    Building units called creeps, happens the same as in other strategic games, with one exception - you yourself construct the “body” of the new creep, choosing from 7 available options for body parts, and making up a sequence of up to 30 elements in length. This gives thousands of possible types of creeps and their roles: simple hard workers and huge construction machines digging a source entirely in a matter of cycles; small couriers and roomy heavy trucks; fast, cheap scouts and well-equipped fighters with the ability to regenerate. Or even creeps, more similar to mining, security or siege towers, because they can only move a couple of cells per minute, while having incredible characteristics. Everything is limited only by your imagination and tactics.

    However, the life span of any creep is 30 minutes, after which he will die “from old age”. Therefore, you will need not only to manage existing creeps, but to establish production and automatic control of successive generations of creeps.

    In addition to creating creeps, you will also have to take care of the infrastructure of your rooms. The constructed roads will allow slow creeps to move faster and set up efficient logistics, ramparts will block enemy movements and provide additional protection, and spawn extensions will allow you to build more powerful creeps.

    How it works


    Technologically, the game engine is implemented in two different (but working the same) versions - in the client and server. The client version performs a game simulation in your browser. In this mode, the Simulation Room will work, in which you can test your game scripts without any restrictions, there will also be a tutorial and Survival Mode, where you can practice the real task of survival under the influx of waves of enemy creeps.

    In real online mode, game scripts of all players are already executed directly on the server. The engine is written in Node.js, and the player’s script is executed in it, that is, all the language features of real JS are available. However, the player’s program is launched in an isolated process and in an environment with the standard require disabled (more precisely, replaced by the game version), so it will not work in the server. In addition, the execution of the process is limited in time and memory consumption, if it exceeds the specified limit, the player’s script will simply not finish the execution, warning him about it.

    This whole process is looped and takes place continuously and continuously. Each game cycle fulfills the scripts of all players who distribute commands to units. The commands are executed, after which the next measure starts. It doesn’t matter whether you are online or not, the game always works in real time, so the main game task is to write everything so that development (or at least protection of the already conquered) takes place autonomously and your units themselves can adequately respond to various situations without you which scripts of other players will suit you.

    The front end runs on AngularJS, and all the graphics are simple animated SVG forms.

    By the way, after a successful launch, the game engine is planned to be released in open-source so that players can better understand the mechanics of the game while writing their own scripts. Game simulation on this engine can be launched in console standalone mode on the local machine.

    Project website: www.screeps.com

    The launch is scheduled for November 20. Do not miss, the bonus is provided for the first participants :)

    Also popular now: