{BINARY}(6)
=========
:man source:  Spring package
:man manual:  Games

Name
----
ifdef::DEFAULT[{BINARY} - An open source RTS game engine - Default Engine]
ifdef::LEGACY[{BINARY} - An open source RTS game engine - Legacy Engine]
ifdef::HEADLESS[{BINARY} - An open source RTS game engine - Headless Engine]
ifdef::DEDICATED[{BINARY} - An open source RTS game engine - Dedicated Server]

Synopsis
--------
ifndef::GUILESS[*{BINARY}* [-f|--fullscreen] [-w|--window] [-m|--minimise] [--safemode] [-s|--server 'IP_OR_HOSTNAME'] [-p|--projectiledump] [-t|--textureatlas] [--benchmark 'TIME' [--benchmarkstart 'TIME']] [-i|--isolation] [--isolation-dir 'PATH'] [-n|--name 'STRING'] [-C|--config 'FILE'] ['SCRIPT']]
ifdef::HEADLESS[*{BINARY}* [--safemode] [-s|--server 'IP_OR_HOSTNAME'] [-p|--projectiledump] [--benchmark 'TIME' [--benchmarkstart 'TIME']] [-i|--isolation] [--isolation-dir 'PATH'] [-n|--name 'STRING'] [-C|--config 'FILE'] SCRIPT]
ifdef::DEDICATED[*{BINARY}* [-i|--isolation] [--isolation-dir 'PATH'] [-C|--config 'FILE'] SCRIPT]
ifndef::DEDICATED[]

*{BINARY}* --list-ai-interfaces

*{BINARY}* --list-skirmish-ais

*{BINARY}* --list-def-tags
endif::DEDICATED[]

*{BINARY}* --list-config-vars

*{BINARY}* [-h|--help]

*{BINARY}* --sync-version

*{BINARY}* [-V|--version]

Description
-----------
Spring is a versatile 3D RTS game engine. Using extensively Lua for scripting
game-specific code to make nearly every aspect of the engine customizable,
from GUI, to unit AI, to pathfinding.

It is mainly designed around online multiplayer games but can also be played in
single-player mode against AIs.

ifdef::DEDICATED[]
This is the dedicated, GUI-less server for hosting multiplayer games.
You need to feed it a start script in order to have it host a game.
Start script are generated by lobby clients (SpringLobby)
or autho-hosts (Spads, Springie).
This is the most leight-weight version of the engine,
which basically only redirects network traffic, while spring-headless still
runs a full blown simulation of the game.
endif::DEDICATED[]
ifdef::HEADLESS[]
This is the engine version without graphics or sound output.
It still runs the full simulation, while spring-dedicated basically
only redirects network traffic.
It is useful for testing and simulating AI only games at high speeds
on systems without graphics and sound output support.
endif::HEADLESS[]
ifdef::DEFAULT[]
The engine can run graphics and simulation in two separate threads,
depending on the game and engine settings.
This will typically boost the performance on multi-core systems.
endif::DEFAULT[]
ifdef::LEGACY[]
This engine version runs graphics and simulation in a single thread,
and may marginally increase the performance on single-core systems.
endif::LEGACY[]

Options
-------
*-h, --help*::
  Print the options help message and exit

*-V, --version*::
  Display program version and exit

*--sync-version*::
  Display program sync version (for online gaming) and exit

*--nocolor*::
  Disables colorized stdout

*--quiet*::
  Ignore unreccognized arguments
