This is a from-scratch rewrite of the Screeps backend services, brought to you by the author of the [path finder](https://github.com/screeps/driver/blob/master/native/src/pf.cc) and also [isolated-vm](https://github.com/laverdet/isolated-vm). The goal of
npm install xxscreepsThis is a from-scratch rewrite of the Screeps backend services, brought to you by the author of
the path finder and also
isolated-vm. The goal of this project is to build a very
fast version of the Screeps backend service which will greatly improve upon the local single-player
experience, and perhaps eventually the multiplayer world as well.
StructureWall can be represented in 44 bytes, and a creep with a fully loadedThe first advantage of this is greatly improved performance of the runner service. Game state is
read from the database as anArrayBuffer
which can be instantly transferred into the player's runtime for free. In vanilla Screeps the
process of requesting game state from the database and loading it into the runner requires several
costly serialization and deserialization steps.
The real crazy part is that we can overlay JavaScript game state directly on top of these room
blobs. Inherited getters
are created which reach into the blob and pull out game state as it requested by the user's script.
So, for example, if you go an entire tick without accessing the body property on a Creep, that
array along with all its contents will never be materialized into the v8 heap. This greatly reduces
the burden of the garbage collector which robs every player of a significant portion of CPU.
Storage of room blobs can be efficiently sharded within a world shard as well. These blobs are no
different than a very small JPEG file, like from the 90's. We could theoretically infinitely scale a
game world in all directions by linearly adding more processor workers.
transferCreepconsole.log(creep) into the console and seeing [Object object]To get xxscreeps running here's what you need to do. This should work on Linux, macOS, and Windows.
First step is make sure nodejs v16.x is installed, older versions will not work.
```
git clone https://github.com/laverdet/xxscreeps.git
cd xxscreeps
npm install
npm run build
npx xxscreeps import
After that you can start xxscreeps via npx xxscreeps start except you won't be able to connect.screepsrc.yaml
with the Steam client. You'll need to create a file with content:``
backend:
steamApiKey:
If you're using VS Code and you have the YAML extension installed all the options should
autocomplete. If not you can read the config
schema.
If you want to install xxscreeps via docker you can use the following docker-compose.yaml as an`
example.yaml`
version: "3"
services:
xxscreeps:
image: nilskri/xxscreeps
ports:
- "21025:21025"
volumes:
- set this if you want to persist the content
-
Or you can use this short script in a fresh copy of the git source to start a new container which
persists data to the current working directory.
``
docker build -t xxscreeps .
docker run -it -p 21025:21025 \
--mount type=bind,source="$(pwd)"/.screepsrc.yaml,target=/usr/app/xxscreeps/.screepsrc.yaml \
--mount type=bind,source="$(pwd)"/screeps,target=/usr/app/xxscreeps/screeps \
xxscreeps
If you've read this far, hopefully you would like to help. Without support from the community
xxscreeps will definitely fail and die.
If you are a novice developer the best thing you can do is help test and provide feedback. Install
xxscreeps and get your scripts running and help find inaccuracies in the game engine.
Troubleshooting is your most valuable contribution! A bug report of "my creeps are getting stuck
when walking past sources" is not very helpful. A bug report of "findClosestByPath returnsundefined instead of null when there is no result" or "transfer and withdraw don't transferamount === 0`; these functions should transfer the maximum amount possible in
any resources when
this case" is extraordinarily helpful.
If you are a professional developer and you want to help there's still a lot of features that need
to be developed. Feel free to talk to me about the status of the project!
Join the official Screeps Discord. You can find me [The General] in
the #xxscreeps channel.