Command line parameters

From SRB2 Wiki
(Redirected from Command line parameter)
Jump to: navigation, search

SRB2 has many command line parameters that can be used to launch the game with special settings, such as switching graphics renderers, changing networking parameters or adding files. These parameters can be added via a command line interpreter such as the Windows Command Prompt (cmd.exe), or by executing a batch file. For example, the file SRB2 - OpenGL.bat that comes with SRB2 contains the text srb2win.exe -opengl, which launches SRB2 with the OpenGL renderer. Launcher programs for SRB2 allow the user to set some of these parameters in a graphical interface.

List of parameters

In the tables below, text to be entered exactly is in Roman type, text to be replaced with an appropriate value is in italic type, and optional parameters are enclosed in square brackets.

General settings

Parameter Description
-compress Optimizes all loaded maps by removing unneeded sidedefs. This feature is unsupported and may end up removing sidedefs that were needed by a special effect.
-config filename Uses the specified configuration file instead of config.cfg.
-console Creates a separate console window that shows the SRB2 console's output and allows console commands and variables to be entered.
-detachconsole Requires srb2dd.exe

Detaches SRB2 from any console window it might be attached to and creates a separate console window that shows the SRB2 console's output and allows console commands and variables to be entered.

-file filename1 filename2 ... Specifies extra WAD, SOC or Lua files to be added to the game.
-home folder Specifies the game's home folder, where files such as config.cfg, gamedata.dat, savegames, logs, screenshots, the DOWNLOAD folder and Record Attack replays are stored.
-nodata Starts the game without loading game data; unlike -resetdata, the game will not overwrite the game data file.
-resetdata Starts the game without loading game data; unlike -nodata, the game can overwrite the game data file later.
-skipintro Skips the intro on startup, immediately going to the title screen instead.
-ultimatemode Starts a game in Ultimate mode.
-warp mapnum Automatically warps to the specified map upon starting the game. The map can be supplied either in the integer representation (e.g., -warp 101) or in the extended map number representation (e.g., -warp MAPA1). Use of this parameter marks the game as modified, unless -server is also used.

Video

Parameter Description
-borderless SDL2-only

Starts up the game with a borderless window.

-height height Sets the screen height in pixels. Only certain width/height combinations are supported.
-noblit In SRB2 executables that use the SDL 1.2 library, this causes video surfaces to be created in system memory rather than video memory. In the official SRB2 executables, which use SDL2 or DirectDraw, this has no effect.
-nodraw Turns off rendering once the timedemo console command is used. This is useful for testing how fast the game can process a demo without rendering. Rendering will remain disabled after processing the demo, so in order to read the console output afterwards, you either need to check the log or use the -console parameter to create an external console.
-opengl Uses OpenGL as SRB2's renderer.
-softblit SDL2-only

Makes SDL2 render the game with a fallback software renderer and with a 32-bit RGBA pixel format instead of a 16-bit RGB format.

-voodoo Turns on gr_voodoocompatibility, which limits textures and sprites in OpenGL to 256×256 pixels.
-width width Sets the screen width in pixels. Only certain width/height combinations are supported.
-win Starts SRB2 in windowed mode.

Sound/Music

Parameter Description
-ds3d Requires srb2win.exe

Changes the sound driver to DirectSound 3D. The file s_ds3d.dll, which is required to run this, is not included.

-fmod3d Requires srb2win.exe

Changes the sound driver to FMOD 3D system. The file s_fmod.dll, which is required to run this, is not included.

-freq frequency Requires srb2win.exe

Sets the playback frequency of sound samples, in hertz.

-nodigmusic Turns off digital music.
-nomidimusic Turns off MIDI music.
-nomusic Turns off music.
-nosound Starts the game without any sound drivers, turning off sound effects.
-openal Requires srb2win.exe

Changes the sound driver to OpenAL (Open Audio Library). The file s_openal.dll, which is required to run this, is not included.

-precachesound Preloads sound effects into memory.
-sounddriver drivername Requires srb2win.exe

Loads the sound driver from the specified library file.

-usecd Requires srb2dd.exe

Enables playback of music from a music CD instead of music.dta. CD playback can be controlled with the cd console command.

Controls

Parameter Description
-nodinput Requires srb2dd.exe

Doesn't use DirectInput.

-nojoy Disables use of joysticks.
-nomouse Mouse-operated OSes only

Disables the mouse.

Demos/Replays

