danielesteban / blocks

webxr multiplayer voxels engine
https://blocks.gatunes.com/
MIT License
60 stars 7 forks source link
game-engine nodejs oculus threejs virtual-reality voxels webxr

blocks Build Status

screenshot

Create your own server in two steps:

If you want to experiment with world generation:

You can also use docker-compose if you already own a more powerful server:

version: '3'
services:
  server:
    image: danigatunes/blocks:latest
    environment:
     - NAME=Your Server Name
     - PRELOAD=10
     - PUBLIC_URL=https://yourserver.url/
     - SEED=1234
     - STORAGE=/data
    ports:
     - "80:8080"
    volumes:
     - "data:/data"
volumes:
  data:

Want your server to show up on the in-game map?

At the moment, the main server list verification is kind of a manual process. I will check the list from time to time and manually approve them after checking they work correctly. I need to write better tools to streamline the process, but there's other priorities right now. If you want to speed this up, you can always drop me a line on twitter with the url of your server.

Server configuration

# random seed, no preload, 16 clients
node server/main.js
# same, but preloading a 10 chunk radius around the spawn area
PRELOAD=10 node server/main.js
# flat world for only 4 clients with persistence
GENERATOR=flat MAX_CLIENTS=4 PRELOAD=10 SEED=1234 STORAGE=./data node server/main.js
# heightmap driven world generator
GENERATOR=heightmap COLORMAP=./island_rgb.png HEIGHTMAP=./island_height.png node server/main.js

Local development

webxr requires an https origin. to test with headsets on your local network:

# generate a self-signed cert/key:
openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout server.key -out server.crt
# start the server with TLS
TLS_CERT=server.crt TLS_KEY=server.key npm start