What the server is

What this is

ngspades-server is the game server of ngspades (its client is ngspades-client), a voxel shooter in the line of Ace of Spades. One program runs everything: the match, the bots, the game modes, the Lua plugins, the list of servers and the browsers’ connection. It is also the reference implementation of protocol 1.0, the network protocol shared with ngspades-client, the game’s client.

It started as a fork of SpadesX and grew from there. Its source is at github.com/ngspades/server under the GPL-3.0-or-later license.

This manual has two parts.

Tip Short on time? Read Installing and first start, change the five passwords (see Configuration) and open the game’s UDP port (see Network). That is all a private server needs.

The two profiles

One binary, two profiles. The profile decides which protocol the server speaks and which config file it reads.

protocol 1.0 (default)0.75 (--profile 075)
Clientsngspades-client and its browser versionthe original Ace of Spades 0.75 and 0.76 clients and their forks (OpenSpades, BetterSpades, ZeroSpades) with the community’s protocol extensions
Config fileResources/config.tomlResources/config-075.toml
Default game port (UDP)3288732897
Data folderthe rootdata-075/ in the root
Playersup to 128up to 32
Maps512 x 512 or 1024 x 1024512 x 512
Game modescapture the flag (two flavours), team deathmatch, king of the hill, territory control, zombies, arena, Plant the Bomb, Babel, creative, and Lua modescapture the flag and Babel, and Lua modes made for it
Extrasclasses, perks (jetpack, sentry, machine gun, landmines, dynamite), vehicles, squads, supply crates, the time of day and the weathernone of the 1.0 inventions; ZeroSpades’ extensions instead (damage markers, pings, flashlight, day and night…)
Joina 1.0 client only; a vanilla client is refused with “wrong protocol”a 0.75 or 0.76 client only

The two profiles run side by side on one machine: they use different ports, config files and data folders. A section of a config that belongs to the other profile is ignored with a warning at start.

Note The profile is chosen once, at start: --profile 10|075 or SP_PROFILE. An unknown value stops the server; it never falls back to the other profile, because a 0.75 server on config.toml would take the 1.0 port.

What it does that other servers do not

The README of the repository compares the server with SpadesX and piqueserver feature by feature, with measured numbers for the map and the network.

Concepts used throughout the manual

NameTypeMeaning
rootfolderThe folder that holds `Resources/`. The server finds it by itself (the current folder, `..` or `../..`); `--root` points at another. Paths in the config are relative to it.
data folderfolderWhere the server writes: `Bans.json`, `master.key`, `webrtc.pem`, `logs/`, the plugins' stores. The root by default, `data-075/` for the 0.75 profile; `--data` or `SP_DATA_DIR` moves it.
rotationlistThe maps the server plays in turn (`[server] maps`).
presettableA named bundle of mode, maps, limits and plugins (`[presets.<name>]`).
rolewordA staff level a player takes with `/login`: `trusted`, `guard`, `mod`, `admin`, `manager`.
EVTlog lineA structured line of the gameplay event log, `EVT <ms> <actor> <event> key=value`, on with `SP_EVENTLOG=1`.
pluginLua file`Resources/plugins/<name>.lua`: a script the server runs in a sandbox.

Where to go next

InstallInstalling and first start
Every settingConfiguration: a table per section, generated from the server’s own registry of keys
Pick a mode and mapsGame modes and maps
Run it for a communityAdministration and commands, Network, the public list, browsers, Operations
Write a pluginPlugins: how they run and the chapters after it