Parameter Description
-maxdemo size Determines the maximum size that recorded demos may have, in kilobytes. The default value is 1,024 kilobytes, or 1 megabyte.
-metal Records replay data that is used for the Metal Sonic race. By default, you will be warped to MAP01 and play as Sonic. In levels where a different character is forced (e.g., Echidnapolis Zone), that character will be used instead. To record the demo in a different map, use the -warp parameter. Overrides -record.
-playdemo demoname Plays back the specified demo. Currently does not function (the game freezes on load); use the playdemo console command instead.
-record demoname Records a demo, which can be played back with the playdemo/timedemo console commands. By default, you will be warped to MAP01. To record the demo in a different map, use the -warp parameter.
-timedemo demoname Plays back the specified demo at the highest possible speed and prints out information about how fast it was processed in the console afterwards. Useful for benchmarking. Currently does not function (the game freezes on load); use the timedemo console command instead.

Server

Parameter Description
-dedicated Starts a dedicated server, where the host is not a player in the game and instead monitors the game from a console window.
-gametype gametype Sets the gametype when hosting a server. This parameter is in the same format as that accepted by the map command's own -gametype parameter.
-noupload Turns off downloading, so the game doesn't send files to be downloaded when acting as the server.
-password password Sets the server password, which players can use to log in as netgame administrators.
-room ID If used with the -server parameter, advertises the server on the Master Server. ID specifies the room in which the server is hosted: 33 is the Standard room, while 28 is the Casual room.
-server Automatically hosts a server upon starting the game.

Networking

Parameter Description
-bandwidth bytes_per_second Sets the network bandwidth for servers. SRB2 uses 1,450 bytes per second by default. The limits are 1,000 bytes per second and 100,000 bytes per second, respectively.
-bindaddr external_ip_address external_ip_address2 ... Listens for incoming connections on the specified address (or addresses) only.
-bindaddr6 external_ip_address external_ip_address2 ... Listens for incoming connections on the specified IPv6 address (or addresses) only. Requires IPv6 support to be enabled with -ipv6. Warning: This feature is untested.
-clientport portnum Specifies the local UDP port to use. Overrides -udpport. If you are hosting a netgame, this is useful for joining your own netgame with another instance of SRB2 on the same computer, especially if you are hosting a dedicated server – see Dedicated server > Joining your own dedicated server.
-connect [external_ip_address] If an external IP address is specified, SRB2 will automatically try to connect to a netgame with that IP address. If no IP address is specified, SRB2 will search for a server on the local network and connect to the first server found.
-extratic [num] Sends up to num (defaults to 1 if num is not given) extra previous tics to clients per server tic.
-ipv6 Listens for incoming IPv6 connections. Warning: This feature is untested.
-nodownload Doesn't download files from servers.
-packetsize bytes_per_packet Changes the size of the UDP packets sent in netgames. The minimum value for this is 75 bytes per packet, while the maximum (and default) value is the network bandwidth (which is 1,450 bytes by default and can be changed with -bandwidth).
-udpport portnum Specifies the local UDP port to use. This is useful for hosting a netgame on a port other than the default port, 5029 – see Multiplayer > Hosting.
-useuPnP Turns on Universal Plug and Play support. Warning: This feature is untested.

Debugging

Parameter Description
-consisdump Prints out debug information into the console if a synch failure happens in a netgame.
-debug Displays more in-depth technical information in the console, e.g., sprites loaded, file-searching details, etc.
-debugfile [num] Outputs extra debug info to the file debugnum.txt. If num is omitted, it is calculated from the player number.

System

Parameter Description
-3DNow Enables 3DNow!-specific code, if not already enabled.
-486 Enables i486-specific code, if not already enabled.
-586 Enables Pentium 5-specific code, if not already enabled.
-framebuffer Requires srb2win.exe

Prevents SRB2 from logging any output to the command line. Useful for framebuffer-based systems where this text would interfere with the game display.

-gettickcount Windows-only

Uses the imprecise system timer to measure time instead of a high-resolution timer.

-MMX Enables MMX-specific code, if not already enabled. Note: MMX-specific rendering code will not be used if SRB2 is also launched with -noASM.
-MMXExt Enables code specific to AMD MMX extensions, if not already enabled.
-noASM Disables ASM rendering code. The non-ASM rendering code will be used instead.
-NOCPUID Prevents SRB2 from detecting the processor features supported by the current system/computer, as well as preventing SRB2 from automatically enabling code for any features found.
-noSSE Disables SSE-specific code, if SSE support is currently enabled. Overrides -SSE.
-SSE Enables SSE-specific code, if not already enabled.
-SSE2 Enables SSE2-specific code, if not already enabled.

Console commands/variables