GithubHelp home page GithubHelp logo

screeps's Introduction

npm version

logo

Screeps is a MMO RTS sandbox game for programmers, wherein the core mechanic is programming your units AI. You control your colony by writing JavaScript which operate 24/7 in the single persistent world filled by other players on par with you.

This project is a distributed, standalone game server that allows you to launch your own game world on a local computer or dedicated server on the Internet.

Server launch

The server consists of multiple parallel processes linked to each other. There is a separate launcher process to launch them correctly, and these launchers have various versions for different purposes.

GUI launcher. This is the easiest way to launch the server. It comes with the standard package of the Steam version of the game. You launch the game via the server's executable file that shows the GUI with logs of all started processes and the CLI interface to control the server.

Console launcher. You can also launch the server without the GUI using the command line:

npm install screeps
npx screeps init
npx screeps start

Prerequisites:

You will be prompted for your Steam Web API key, you can obtain it on this page.

Your own launcher. The launchers are intended to launch other server's processes and give them correct environment variables. You can launch those processes your own way (for example, via upstart/systemd, for distributing them across different machines, or setting up an automated testing framework). Please refer to the file launcher/lib/start.js for the list of environment variables that each process needs.

Storage

The default built-in storage is based on LokiJS library which allows to embed it in pure JavaScript environments like the Steam game client. It stores all data in the db.json file. However, you can manually replace the storage engine with another community solution to improve performance.

See this step-by-step guide which explains how to install a standalone private server on Ubuntu using MongoDB and Redis as a storage.

Connect to server

You can connect to your private server using the Steam game client. Click "Change server" and enter your server credentials:

client

Launch options

If you use a stock launcher (either desktop or console), the file .screepsrc in the current catalog stores launch configuration options. You can specify them directly when you launch the server using the console command start.

> npx screeps start --help	
Usage: start [options]	
Start all processes. Launch options can be configured from command line or using the .screepsrc file in the same folder.	
Options:

    -h, --help               output usage information
    --db <path>              The path to the database file.
    --logdir <path>          The path to directory where logs will be created.
    --modfile <path>          The path to JSON file with the list of custom mods to load. Defaults to mods.json.
    --assetdir <path>        The path to directory where static assets are located.
    --port <port>            The port number on which the game server should listen. Defaults to 21025.
    --host <host>            The hostname on which the game server should listen. Defaults to 0.0.0.0.
    --password <password>    The server password which should be provided on user sign in. Default is empty.
    --cli_port <port>        The port number on which the CLI server should listen. Defaults to port+1.
    --cli_host <host>        The hostname on which the CLI server should listen. Defaults to 127.0.0.1.
    --runners_cnt <num>      The number of parallel runner worker processes to launch. Don't set this option greater than the number of your physical CPU cores. Default is 2.
    --processors_cnt <num>   The number of parallel processor worker processes to launch. Don't set this option greater than the number of your physical CPU cores. Default is 2.
    --steam_api_key <key>    If you launch the server without running the local Steam client, then the Steam Web API key is required for authenticating users. It can be obtained on this page: http://steamcommunity.com/dev/apikey

Modules

The server consists of 6 separate modules: launcher, storage, backend, engine, driver,common. They may be in the node_modules of any catalog according to the npm rules. Each module has its own code base and GitHub repository, while the engine module is shared between the official and standalone servers and other modules are developed specifically for the standalone server.

Each module is intended for its own strict purpose:

  • launcher launches the rest of the processes, and it includes the server control GUI.

  • storage contains a LokiJS-based database, a key-value storage, and a Pub/Sub mechanism. The rest of the processes connect to storage to exchange data.

  • backend contains an HTTP server accessed by clients and a CLI server for administration.

  • engine is the game core. It executes game scripts and interacts with game world objects.

  • driver is a link between the environment-independent engine (that is shared for the official server, standalone server, and in-browser simulation) and the immediate environment that hosts the game engine. You can replace this module with your own one, if you wish to use another method of storing and handling data.

  • common is a shared code base with useful utilities.

modules

Authentication

The server does not have any user authentication mechanism of its own. Instead, Steam is employed for this purpose, and the server has two mechanisms that work in parallel to achieve this:

  • Native authentication via the local Steam client on your machine. This is the easiest and handiest method that does not require any setting up and works automatically when launched via Steam.

  • If you want to launch your server on a machine without a Steam client installed, you will have to set up authentication via the Steam Web API. To do this, register a new Steam API Key on this page and set it as the steam_api_key option at the server launch.

Command Line Interface (CLI)

The running server process provides administrative access using a separate port (21026 by default) which allows executing inner server commands using batch commands. It is accessible through the Steam GUI or using this console command:

npx screeps cli

The CLI server contains a JavaScript virtual machine allowing to run any valid JS code and work with inner server functions. They allow changing game objects and call procedures, including those added by you. Some examples of such commands:

// Add an NPC bot to the map
bots.spawn('simplebot', 'W3N1');

// Send a server message to all connected users
system.sendServerMessage("OHAI");

// Generate a new room and add it to the world
map.generateRoom("E0N3", {sources: 4, terrainType: 2});