ifndef::GUILESS[ ]
ifndef::GUILESS[*-f, --fullscreen*::]
ifndef::GUILESS[  Run in fullscreen mode]
ifndef::GUILESS[ ]
ifndef::GUILESS[*-w, --window*::]
ifndef::GUILESS[  Run in windowed mode]
ifndef::GUILESS[ ]
ifndef::GUILESS[*-b, --minimise*::]
ifndef::GUILESS[  Start in background (minimised)]
ifndef::DEDICATED[ ]
ifndef::DEDICATED[*--safemode*::]
ifndef::DEDICATED[  Turns off many things that are known to cause problems (i.e. on PC/Mac's with lower-end graphic cards)]
ifndef::DEDICATED[ ]
ifndef::DEDICATED[*-s, --server*::'IP_OR_HOSTNAME'::]
ifndef::DEDICATED[  Run as a server on the given address]
ifndef::GUILESS[ ]
ifndef::GUILESS[*-t, --textureatlas*::]
ifndef::GUILESS[  Dump each finalised textureatlas into textureatlasN.tga]
ifndef::GUILESS[ ]
ifndef::GUILESS[*--benchmark*::'TIME'::]
ifndef::GUILESS[  Enable benchmark mode (writes a benchmark.data file). The given number specifies the timespan to test.]
ifndef::GUILESS[ ]
ifndef::GUILESS[*--benchmarkstart*::'TIME'::]
ifndef::GUILESS[  Benchmark start time in minutes.]

*-i, --isolation*::
  Limit the data-dir (games & maps) scanner to one directory
  (see --isolation-dir and the SPRING_ISOLATED env var)

*--isolation-dir*::'PATH'::
  Specify the isolation-mode data-dir
  (see --isolation and the SPRING_ISOLATED env var)

*--write-dir*::'PATH'::
  Specify the directory used for all saving.
ifndef::DEDICATED[ ]
ifndef::DEDICATED[*-n, --name*::'NAME'::]
ifndef::DEDICATED[  Set your player name]

*-C, --config*::'FILE'::
  Exclusive configuration file
ifndef::DEDICATED[ ]
ifndef::DEDICATED[*--list-ai-interfaces*::]
ifndef::DEDICATED[  Dump a list of available AI Interfaces to STDOUT]
ifndef::DEDICATED[ ]
ifndef::DEDICATED[*--list-skirmish-ais*::]
ifndef::DEDICATED[  Dump a list of available Skirmish AIs to STDOUT]
ifndef::DEDICATED[ ]
ifndef::DEDICATED[*--list-def-tags*::]
ifndef::DEDICATED[  Dump a list of available Definition Tags in JSON-format to STDOUT]
ifndef::DEDICATED[ ]
ifndef::DEDICATED[*--list-ceg-classes*::]
ifndef::DEDICATED[  Dump a list of available Projectile classes in JSON-format to STDOUT]

*--list-config-vars*::
  Dump all default config vars in JSON-format to STDOUT

*-g, --game*::'GAME'::
  instantly start the GAME with a minimal setup. Requires --map to be present, too.
  Sets the modoption minimalsetup = 1

*-m, --map*::'MAP'::
  Requires --game to be set, too. see --game

Files
------
  ~/.config/spring/

The default data-directory (see section DATA DIR).

  ~/.config/spring/springsettings.cfg

Contains the users settings for the engine, for things like graphic and sound.

  /etc/spring/datadir

Contains the ':' separated paths to additional data-dirs (see section DATA DIR).

Enviroment Variables
--------------------
*SPRING_LOG_SECTIONS*
  Selective functionality to change the verbosity (separated by ',').

*SPRING_WRITEDIR*
  Define custom primary write DATA DIR. Place where spring saves logs, settings, ...

*SPRING_DATADIR*
  Adds additional DATA DIRs Spring will search for files (separated by ':').

*SPRING_ISOLATED*
  If defined, Spring will stop searching files outside of the binaries
  directory. If it is set to a valid directory path, it will be used as the
  isolation directory.
  See the --isolation and the --isolation-dir options.

*SPRING_NOCOLOR*
  Same as `spring --nocolor`.

Script
------
Can either be a:

- Spring URL (spring://[username[:password]@]host[:port])
- start script (often named script.txt)
- replay file (*.sdf)
- save game (*.ssf)

Portable Mode
-------------
An all-in-one-folder setup, which allows to run Spring without installation.
To do so all relevant files (binaries & basecontent) must be in a single folder,
esp. spring(.exe), libunitsync.so/unitsync.dll and springsettings.cfg.
Spring will then use the all-in-one-folder for writing and won't do so anywhere else on the system,
but it may open other files & directories for reading.

Isolation Mode
--------------
Not to confuse with Portable Mode, this mode disables all automatic Data Dir scanning and limit reading & writing to a single folder.
This is very useful when games want to run separate from other Spring games.
Isolation mode can be enabled by placing an empty isolated.txt next to the spring executable or by setting SPRING_ISOLATED env var.

Data Dirs
--------
Data directories are searched for content, and among other things, may contain:

- config files
- logs
- games
- maps
- AIs
- cache

{set:NORMAL_DIRS:CONFIG_HOME \n\n ETC_DIRS \n\n USR_SHARE}
{set:PORTABLE_DIRS:INSTALL_DIR \n\n CONFIG_HOME \n\n ETC_DIRS \n\n USR_SHARE}
{set:USER_WRITEDIRS:directory defined via --write-dir \n\n SPRING_WRITEDIR envvar}
{set:USER_READDIRS:SPRING_DATADIR envvar \n\n SpringData configtag}

Sorted by priority the engine may use multiple data directories,
but it will use only the one with the highest priority as writable, to write cache & log
files to.
The hierarchy the engine loads DATA DIRs in can be grouped in 3 sections:

[options="header"]
|=======
^| priority ^| section          ^| normal                           ^| portable                         ^| isolation
>| high      | custom user write | {sys: echo -e "{USER_WRITEDIRS}"} | {sys: echo -e "{USER_WRITEDIRS}"} | {sys: echo -e "{USER_WRITEDIRS}"}
 |           | automatic scanned | {sys: echo -e "{NORMAL_DIRS}"}    | {sys: echo -e "{PORTABLE_DIRS}"}  | ISOLATION_DIR
>| low       | custom user read  | {sys: echo -e "{USER_READDIRS}"}  | {sys: echo -e "{USER_READDIRS}"}  | {sys: echo -e "{USER_READDIRS}"}
|=======

*CONFIG_HOME*::
  Config directories in user's home. +
  *nix/MacOSX: :::
		${XDG_CONFIG_HOME-"\~/.config"}/spring +
		~/.spring +
  Windows: :::
		C:/.../My Documents/My Games/Spring/ +
		C:/.../My Documents/Spring/ +
		C:/.../All Users/Applications/Spring/

*INSTALL_DIR*
  Location of {BINARY} binary.

*ETC_DIRS*
  Additional ':' separated DATA DIRs defined in /etc/spring/datadir.

*USR_SHARE*::
  *nix/MacOSX: /usr/.../share/spring & binary dir if is Data Dir +
  MacOSX: .../Spring.app/Contents/Resources/share/games/spring/base/ +
  Windows: Install directory

*ISOLATION_DIR*::
  Mode A (--isolation): INSTALL_DIR +
  Mode B (--isolation-dir): supplied dir

Config Files
------------
Spring can load configurations from multiple files and merge them.
So similar to DATA DIRs there is one file where the engine writes to and multiple read-only files.

It scans following directories for config files :
[options="header"]
|=======
| priority | scanned directories
>| exclusive | file defined via *--config* (when defined only this is loaded)
>|      high | write DATA DIR
 |           | {sys: echo -e "(skipped in Isolated mode) \n\n *nix/MacOSX: ~/.springrc \n\n Windows: C:\Users\USER\AppData\Local\springsettings.cfg"}
>|       low | all read DATA DIRs
|=======
(The one with highest priority will be used for writing.)

The filename of such config files can be as following:
[options="header"]
|=======
| priority | filenames
>| high | springsettings-%Engine_Version%.cfg
 |      | springsettings.cfg
 |      | springrc-%Engine_Version% (*nix/MacOSX only)
>|  low | springrc (*nix/MacOSX only)
|=======
(An example for a versioned config file is "springsettings-94.1.cfg".)


See also
--------
ifndef::DEFAULT[spring(6)]
ifndef::LEGACY[spring-legacy(6)]
ifndef::HEADLESS[spring-headless(6)]
ifndef::DEDICATED[spring-dedicated(6)]

Homepage
--------
More information about Spring can be found at
link: http://springrts.com

Author
------
Spring was written by the Spring developers.

This manual page was written by Marco Amadori <marco.amadori@gmail.com>,
for the Debian project (and may be used by others).
