📜 ⬆️ ⬇️

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

Next Thursday will be the launch of the project, on which we have been working for the last few months. Screeps is the first strategic MMO sandbox game known to me, created for programmers . Instead of the traditional Point'n'click, the gameplay is to write and constantly improve the AI ​​program of your units in JavaScript, which manages 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 look at it.



If you are a programmer, did you think the last time you played your favorite online game, so that it would be great to automate it somehow? Why spend the time of your life to perform actions that are easily performed by the bot? Why do you have to go into the game every day to get a reward, if the script could easily handle it? No more senseless waste of time on actions that can be done by a child, we are capable of more. Screeps scripts are not just allowed, Screeps is a game about scripts!
')
Under the cut technical and game details.

What it looks like


In Screeps, each player, using a special in-game editor, writes a program for full-fledged JavaScript, which controls his game. You have the resources, the base, the units, you are fighting for control of the gaming space in a single large real-time sandbox world, and to manage it all, 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); } } } 


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

Screeps can be called a platform game. It's like writing an application on the basis of a framework, only as a framework - the game world, and as an application - your gameplay.

Game concept


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

The game world consists of interconnected rooms. A room is an enclosed space of 50 to 50 cells, which can have from 1 to 4 exits to other rooms. The number of rooms in the world is limited, but it is increasing 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 (land, 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 the extracted energy and spend it on the creation of your units. In one room there can be no more than three spawns, therefore, having built three of your spawn in a room, you can say you capture it.

Building units, called creeps , is the same as in other strategic games, with one exception - you construct the "body" of a new creep yourself, choosing from 7 available 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 up the source in just a few cycles; small couriers and roomy heavy trucks; fast cheap scouts and well-equipped fighters with the possibility of regeneration. Or even creeps, more similar to mining, guard or siege towers, because they can move only a couple of cells per minute, while having incredible characteristics. Everything is limited only by your imagination and tactics.

However, the life 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 set up production and automatic control of successive creep generations.

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

How it works


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

In real online mode, the game scripts of all players are 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 runs in an isolated process and environment with the standard require disabled (more precisely, replaced by the game version), so it will not work to interfere with the server. In addition, the process is limited in time and memory consumption, if it exceeds the specified limit, the player's script simply does not finish the execution, warning him about it.

This whole process is looped and occurs continuously and continuously. Each game tact is processed scripts of all players who distribute teams to units. Commands are executed, after which the next clock starts. It doesn’t matter whether you are online or not, the game always works in real time, so the main task of the game is to write everything so that development (or at least the defense of the already conquered) takes place autonomously and your units can react adequately to various situations without you , which you will arrange scripts other players.

The frontend works 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 by writing their own scripts. The game simulation on this engine can be run in console standalone mode on a local machine.

Project website: www.screeps.com

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

Source: https://habr.com/ru/post/242963/


All Articles