This is an open-source online implementation of the great board game Terraforming mars. It is not affiliated with FryxGames, Asmodee Digital or Steam in any way.
Terraforming Mars Board Game
The board game is great and this repository highly recommends purchasing it for personal use.
Join us on Discord here.
You can demo this web app online here. If you find a bug or have a feature request, please add it as one in issues tab. If you plan on playing long-running games, it is recommended that you host the game locally. This demo site is currently not stable and gets restarted during each push to main
. A multiplayer game will remain available for 10 days, after which it will be flushed from the database. Unfinished solo games are flushed after one day. As this repository is gaining in popularity, we will attempt to make this demo page stable but cannot guarantee that your game will not be lost. It is highly recommended to host the game locally, and it's dead simple: run npm install
and then npm run start
.
Docker Hub image is made for users who difficulty to Vist the Demo website. You can build game server easily.
- Search terraforming-mars docker image on you NAS(eg:QNAP or Synology) or other container. You can find [ltdstudio/terraforming-mars].
- Build it when you downloaded docker Image.
- Run it. It will start the game server listening on the Host port of 8080. Docker Image homepage is: https://hub.docker.com/r/ltdstudio/terraforming-mars
You can run the game server locally if you have npm
and node
. To start the game server run the start
script.
npm install
npm run build
npm run start
This will start the game server listening on the default port of 8080. If you then point a web browser to http://localhost:8080 you will be on the create game screen. To change this port from 8080, add PORT=<new port>
in your .env
file.
Pointing your web browser to http://localhost:8080/games-overview?serverId=_SERVER-ID_ will provide a list of all games available on the server. The secret SERVER-ID is available from the console after starting the server and required to access game administration pages like the games overview.
Additional information on how to setup the game server locally can be found here (short version) and here (detailed version).
A .env file allows you to store environmental variables like PORT=443
. The following are supported and are optional:
PORT
: (default 8080) Which port to use for this serverHOST
: What hostname to useCERT_PATH
: Your TLS certificate path (=>fullchain.pem
created by certbot)KEY_PATH
: Your TLS private key path (=>privkey.pem
created by certbot)MAX_GAME_DAYS
: How many days to keep unfinished games before deleting themWAITING_FOR_TIMEOUT
: (default 5000) How many milliseconds to check for game update on multi-player gamesASSET_CACHE_MAX_AGE
: (default 0) How many seconds should assets (fonts, stylesheets, images) be cached by browsersSERVER_ID
: (default random) Static pass phrase to restrict access to /games-overview and /api/games endpointsLOCAL_FS_DB
: When non-empty, stores game states in JSON files. Good for local development and debugging, bad for hosting lots of games.
A .env.sample
file can be used as a template. You can rename it to .env
and it will take effect in your environment. Note that .env
is ignored in source control.
If you are looking for a dead simple deployment, use Heroku, instructions are are on the wiki. For Docker, read below.
Additional information on how to setup the game with Docker can be found here.
To set up an HTTPS sub/domain for use with this project, set the paths for KEY_PATH
and CERT_PATH
in your .env
. If you do not have a TLS cert/key for your domain, you can get one for free from certbot.
Thanks goes to these wonderful people:
GPLv3