Startup parameters

From modwiki

Jump to: navigation, search


Contents

Overview

Startup parameters are remnants of the time that an OS consisted of nothing more then a console. A command was then started by giving it's name and optionally some parameters to change the command's behavior. (Take DOS as an example, or even a modern Linux terminal.)

All games built on the Doom 3 engine allow you to start them with parameters as well to get a specific behaviour.

Shortcuts

Probably, you don't want to use a system console to launch a Doom 3 game every time you need it. It works, but you would need to start the console, go to the game's folder and type the command with all it's parameters. Imagine you would need to do that every time you want to play...

This is where shortcuts come in. Shortcuts save the location of the command and it's startup parameters.

Windows

You start by creating a shortcut to the game .exe file. A few ways to do it:

  • Right click in the desired location and choose New -> Shortcut. Complete the wizard
  • Copy the game's .exe, then right click where you want your shortcut to be. Select "Paste Shortcut"
  • Drag the game's .exe with your right mouse button to the desired location, then release and choose "Make shortcut".

After this, right click on the shortcut. Select properties. The field to be edited is the "Target:" field. For Doom 3, it would look like:

 "c:\program files\doom3\doom3.exe"

To add a startup parameter, click in the target field and add:

+set r_fullscreen 0

After that, the whole target field should contain:

 "c:\program files\doom3\doom3.exe" +set r_fullscreen 0

Try it out to see what this shortcut does, if it isn't obvious.

If you are more familiar with windows you can also write a .bat file to run the game with your parameters.

Linux

By default, Linux does not support shortcuts. The only way to solve this is by making a script. However, newer window managers might support shortcuts. Scripting will always work, but it is worth it to check your window manager's documentation. A few step-by-step procedures are listed below for common window managers.

Linux Scripting

Lots of things are done through scripts. This can range from scripts which start all background processes when you start your Linux install, to commands which you can use like regular commands on your command line.

A basic script consists of nothing more then a list of commands to be executed by your shell. (Which does all the command line tasks)

To create one, open up your favourite editor. Here's is an example of what it should look like:

 #!/bin/sh
 cd /opt/doom3/
 exec ./doom3 +set r_fullscreen 0

Now save it. The name does not matter, as long as you remember it.

You can already use this script to start the game with the specified parameters. For example, if the script above was saved in a file called d3windowed.sh, it would be started by typing this in a shell:

 sh d3windowed.sh

It just works. In case the 'sh' part is even too much, you can make the script file executable on itself. To do this, issue this command:

 chmod ug+x d3windowed.sh

This command marks the script as executable for the file's owner (Here the user who created it) and members of the file's group. (Most of the time it's the creator's primary group)

From now on, you can start the script by typing:

 ./d3windowed.sh

KDE

This is one of the Window Managers which resembles Windows the most. Shortcuts work, but are made in a slightly different way.

  • Needs research on exact procedure

Gnome

Gnome is another popular Window manager. It is not related to KDE, so it work's somewhat different.

  • Needs research on exact procedure

How startup parameters work

Regular console commands

The Doom 3 engine can use any in-game console command as a startup parameter. This is really useful to save time if you where to start the game and enter a console command anyway.

To make a valid startup parameter, take any console command you want and prefix it with '+' instead of '/'. All console commands act the same on the command line except for /set. Likewise, prefixing CVar's with '+' might not work. See below.

Set command

The set command has a different behaviour when used on the command line instead of the console.

By using the +set command, you can change nearly every CVar you want. When using set in-game, restrictions are applied. Some CVar's are read-only once the game has started (like some rendering options) to avoid that the game might come in an unpredictable state when those are modified.

If a CVar does not get initialized at startup, it cannot be modified by starting the game with +<cvarname> <value> but explicitly needs +set. To be sure, it is best that all CVars are modified by using +set. This will avoid some nasty surprises, and makes sure that you don't need to read all logging messages in the console to know what's wrong.

Common uses

Launching the game in windowed mode

"d:\doom3\doom3.exe" +set r_fullscreen 0

This makes the game run in windowed mode (ie not full-screen) so you can keep applications running on the background, and play in the foreground. It may also be a good idea to add +vid_restart to ensure that the game does open in windowed mode.

Great for keeping your favourite IM client or IRC app open on the background.

Launching the editor

"Doom3.exe" +set r_mode 3 +set r_fullscreen 0 +seta r_brightness 0 +seta r_gamma 0 +vid_restart +editor

This sets the Doom 3 game resolution to 640x480 (r_mode 3), makes it run in windowed mode (not full-screen), sets the brightness and gamma to 0, reloads the rendering engine and loads the map editor.

Useful if you play the game at a lower resolution and want to use the editor at your normal desktop resolution.

Launching the game to connect to a server that is running a mod

"d:\doom3\doom3.exe" +set fs_game MODNAME +connect 123.123.123.123:28004

This starts the game running the mod in the directory "MODNAME", and then connects to the server at 123.123.123.123:28004

Overview of interesting parameters

The lists below include the most interesting parameters. Click the links to see how to use them.

NOTE: All commands need to be prefixed with +

All CVARS are recommended to be prefixed with +set instead of simply prefixing it with '+'. Some might work without +set, some will not.

Command parameters

connect
Connects to the given server. The server is specified as hostname:port - eg "connect 123.123.123.123:28004". If the :port is ommitted, the default for the game is assumed.
editor
opens the built in Map editor upon launch. Allso see mapping.
editAFs
opens the Articulated Figure Editor
editCVars
opens the Edit Cvars dialog (only works when a map is loaded)
editDecls
opens the Declaration Browser
editFX
opens the FX Editor
editGUIs
opens the GUI Editor
editLights
opens the Light Editor and can also be opened from the Map editor by pressing "j" on your keyboard
editPDAs
opens the PDA Editor
editPlaybacks
opens the Playback Editor
editReverb
opens the Reverb Editor
editScripts
opens the Script Editor
editSounds
opens the Sound Editor
disconnect
causes the game to skip the intros when starting.

General CVARs

fs_game
Used to load a different mod on startup.
fs_game_base
Adds a second folder to be loaded prior to the modfolder. Useful when modding a missionpack. More info here: [1]
com_allowconsole
Sets if the easy console key is used.
net_allowcheats
Used to enable cheats.

Graphic CVARs

r_fullscreen
This will make the game run in fullscreen or in windowed mode. Mostly in combanation with some command.
r_multisamples
Enables antialiasing and sets the number of passes.
Personal tools
Main