Sauerbraten for the web in a single Docker image.
Sour is a multiplatform modernization of Cube 2: Sauerbraten delivered as a single Docker image. Give it a try.
/server/[ip]/[port]
) and maps (/map/complex
)/getmap
and /sendmap
)sourdump
, a tool for calculating all of the files a Sauerbraten map, model, or .cfg
file uses so that you can only send the minimum set of assets a client needsdocker run --rm -it -p 1234:1234 -p 28785:28785/udp ghcr.io/cfoust/sour
You can then access Sour at http://localhost:1234/
or by connecting in the desktop client with /connect localhost
.
If you wish to deploy Sour more seriously, I provide an example configuration for docker-compose here using letsencrypt-nginx-sidecar.
Here is a high level description of the repository's contents:
services/game
: All of the Cube 2 code and Emscripten compilation scripts. Originally this was a fork of BananaBread, kripken's original attempt at compiling Sauerbraten for the web. Since then I have upgraded the game to the newest mainline version several times and moved to WebGL2.services/go/
: All Go code used in Sour and its services.
services/assets
: Scripts for building web-compatible game assets. This is an extremely complicated topic and easily the most difficult aspect of shipping Sauerbraten to the web. Check out this section's README for more information.services/ingress/
: nginx
configurations for development, production, and Gitpod.services/proxy/
: A fork of wsproxy. This allows web clients to connect to all of the existing Sauerbraten servers and crossplay with desktop clients.services/client/
: A React web application that controls Sauerbraten, pulls assets, and proxies all game communication over WebSockets.Join us on Discord to chat with us and see how you can help out! Check out the issues tab to get an idea of what needs doing.
The easiest way to hack on Sour is in Gitpod using the button below. Gitpod is a web-based VSCode environment that runs everything necessary for development in a cloud-based container, meaning that everything is set up and working for you right away. You do not even have to use VSCode; Gitpod supports custom dotfiles which allows me to use my full vim-based setup from a browser tab.
If you want to run things locally all you need is Docker, Earthly, and docker-compose
. After that, just run ./serve
. Then navigate to http://localhost:1234
. All of the game's services will recompile and restart when you make changes.
Some years ago I came across BananaBread, which was a basic tech demo that used Emscripten to compile Sauerbraten for the web. The project was limited in scope and done at a time when bandwidth was a lot more precious.
Each project that was forked into this repository has its own original license intact, though the glue code and subsequent modifications I have made are licensed according to the MIT license specified in LICENSE
.