// View user's data by his username
storage.db['users'].findOne({username: "User"});

// Show all creeps in a room
storage.db['rooms.objects'].find({$and: [{room: 'W1N1'}, {type: 'creep'}]});

// Remove an object by its id
storage.db['rooms.objects'].removeWhere({_id: "abcdef"});

Type help() to get a detailed help for all available objects.

Mods

The game server is written in such a way that you can redefine and configure many aspects of its work. Do not modify server code directly! This will block you from updating with new releases, and the official Steam client of other players will stop connecting to your server. Rather than editing the server's source, create mods.

Mods are simple js files listed in the mods.json (the default folder can be changed through the modfile launch option). Each file must be a Node.js module that exports a single function that receives as an argument a config object:

module.exports = function (config) {

}

Each server process will automatically include all the mods at launch and pass the object config to them with properties corresponding to the type of the launched process. If the server consists of 10 processes, then each mod file will be requested 10 times, each time with a different type of config.

All config child objects are EventEmitter instances that you can listen for game engine events. They also contain some properties that can be simple numeral or string configuration parameters as well as functions that you can redefine thus changing server behavior. Their number will increase with time. We have not prepared documentation for all the available properties yet, but the folder example-mods offers a few simple examples of what you can change by mods. We also recommend to investigate the config object of various processes on your own to find out what is possible.

Installing mods

There are three methods to install a mod to your server:

  • Edit mods.json manually and add a new entry to the array in it.
  • If the mod is published to the NPM repository, you can run npm install my-screeps-mod in your server folder, and it will be added automatically. (CAUTION: There is a bug in some npm 5.x versions which prevents auto install hooks from running.) The mod's package.json should contain "screeps_mod":true parameter in this case:
{
  "name": "my-screeps-mod",
  "version": "1.0.0",
  "main": "my-screeps-mod.js",
  "screeps_mod": true
}
  • Using the Steam Workshop.

NPC bots

You can create autonomous NPC bot players on your private server. They work as regular players, but you can specify their AI scripts in bots option at your mods.json file. Initially there is one AI loaded into your server, called simplebot, but you can always add more, and share with other players.

Use the following CLI commands to control bot players on your server:

> help(bots);
Available methods:
 - bots.spawn(botAiName, roomName, [opts]) - Create a new NPC player with bot AI scripts, and spawn it to the specified room. 'opts' is an object with the following optional pr
operties:
    * name - the name of a bot player, default is randomly generated
    * cpu - the CPU limit of a bot user, default is 100
    * gcl - the Global Control Level of a bot user, default is 1
    * x - the X position of the spawn in the room, default is random
    * y - the Y position of the spawn in the room, default is random
 - bots.reload(botAiName) - Reload scripts for the specified bot AI.
 - bots.removeUser(username) - Delete the specified bot player and all its game objects.
Bot AIs:
 - simplebot [D:\SteamLibrary\steamapps\common\Screeps\server\@screeps\simplebot\src]

If you want to publish your bot AI to the NPM repository, set main.js as the main entry in your package.json, and add screeps_bot:true parameter:

{
  "name": "my-screeps-bot",
  "version": "1.0.0",
  "main": "src/main.js",  
  "screeps_bot": true
}

screeps's People

Contributors

alinanova21 avatar artch avatar o4kapuk avatar szymex73 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

screeps's Issues

/api/user/memory uses incorrect zlib compression

Calling GET /api/user/memory acts differently when called against screeps.com versus calling it against a private server.

It appears that the private server uses:
return q.ninvoke(zlib, 'deflate', JSON.stringify(curPointer))

while the screeps.com server uses:
zlib.gzip()

This is inferred from calling inflate vs gunzip on the results of the call. Gunzip works against screeps.com, while inflate works against a private server.

Both use the prefix "gz:" when sending data back from the api.

Additionally, that file (backend-local/lib/game/api/user.js) seems to be inconsistent with its use of "btoa" instead of data.toString('base64')

License right?

Sorry
but i just seen that all Screeps Repositories are under ISC license
which means anyone can modify/redistribute/commercially use your software
is this intended?

Missing file, cant download the server

It keep saying that it is missing some files.

npm http GET https://registry.npmjs.org/screeps
npm http 200 https://registry.npmjs.org/screeps
npm http GET https://registry.npmjs.org/screeps/-/screeps-1.0.7.tgz
npm http 200 https://registry.npmjs.org/screeps/-/screeps-1.0.7.tgz
npm http GET https://registry.npmjs.org/screeps/common
npm http GET https://registry.npmjs.org/screeps/driver
npm http GET https://registry.npmjs.org/screeps/backend
npm http GET https://registry.npmjs.org/screeps/engine
npm http GET https://registry.npmjs.org/screeps/storage
npm http GET https://registry.npmjs.org/screeps/pathfinding
npm http GET https://registry.npmjs.org/screeps/launcher
npm http 404 https://registry.npmjs.org/screeps/driver
npm http 404 https://registry.npmjs.org/screeps/common
npm http 404 https://registry.npmjs.org/screeps/pathfinding
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'screeps/driver' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'screeps'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

