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

next Thursday will be the launch of a project we worked on for the last few months. Screeps — the first known to me, a strategy game in an MMO-sandbox, created by programmers. Instead of a traditional Point'n'click gameplay is to write and continuous improvement programs for AI of your units to the JavaScript that manages them continuously and the Autonomous even when you are not online. This is a radically new idea, and if you're a programmer, you definitely need to see this.



If you are a programmer, have you thought in previous times, when playing their favorite online game, it would be nice to automate it? Why waste time of his life to performing actions that are easily performed by a bot? Why do you have every day to go to the game to get the reward, if this could easily script? No more wasting time on actions that are under strength, and baby, we can do better. In Screeps scripts are not just allowed, Screeps is a game about scripts!

Under the cut technical and game details.

How it looks


In Screeps, each player with a special game editor writes the program on a full-fledged JavaScript that manages his game. You have the resources, database, units, you fight for control over the game space into one large world sandbox, real-time, and in order to manage all this, you write something like this:

the
var scout = require('scout');

// Producing a new unit
var name = Game.spawns.Spawn1.createCreep(['attack','move']);
Memory.creeps[name] = { role: 'scout' };

// Distribution of teams in each unit
for(var i in Game.creeps) {

var creep = Game.creeps[i];

if(creep.memory.role == 'scout') {
// AI scout in a separate module
scout(creep);
}
else {
// Extraction and transportation of the resource
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);
}
}
}


While your units live their lives, even when you are not online! They will produce and to build, capture and defend at the same time as you work, sleep or walk with your dog. You can build an Empire with a developed system of roads, supply, extraction, production and protection of the borders, only occasionally coming into the game, to analyze the situation and hone your scripts.

Screeps can be called a game platform. This how to write applications on the basis of a framework only as a framework — game world, and as application your gameplay.

Game concept


In Screeps a lot of programming and a little game mechanic that you need to understand, so I will list them all below.

The game world consists of interconnected rooms. The room is a closed space of 50 by 50 cells, which can be from 1 to 4 outputs in other rooms. Number of rooms in the world is limited, but increases as new players come. Therefore, a single game world is huge and constantly expanding as 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 is the centers of your colonies. They are able to accumulate the extracted energy to spend it on creating your units. In one room may not be more than three spawn, so build three of its spawn in the room, you can say, take it.


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

In addition to creating the creeps, you also have to worry about the infrastructure your rooms. Built roads to allow faster travel slow creeps and to set up effective logistics, ramparts block the movement of the enemy 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 identical) versions — client and server. Client version performs game simulation in your browser. This mode will run the Simulation Room, in which you can test your game scripts without any restrictions, also there will be a tutorial mode and Survival Mode, where you can practice on a real problem of survival under the influx of waves of enemy creeps.

In the real online game scripts of all players are executed directly on the server. The engine is written in Node.js and the script of the player running in it, that is available all the language features of a real JS. However, the player runs in a sandboxed process and environment with disabled standard require (more precisely, replaced by the game version), so to interfere with the work servers will not work. In addition, the process is limited by time and memory consumption, if it exceeds the specified limit, the script of the player simply don't finish execution, warning him about it.

This whole process is cyclic and takes place constantly and continuously. Each game beat practiced scripts of all the players, who give commands to units. The commands are executed, then starts the next cycle. No matter online or not, the game runs in real time, therefore, the main task of the game is to write all of that development (or at least protect the gains already) happened offline and your units could do, without you, react to different situations that you will hold the scripts of other players.

The front-end runs on AngularJS and all graphic is a simple animated SVG-shape.

By the way, after the successful launch of the game engine planned to be released in open-source, so that players can better understand game mechanics, focusing on writing their scripts. Simulation games on this engine can be run in standalone console mode on the local machine.

Website: www.screeps.com

The launch is scheduled on November 20. Don't miss out, for the first members there is a bonus :)
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

When the basin is small, or it's time to choose VPS server

Performance comparison of hierarchical models, Django and PostgreSQL

From Tomsk to Silicon Valley and Back