cfoust / sour

Sauerbraten for the web in a single Docker image.
https://sourga.me/
MIT License
159 stars 30 forks source link
cube emscripten first-person-shooter game golang metaverse multiplatform multiplayer typescript

Sour Cover Image

Discord sour releases sour License Badge MIT

What is this?

Sour is a multiplatform modernization of Cube 2: Sauerbraten delivered as a single executable (with adjacent assets.) It is a Sauerbraten server that serves a fully-featured web-version of Sauerbraten (with support for mobile devices) in addition to accepting connections from the traditional, desktop version of the game. Sour is the easiest way to play Sauerbraten with your friends.

Give it a try.

Installation

You can download an archive containing the Sour server and all necessary assets from the releases page. For now, only Linux and macOS are supported.

You can also install Sour via brew:

# Install the latest version:
brew install cfoust/taps/sour

# Or a specific one:
brew install cfoust/taps/sour@0.2.2

Running Sour

To run Sour, extract a release archive anywhere you wish, navigate to that directory, and run ./sour. If you installed Sour with brew, just run sour in any terminal session.

Running sour will start a Sour server accessible to web clients at http://0.0.0.0:1337 and to desktop clients on port 28785. In other words, you should be able to connect to the Sour server in the Sauerbraten desktop client by running /connect localhost.

By serving on 0.0.0.0 by default, the Sour server will be available to other devices on the local network at IP of the device running the Sour server.

Configuration

Sour is highly configurable. When run without arguments, sour defaults to running sour serve with the default Sour configuration. You change Sour's configuration by providing the path to a configuration file to sour serve:

sour serve config.yaml

Sour can be configured using .yaml or .json files; the structure is the same in both cases.

To print the default configuration to standard output, run sour config:

sour config > config.yaml

Sour also supports merging configurations together.

sour serve config_a.yaml some_path/config_b.json config_c.yaml

These configurations are merged from left to right using CUE. CUE merges JSON data by overwriting values (if they're scalar, such as strings, booleans, and numbers) or combining values (if they're arrays). In effect, this means that configurations can specify values for only a subset of properties without problems.

Goals

Architecture

Here is a high level description of the repository's contents:

Contributing

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.

Inspiration

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.

License

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.