Allow configuring game speed

I want to use the local server for testing purposes. It would be great if there would be a configuration option or CLI command to set the game speed, similarly to the simulation mode.

How to get to the Web GUI?

Sorry, I'm probably misunderstanding something, but how do I get into the game after launching the server?

I've followed to "Console launcher" instructions and I can see that the server is running on port 21025 now. However, when I go to http://localhost:21025/ all I see is Cannot GET /. What am I missing?

BUG: automatic placed border walls - in claimable room

Hey mates.

It seems that game automatic constructed walls are missing the 'ticksToLive' property

the API says:

ticksToLive number The amount of game ticks when the wall will disappear (only for automatically placed border walls at the start of the game).

This makes it a bit hard to interact with this kind of walls. The Decay time is shown in the client GUI though.

After a little slack chat it seams the bug is not the TTL property. Rather there should none of these walls in a claimable room - see W86S33 - this room is claimable and has those wall in it

Hope this helps
casegard

Steam Web API connection error Error: HTTP 403 Forbidden

I'm still getting this error in backend.log with latest version of screeps on OSX 10.11.6:

Loading mods from "/Users/gentili/Library/Application Support/Steam/SteamApps/common/Screeps/server/mods.json"
Connecting to storage
Starting CLI server
STEAM_KEY environment variable found, disabling native authentication
Connecting to Steam Web API
CLI listening on localhost:21026
[127.0.0.1:49486] Incoming CLI connection
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (/Users/gentili/Library/Application Support/Steam/SteamApps/common/Screeps/server/node_modules/steam-webapi/index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Starting game server (protocol version 12)
SockJS v0.3.18 bound to "/socket"
Game server listening on 0.0.0.0:21025
Connecting to Steam Web API
Running cronjob 'sendNotifications'
Running cronjob 'roomsForceUpdate'
Running cronjob 'genPowerBanks'
Running cronjob 'genInvaders'
Running cronjob 'purgeTransactions'
Running cronjob 'recreateNpcOrders'
Running cronjob 'calcMarketStats'
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (/Users/gentili/Library/Application Support/Steam/SteamApps/common/Screeps/server/node_modules/steam-webapi/index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Connecting to Steam Web API
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (/Users/gentili/Library/Application Support/Steam/SteamApps/common/Screeps/server/node_modules/steam-webapi/index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Connecting to Steam Web API
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (/Users/gentili/Library/Application Support/Steam/SteamApps/common/Screeps/server/node_modules/steam-webapi/index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

Syntax error running screeps

I'm getting the following message starting screeps:

SyntaxError: Unexpected token [
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/screeps/server/node_modules/@screeps/backend/lib/game/socket/system.js:3:13)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
[backend] process 30794 exited with code 1, restarting...
Game time set to 42
[backend] process 30799 started
Game time set to 43
/home/screeps/server/node_modules/@screeps/backend/lib/utils.js:27
    var [match,hor,x,ver,y] = name.match(/^(\w)(\d+)(\w)(\d+)$/);

$ node -v
v4.2.4

describeExits() returns null for rooms created via CLI

Using describeExits(roomName) on any rooms generated via the CLI will always return null, but works as expected on original rooms.

===================

Example:
in CLI:
map.generateRoom("E1N1", {sources: 4, terrainType: 2});
map.generateRoom("E2N1", {sources: 4, terrainType: 2});
map.generateRoom("E3N1", {sources: 4, terrainType: 2});

in-game:
var exits = Game.map.describeExits('E2N1');
console.log(exits) returns null

===================

Links:
Screeps CLI

API describeExits

Changelog - Build 27 - Addition of map.generateRoom

Processes die constantly

Ubuntu 16.04 LTS
Python 2.7
Nodejs 7
build-essentials installed
No matter what settings I change, this is all I get when attempting to run a server.

Server version 2.2.0
Starting all processes. Ports: 21025 (game), 21026 (cli)
[storage] process 2760 started
[backend] process 2770 started
[engine_main] process 2771 started
[engine_runner1] process 2777 started
[engine_processor1] process 2783 started
[engine_main] process 2771 exited with code 1, restarting...
[engine_runner1] process 2777 exited with code 1, restarting...
[engine_processor1] process 2783 exited with code 1, restarting...
[engine_main] process 2798 started
[engine_runner1] process 2804 started
[engine_processor1] process 2805 started
[engine_main] process 2798 exited with code 1, restarting...
[engine_runner1] process 2804 exited with code 1, restarting...
[engine_processor1] process 2805 exited with code 1, restarting...
^C

Creeps and resources vanishing

Sometimes multiple times a day, sometimes every few days, all the Creeps and energy in my private server will simply vanish. I'm not 100% sure they are connected, but everytime after I notice all the creeps are gone, there is this entry in the backend.log

Running cronjob 'roomsForceUpdate'
Unhandled rejection: Error: Can't set headers after they are sent.
    at ServerResponse.setHeader (_http_outgoing.js:359:11)
    at ServerResponse.header (/usr/local/lib/node_modules/screeps/node_modules/express/lib/response.js:719:10)
    at ServerResponse.send (/usr/local/lib/node_modules/screeps/node_modules/express/lib/response.js:164:12)
    at ServerResponse.json (/usr/local/lib/node_modules/screeps/node_modules/express/lib/response.js:250:15)
    at /usr/local/lib/node_modules/screeps/node_modules/q-json-response/q-json-response.js:17:14
    at _rejected (/usr/local/lib/node_modules/screeps/node_modules/q/q.js:844:24)
    at /usr/local/lib/node_modules/screeps/node_modules/q/q.js:870:30
    at Promise.when (/usr/local/lib/node_modules/screeps/node_modules/q/q.js:1122:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/screeps/node_modules/q/q.js:788:41)
    at /usr/local/lib/node_modules/screeps/node_modules/q/q.js:604:44

as far as I can tell there is nothing else interesting in the logs. Running screeps 2.2.1 on Node 7.3.0 on FreeBSD.

Code updating and symbolic links

I was hoping to keep my scripts in an external location, and just compile the main.js to the directory where screeps keeps the scripts. To do this I figured I would create a link for main.js to my compiled location. But it looks like screeps is not following the link.

I cannot find any UI code in here, so I am guessing that the actual game UI is not open source, or I would go submit a PR for it. If there is something else you would like me to do to help out with this, let me know. Thanks for the great game :)

standalone console is always out of sync

title says it all: every time I launch the steam client, connect to the private server, and launch the console/code editor it says it's out of sync and to relaunch it.

Process failing with "Unexpected token ["

Running into the following when I run 'screeps start'

Using:
Server build 35
Node: '5.8.0'
Python 2.7.9 (default, Feb 10 2015, 03:28:08)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin

[backend] process 50297 started
/usr/local/lib/node_modules/screeps/node_modules/@screeps/backend/lib/utils.js:27
    var [match,hor,x,ver,y] = name.match(/^(\w)(\d+)(\w)(\d+)$/);
        ^

SyntaxError: Unexpected token [
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/screeps/node_modules/@screeps/backend/lib/game/socket/system.js:3:13)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
[backend] process 50297 exited with code 1, restarting...
Game time set to 16

cpu load

Hi,
I run a server for multiple days, and the longer I run the server, the more rise the cpu usage and load (up to 100% of one core I think).
And because it used that much cpu, I deleted the bots on the server and restarted it, and the load is rising again, but not that fast as with the bots.
My setup:
Node 7.2.0
Python 2.7.12
2 User on the server
2 Cores of a Xeon E3-1220
8 GB RAM

CPU Limit won't increase

I reached GCL 2 on my private server. In my overview it says I have a CPU Limit of 40 however my actual limit stays at 30.

Error installing on Azure CentOS VM

Here is the error I get. Note I've tried this as root and sudo. If I don't use sudo as my normal user it just gives me an EACCS error. I've also tried installing on a Azure windows vm and it gives me the same error.

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/bin/screeps -> /usr/lib/node_modules/screeps/bin/screeps.js

> [email protected] install /usr/lib/node_modules/screeps/node_modules/weak
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.9.5"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/screeps/node_modules/weak/.node-gyp"
make: Entering directory `/usr/lib/node_modules/screeps/node_modules/weak/build'
  CXX(target) Release/obj.target/weakref/src/weakref.o
make: g++: Command not found
make: *** [Release/obj.target/weakref/src/weakref.o] Error 127
make: Leaving directory `/usr/lib/node_modules/screeps/node_modules/weak/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.10.0-514.2.2.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/screeps/node_modules/weak
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

> @screeps/[email protected] install /usr/lib/node_modules/screeps/node_modules/@screeps/driver
> node-gyp rebuild -C native

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.9.5"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/screeps/node_modules/@screeps/driver/.node-gyp"
make: Entering directory `/usr/lib/node_modules/screeps/node_modules/@screeps/driver/native/build'
  CXX(target) Release/obj.target/native/src/main.o
make: g++: Command not found
make: *** [Release/obj.target/native/src/main.o] Error 127
make: Leaving directory `/usr/lib/node_modules/screeps/node_modules/@screeps/driver/native/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.10.0-514.2.2.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "-C" "native"
gyp ERR! cwd /usr/lib/node_modules/screeps/node_modules/@screeps/driver/native
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
/usr/lib
└── (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/screeps/node_modules/weak):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! Linux 3.10.0-514.2.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "install" "-g" "screeps"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! @screeps/[email protected] install: `node-gyp rebuild -C native`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @screeps/[email protected] install script 'node-gyp rebuild -C native'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @screeps/driver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild -C native
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @screeps/driver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @screeps/driver
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/gehn/npm-debug.log
npm ERR! code 1

Log to stdout/stderr

Hi!

It's possible to send the logs to stdout? It would be easier for docker or systemd environments to send the logs to stdout instead write logs into files.

Dependencies in READ.ME incorrect

You should probably note that node-gyp is a required dependency. Not everyone is running on a fully installed distro or a Mac, so we may not have node-gyp installed. Also, please note that any time using -g switch you should use sudo or run the account as root. Otherwise you run the risk of the dreaded EACCESS error.

Freeze after CPU limit on a small server

Hey guys, I'm running screeps on a really small server (smallest droplet from DigitalOcean) and I was just testing it, when suddenly there was a "reached CPU limit" error on my game (the scripts spike from CPU 7 to CPU 90 and sometimes above) and then everything froze.
Simply restarting the server fixed it, but it didn't start working again by itself. This might very well simply be an issue the stems from running it on such a small server, but is there anyway I can make it restart by itself if it freezes?

EventEmitters for mod events

I've been messing with modding since the beta, and have a request. Currently, when hooking events, in order to keep from potentially breaking previously loaded mods, we need to store the original function and call it inside our replacement. I'm proposing that EventEmitters be added so that each mod can hook the events without worrying as much about other mods.

I have a gist with two mods, one that adds the EventEmitters via Proxy, and another demonstrating it in action.
https://gist.github.com/ags131/1690177425e43bae4a85857d28084a0b

This event pattern also makes it easier to hook common events such as preExpressConfig which is used by mods needing more/earlier control over the routes just by doing config.backend.on('preExpressConfig',(event,app)=>{ ... })

I have had pointed out to me in slack that usually events are asynchronous, in node, they are not. From the nodejs event module documentation:

When the EventEmitter object emits an event, all of the functions attached to that specific event are called synchronously.

README.md: Python

Python probably needs to be added somewhere as a prerequisite before running npm install -g screeps

Python v2 and not v3.

That would probably reduce any questions on what version is needed.

Thanks!

Windows headless server - Module version mismatch

When starting the server with "screeps -start" the logs return:
Using Node verion 6.9.5 and python version 2.7

module.js:597
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: Module version mismatch. Expected 48, got 46.
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Server\AppData\Roaming\npm\node_modules\screeps\node_modules\@screeps\driver\lib\index.js:941:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)

I've installed using the guide found here https://github.com/screeps/screeps

BUG - free CPU - and potentially bad for server health

Hi mates,
I found something where I could get free cpu, aka it does not count a function cost to the Game cpu.

The following code snippet can be used to see what I mean: (I'm not very good at explaining it - I hope it will be clear what I mean)
What it does is, it exploits the fact that when the server nodes get switched the server does the global stuff outside of the user cpu.
The start would look like this:
Node / description
1 ... new commit global/loop - entry to timestamp
2 ...
3 ...
4 ...
these nodes are all initialised with all the costs...
now the server uses only 4 nodes at one time and if it switch to the next server node the global cost is not calculated against the user CPU! This means I could write code that waits till the server node changes to >4 and let the server calculate some heavy CPU stuff - this can be done every time a new server node change happens .. this is very dangerous I suppose - I did not test it with an endless loop (that you have to test for yourself :)).

-> this code can be used to see the behaviour in action (I used some not so heavy stuff to demonstrate the issue - plz be careful with this if you test it).... just copy it to branch and check it out .. you have to wait a couple of turns till the server node changes to >4 though.

var myCPU = {};

var a0 = Game.cpu.getUsed();

if (module.timestamp != Memory.timestamp)
{
    Memory.timestamp = module.timestamp,
    Memory.nodeCount = 0;
}
var aNode = (Memory.nodeCount + 1);
Memory.nodeCount = aNode;

var aHeavy = [];
if (aNode > 4)
{
    console.log(`<font style="color:#FF0000"> HEAVY WORK ${aNode} ... will not be seen</font>`);
    var a1 = Game.cpu.getUsed();
    for (let x=0;x<50;x=x+1)
    {
        for (let y=0;y<50;y=y+1)
        {
            Game.map.getTerrainAt(x,y,_.find(Game.rooms).name);
            Game.map.getTerrainAt(x,y,_.find(Game.rooms).name);
            aHeavy.push(Game.map.getTerrainAt(x,y,_.find(Game.rooms).name));
        }
    }
    myCPU['heavyWork'] = Game.time + ' '+ (Game.cpu.getUsed() - a1);
}
myCPU['globalCPU'] = Game.time + ' '+ (Game.cpu.getUsed() - a0);
console.log(`<font style="color:#FF0000"> NEW NODE .... ${aNode}</font>`);


module.exports.loop = function ()
{
    var start = Game.cpu.getUsed();

    console.log('NODE: [ '+aNode+' | '+Memory.nodeCount+' ] - '+_.isEmpty(aHeavy));
    if (!_.isUndefined(myCPU['heavyWork']))
    {
        myCPU['heavyWorkTick'] = Game.time + ' '+start;
    }
    console.log('MY CPU: '+JSON.stringify(myCPU,undefined,2));

    var end = Game.cpu.getUsed();
    console.log('GAME:['+Game.time+'] [ '+start.toFixed(2)+' | '+(end-start).toFixed(2)+' | '+end.toFixed(2)+' ] BUCKET: '+Game.cpu.bucket+'\n\n');
};

I hope this helps a bit to estimate the harm that can be done with this. If it is not clear what I mean plz let me know and I try to explain it a bit better.
Not sure if the code snippet is appropriate to post here but I could not find another place where to put it .. if you think it is harmful plz delete it or make it invisible.

Casegard

Hardware requirements

I'd be helpful if the README gave at least a ballpark estimate for the hardware requirements, so the user can size up the hardware. Particularly the memory requirements.

Lodash's _.unset undefined

I am unable to use the _.unset method because it does not appear to be defined. _.get and _.set work fine.

Is this an intentional omission, or does the Lodash library need to be updated? I believe that _.unset was added in Spring 2016.

strict mode error

I just created a new screeps server and on running screeps start I am getting an odd error:

Child runtime process 19793 exited with code=1 signal=null
Runtime worker reset due to child exit: code=1 signal=null user=MichaelBot (a1123272b261687) promise pending=true
[backend] process 19802 started
Game time set to 10
New child runtime process 19807
New child runtime process 19808
/usr/local/lib/node_modules/screeps/node_modules/@screeps/backend/lib/index.js:21
        for(let i in config.common.bots) {
            ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/screeps/node_modules/@screeps/backend/bin/start.js:2:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
[backend] process 19802 exited with code 1, restarting...
/usr/local/lib/node_modules/screeps/node_modules/@screeps/driver/lib/runtime.js:117
/usr/local/lib/node_modules/screeps/node_modules/@screeps/driver/lib/runtime.js:117
        let runtimeData = data[0];
        let runtimeData = data[0];
        ^^^
        ^^^


SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3
    at node.js:968:3

Dockerized Screeps Server

So i managed to get a docker container of this git repo up and running. with a working server.

iv played around with it and have a question about the Modules,
Each module has its own git repo. and Im trying to figure out how to configure a repo to use it.

i know it may be a nooby question. but Im unclear with the current documentation on how to do it.

If anyone wants to know how i got the dockerized stuff working. ill be creating a repo soon enough with the DockerFile and setup scripts.

Thanks for working on this Project! I think its awesome.

map.removeRoom does not clear 'mapView' database values?

Hi!

First of all, thank you so much for making this server! I'm experimenting around with a few things, and I just noticed that after using map.removeRoom() on all rooms, the mapView:<name> entries still exist in the 'env' database in db.json.

I'm sure I can remove them manually, I just wanted to put this here as a notice of this behavior! I noticed it when using JsonView in firefox to look at database snapshots after doing things, here's the snapshot after I just start up a new server, and use removeRoom on all rooms: http://ocean.daboross.net/data/no_rooms_db.json.

Here's an example of the effect: not to bad, but definitely noticable. In this pic, I've deleted all rooms, then regenerated and re-opened W3N3 and W0N0 (both with two sources & a controller):
screenshot from 2016-11-11 15-28-47

Everything is shown correctly for the newly generated rooms, but the old room map data is still there too.

Recommended way to stop the server?

Hi there,

Impressive work you have here, thanks for sharing!

I've been waiting to buy screeps until you released this server to play around with. Thank you!

I managed to get the server running eventually on Ubuntu 16.04 after some issues. I think mainly I just didn't know the correct versions of everything to use or maybe it wasn't setup quite right on the machine to begin with since it already had a node install on it. But I got it so woohoo! Eventually I will have to create an init script of some sort to start it on boot and whatnot.

I have very little experience with nodejs yet and I have no idea what the correct way to stop the server is. The only way I see is killing the processes which I'm not sure is the best route. Is there a recommended way to stop the server?

Thank you!

Installation process failing due to dependency error

npm ERR! Linux 3.14.32-xxxx-grs-ipv6-64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "screeps"
npm ERR! node v7.0.0
npm ERR! npm v3.10.8
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: @screeps/[email protected]
npm ERR! notarget Valid install targets:
npm ERR! notarget 1.0.1, 1.0.0, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'screeps'
npm ERR! notarget

IRC or Discord chat?

Is there any place that people can gather to discuss contributing or setting this bad boy up?

I want to replace the storage engine with mongodb or even a few others but I have lots of questions.

Also I have questions about running it in cluster form via docker...

Steam Web API connection error Error: HTTP 403

I'm trying to start Screeps server from my steam client with Start server option.

Im using Windows7 64 bit. My steam acount is not beta participiant,

At backend tab i see this message:
Loading mods from "D:\Steam\steamapps\common\Screeps\server\mods.json"
Connecting to storage
Starting CLI server
STEAM_KEY environment variable found, disabling native authentication
Connecting to Steam Web API
CLI listening on localhost:21026
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (D:\Steam\steamapps\common\Screeps\server\node_modules\steam-webapi\index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Starting game server (protocol version 12)
SockJS v0.3.18 bound to "/socket"
Game server listening on 0.0.0.0:21025
[127.0.0.1:65368] Incoming CLI connection
Connecting to Steam Web API
Running cronjob 'sendNotifications'
Running cronjob 'roomsForceUpdate'
Running cronjob 'genPowerBanks'
Running cronjob 'genInvaders'
Running cronjob 'purgeTransactions'
Running cronjob 'recreateNpcOrders'
Running cronjob 'calcMarketStats'
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (D:\Steam\steamapps\common\Screeps\server\node_modules\steam-webapi\index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Connecting to Steam Web API
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (D:\Steam\steamapps\common\Screeps\server\node_modules\steam-webapi\index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Connecting to Steam Web API
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (D:\Steam\steamapps\common\Screeps\server\node_modules\steam-webapi\index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Connecting to Steam Web API
Steam Web API connection error Error: HTTP 403 Forbidden
at IncomingMessage. (D:\Steam\steamapps\common\Screeps\server\node_modules\steam-webapi\index.js:154:37)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Connecting to Steam Web API

non interactive cli/rcon

Hi!

it would be awesome, if it's possible to send commands directly to the cli. Like screeps cli 'help();'

Virtual Environment

Any reason to create a virtual environment for this application? Docker or Vagrant powered? I would like to deploy it to AWS Lambda but their version of Node is ~4 which isn't compatible according to the docs.

lookForAtArea('terrain' not working in sim

Apologies if this is the wrong repo to post this in: I have utilized the lookForAtArea function to seemingly correctly populate a 3x3 grid looking for terrain types around sources.

//find the active sources in the room
function findSources(r){
        var result= Array();
        r.find(FIND_SOURCES_ACTIVE).forEach(function(source) {
            result.push(source.pos);
        });
        //Peek at the result by uncommenting the line below
        //console.log("findSources: "+JSON.stringify(result))
        return result;
}

function countMiningSpots(r){
        var result = Array();
        //get the pos of each source
        var posList = findSources(r);
        //Peek at the result by uncommenting the line below
        console.log("posList: "+JSON.stringify(posList));
        var i = 0;
        posList.forEach(function(posObj){
            //Check out the posObj
            console.log("posObj: "+posObj)
            //search the 3x3 grid with the source at the center
            result= (r.lookForAtArea('terrain',(posObj.x)-1,(posObj.y)-1,(posObj.x)+1,(posObj.y)+1));
        })
        //Peek at the result by uncommenting the line below
        console.log("countMiningSpots: "+JSON.stringify(result));
}

The code above will produce an array that is a 3x3 representation of accurate x and y properties, but not accurate terrain types as indicated in the following image.
screeps
I think this may be a flaw specific to the sim, but wanted to bring it to your attention regardless.

Leaderboard not working

I don't see a mod for leaderboards, how can I turn on leaderboards? They don't seem to work when we are two low-level players in the world.

Couldn't install through NPM

While trying to install through NPM, I keep getting the following errors:

`npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'screeps/common' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'screeps'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 2.6.32-042stab113.21
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "screeps"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /npm-debug.log
npm ERR! not ok code 0`

Also, the registry not found cycles if I just re-run the command (through screeps/backend, screeps/driver, etc).

Screeps 1.04 gets in process restart loop on Ubuntu 14.04

I had screeps running fine on Win10 (via Bash on Ubuntu anyway), but I can't get it to run on Ubuntu 14.04.

Trying with node v7.1.0. I just get continuous restarts:

# screeps start
Server build 35
Starting all processes. Ports: 21025 (game), 21026 (cli)
[storage] process 6720 started
[backend] process 6732 started
[engine_main] process 6733 started
[engine_runner1] process 6739 started
[engine_runner2] process 6745 started
[engine_processor1] process 6751 started
[engine_processor2] process 6757 started
[engine_main] process 6733 exited with code 1, restarting...
[engine_runner2] process 6745 exited with code 1, restarting...
[engine_runner1] process 6739 exited with code 1, restarting...
[engine_processor1] process 6751 exited with code 1, restarting...
[engine_processor2] process 6757 exited with code 1, restarting...
[backend] process 6732 exited with code 1, restarting...
[engine_main] process 6772 started
[engine_runner2] process 6778 started
[engine_runner1] process 6779 started
[engine_processor1] process 6785 started
[engine_processor2] process 6791 started
[backend] process 6802 started

Inspecting the log files I can see:

Error: Cannot find module './core/index'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.Module._load (module.js:420:25)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.getDriver (/usr/lib/node_modules/screeps/node_modules/@screeps/engine/dist/utils.js:21:18)
    at Object.<anonymous> (/usr/lib/node_modules/screeps/node_modules/@screeps/engine/dist/runner.js:8:20)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)

And listing that dir, the file ./core/index does appear to be missing:

# ll /usr/lib/node_modules/screeps/node_modules/@screeps/engine/dist/
total 104
drwxr-xr-x 5 nobody root  4096 Nov 10 00:31 ./
drwxr-xr-x 4 nobody root  4096 Nov 10 00:31 ../
-rw-r--r-- 1 nobody root   301 Nov  7 02:36 config.js
-rw-r--r-- 1 nobody root  3650 Nov  7 02:36 decycle.js
drwxr-xr-x 2 nobody root  4096 Nov 10 00:31 game/
-rw-r--r-- 1 nobody root   179 Nov  8 06:18 index.js
-rw-r--r-- 1 nobody root   103 Nov  7 02:36 local-config.js
-rwxr-xr-x 1 nobody root  4381 Nov  9 04:34 main.js*
drwxr-xr-x 3 nobody root  4096 Nov 10 00:30 processor/
-rwxr-xr-x 1 nobody root 19216 Nov  9 04:34 processor.js*
-rwxr-xr-x 1 nobody root  3503 Nov  9 04:34 runner.js*
drwxr-xr-x 4 nobody root  4096 Nov 10 00:31 sourcemaps/
-rw-r--r-- 1 nobody root 34976 Nov  8 06:09 utils.js

Please let me know if you need more info.

Launcher lag.

Hi guys,

I have recently noticed that the launcher gets very slow and choppy after say a day or three.
Not all components but mainly the engine_main & later backend.

The lag seems to be generated by the fact that the system stores all notifications of the chronjob executions / tick progression / errors.
Although these are essential in some way to keep track of. We should be able to purge the data when it overflows to such an extent that we can't scroll through the component.

I would suggest either a command to purge the notifications / history or a "history limit" that can be set by the server admin to limit to x amount of messages.

For the moment I have had to no choice but to slow this down manually by removing the line.
"console.log('Game time set to', gameTime);" from engine/dist/main.js to end that slowdown albeit temporarily.

ERR Cannot find module 'nan'

Hello,
when running npm install -g screeps it fails.
I am running Ubuntu 15.0.4
nodejs --version gives me v0.10.44
Any ideas about how to fix this ?

    throw err;
          ^
Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at [eval]:1:1
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:575:25)
    at startup (node.js:80:7)
    at node.js:945:3
gyp: Call to 'node -e "require('nan')"' returned exit status 8 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.19.0-65-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "-C" "native"
gyp ERR! cwd /usr/lib/node_modules/screeps/node_modules/@screeps/driver/native
gyp ERR! node -v v0.10.44
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Linux 3.19.0-65-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "screeps"
npm ERR! node v0.10.44
npm ERR! npm  v2.15.0
npm ERR! code ELIFECYCLE

npm ERR! @screeps/[email protected] install: `node-gyp rebuild -C native`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @screeps/[email protected] install script 'node-gyp rebuild -C native'.
npm ERR! This is most likely a problem with the @screeps/driver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild -C native
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @screeps/driver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls @screeps/driver
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/screeps/npm-debug.log

EDIT:
I did npm install -g nan
Now i get when installing screeps:

../src/pf.h: In member function ‘void screeps::open_closed_t::clear()’:
../src/pf.h:161:9: error: ‘numeric_limits’ is not a member of ‘std’
     if (std::numeric_limits<unsigned int>::max() - 2 <= marker) {
         ^
../src/pf.h:161:29: error: expected primary-expression before ‘unsigned’
     if (std::numeric_limits<unsigned int>::max() - 2 <= marker) {
                             ^
../src/pf.h:161:29: error: expected ‘)’ before ‘unsigned’
../src/pf.h: At global scope:
../src/pf.h:383:61: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
    const cost_t obstacle = std::numeric_limits<cost_t>::max();
                                                             ^
../src/pf.h:383:28: error: ‘numeric_limits’ is not a member of ‘std’
    const cost_t obstacle = std::numeric_limits<cost_t>::max();
                            ^
../src/pf.h:383:54: error: expected primary-expression before ‘>’ token
    const cost_t obstacle = std::numeric_limits<cost_t>::max();
                                                      ^
../src/pf.h:383:55: error: ‘::max’ has not been declared
    const cost_t obstacle = std::numeric_limits<cost_t>::max();
                                                       ^
../src/pf.h:383:55: note: suggested alternative:
In file included from /usr/include/c++/4.9/algorithm:61:0,
                 from ../../../../../../nan/nan.h:50,
                 from ../src/main.cc:1:
/usr/include/c++/4.9/bits/stl_algobase.h:261:5: note:   ‘std::max’
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
native.target.mk:87: recipe for target 'Release/obj.target/native/src/main.o' failed
make: *** [Release/obj.target/native/src/main.o] Error 1
make: Leaving directory '/usr/lib/node_modules/screeps/node_modules/@screeps/driver/native/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.19.0-65-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "-C" "native"
gyp ERR! cwd /usr/lib/node_modules/screeps/node_modules/@screeps/driver/native
gyp ERR! node -v v0.10.44
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Linux 3.19.0-65-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "screeps"
npm ERR! node v0.10.44
npm ERR! npm  v2.15.0
npm ERR! code ELIFECYCLE

Port Forwarding Issue

I am attempting to setup a server on a centos 7 server and can't seem to get the connection to go through from a remote connection. I have forwarded port 21025 to the server but still have not gotten a successful connection.

[Feature] Private Server in Browser

Currently the only way to play on a private server is to use the steam client.
Will there be a browser version like on screeps.com ?

Any ideas how i can play screeps on a private server on linux ?

Support for ARM?

I noticed that there is no support for ARM targets. I want to run Screeps on my Rasberry PI, but was unable to complete the build as it failed during the command node-gyp rebuild -C native which makes me think it's a problem with the target processor - ARM in the case of Raspberry Pi.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.