Skip to content

Server Commands ​

The dedicated server (npm --prefix src/games/fps run net:server -- ...) accepts admin commands at runtime via its TTY.

Starting servers ​

Install dependencies once with npm install at the SHAG root. The game checkout must be at src/games/fps; see Getting Started. Run each long-lived process in its own terminal. These examples start at the SHAG root:

PurposeCommand
Lobby, which starts match servers and runs invited botsnpm --prefix src/games/fps run lobby:server
Separate bot server, for a lobby started with --bot-servernpm --prefix src/games/fps run bot:server
Standalone match servernpm --prefix src/games/fps run net:server -- --map washoi_dm2 --gametype ffa
Build server bundles without starting a processnpm --prefix src/games/fps run build:server

The lobby flow needs only the lobby: it plays each match's bots in a match runner, a child process of its own. A standalone match server is an alternative for direct connections. The start commands build dist-server/ before launching Node; lobby:server:dev, bot:server:dev and net:server:dev run source through vite-node instead.

From src/games/fps, the equivalent short command is npm run lobby:server (and likewise for the other game commands). The launcher sets the working directory to the SHAG root in both cases: public/data/, dist-server/, and relative --data-dir paths resolve there. To use a separate test database, pass -- --data-dir ./server-data-test. With a separate bot server, give it the same data directory so the two share their control secret.

Production operations ​

Lobby-admitted human players have a 15-minute initial-loading allowance while they remain connected as spectators. Entering play or explicitly choosing to spectate ends that allowance. After it expires, the spectator-only idle policy can close the match after two minutes without a playing human. Empty-server and post-game cleanup remain separate; this allowance does not reserve a dropped spectator connection for 15 minutes.

Production operators use independent engine/game checkouts and select exact revisions in /srv/washoi/release-pair.json. By default, deployment follows engine main and its recorded game revision, then restarts the backend even with connected players. Set mode to pinned to hold or roll back a pair. The regional deploy and startup scripts, activation behavior and rollback procedure are documented in the production runbook. Changing npm commands does not itself release new application code or restart running servers.

Gameplay Cvars ​

Server-side tunables (defaults shown). Movement cvars live in src/engine/movement/MovementVars.ts.

Fall damage ​

CvarDefaultEffect
sv_falldamage1Master toggle (0 = off)
sv_falldamage_min256Drop (map units) where damage starts
sv_falldamage_full384Drop where the ramp reaches 100 / crush point (all armor + 1 HP)
sv_falldamage_fatal512Drop that is instantly fatal (self-frag)
sv_falldamage_crouchsoften64Effective drop reduction when landing crouched

A server-console [FallDamage] line logs the raw vs effective drop and the band on every landing — handy for tuning.

Teleporters ​

Exit-velocity policy is a movement config value (deterministic; deliberately not a live cvar, so demo re-simulation stays exact). The default redirects the player's full 3D momentum along the exit yaw (Warsow); an alternate mode uses a fixed Q3 exit speed. See MovementConfig.teleportSpeedMode / teleportExitSpeed.

Dedicated Server Console ​

The dedicated server reads commands from its terminal (stdin). It has three:

CommandEffect
spawn_bots <N> (alias bots)Spawn N bot entities (1–32; default 3) at spawn points
statusPrint the map and tick rate
helpList the commands

Anything else prints Unknown command. There is no kick, restart, endmatch or map-rotation command; matches are started and ended through the lobby, or by restarting the process. A lobby-spawned server also receives one internal command from the lobby, used to seat a player who drops into a running match. It isn't meant to be typed by hand.

Bots spawned this way are simple server-side entities, not the game's bots. For bots that play like people and have difficulty tiers, add them from a lobby room.

Server Launch Options ​

bash
npm --prefix src/games/fps run net:server -- --map washoi_dm2 --gametype duel --port 7777
FlagDefaultNotes
--mapwashoi_dm2Map name (must exist in public/data/)
--gametype, -gDeathmatchRelease modes: Deathmatch (ffa), Duel (1v1), Amphi, SnD (bomb, searchanddestroy). Unknown values fall back to Deathmatch
--port7777WebSocket port
--name, --hostnameSHAG Server v2Server name
--max, --maxclients16Max clients
--tickrate125Simulation rate in Hz
--snapshotrate60Snapshot rate in Hz
--game./gameGame data path
--cert, --key./certs/localhost*.pemTLS certificate and key (or SHAG_GAME_CERT_PATH / SHAG_GAME_KEY_PATH)
--shutdownoffExit when all clients disconnect
--single-matchoffOne match per server: the post-game is final, players return to the lobby, bots are released and the process exits. This is how the lobby runs matches

Match pacing overrides ​

Three environment variables, read once at boot, change a gametype's limits. They are useful for short test matches and apply to every gametype (see Deathmatch):

VariableMeaning
SHAG_TIMELIMITBare number = minutes; 90s for seconds
SHAG_SCORELIMITFrag or round limit
SHAG_WARMUPBare number = seconds; 2m for minutes
SHAG_DEBUGExtra diagnostics, as a comma-separated list of topics or all. Off by default; see below

Server diagnostics ​

The server console prints lifecycle events (joins, match start and end, demos saved) and problems. Anything that would print per tick, per hit or per message is off unless you ask for it:

bash
SHAG_DEBUG=phys,kb npm --prefix src/games/fps run net:server
TopicPrints
physOne line per player per second from the movement code
kbKnockback applied, and the position after that tick
falldamageEvery landing, with the drop and its damage band
inputA sample of the input buttons every 200 commands
perfSnapshot encode cost every 100 ticks
dischargeA shot fired into water
tickrateThe measured tick rate every 5 s, also when it is on target
telemetryOne line per playing client every 5 s: jitter, loss, aim and strikes
spawnRespawn requests, the spawn point picked and the respawn
killsOne line per kill
chatEach chat line, with its sender
botBot server and match runners: each bot's status line, deaths and respawns
setupA match's configuration: spawn points, collision, PVS, pickups and the tick loop

Game Console Commands ​

Registered by this game at boot (console/commands/), used from the in-game console (press ` the backquote key):

CommandWhat it does
connect <url> / disconnectJoin or leave a game server; see Connecting
demo, demolist, demoplayLoad, list and play demos; see Demos
videoexportOpen MP4 export (highlight reel or full match) for a loaded demo, including release builds with developer 0. See Demos
loadout <primary> <secondary>Pick a kit for your next spawn in Search & Destroy, Amphi or FFA
loadout statusInspect the selected kit, server weapons, local inventory, HUD, displayed viewmodel and viewed-player identity without changing them
water [sample|splash|ripple|render] devInspect liquid state at the camera and the player
netsim <test|spawn|tick|state|input> devNetwork simulation testing
pickup_auditAudit client/server pickup active-set reconciliation
camera_auditReport what owns the camera and what is rolling the view

The engine adds its own (map, bind, and others); see the engine's command reference.

Built on the SHAG Engine.