Launch parameters

Note: The content on this page pertains to Game Server Hosting (Multiplay) available on the Unity Dashboard. If you’re using Game Server Hosting (Clanforge), see the Game Server Hosting (Clanforge) documentation.

Launch parameters are variables passed to a game server at the time of start-up. These variables load before any other configuration variables and are completely separate from configuration variables and the server.json file. Launch parameters are best suited for loading information that the server needs access to immediately after starting.

You might want to use a launch parameter instead of a configuration variable in the following scenarios:

  • Initialize a port number.
  • Set the log directory.

However, it makes more sense to use configuration variables instead of launch parameters in most cases.

You must encase each launch parameter variable in dollar symbols ($$), two on each side. For example, a launch parameter named port would be $$port$$. The following code snippet has example launch parameters.

-port $$port$$ -queryport $$query_port$$ -log $$log_dir$$

Server variables

Like build configuration variables, you can use the following server-specific variables in your launch parameters. The following table has example server variables, each with a type, description, and example value.

VariableTypeDescriptionExample value
$$commandline$$stringA string of the launch parameters passed to the game server or application on launch.-config path/to/server.json
$$game_exe$$stringThe name of the build executable.server-linux
$$log_dir$$stringThe directory to which the server should send log files.
logs
$$port$$integerThe network port on which the server should bind for traffic.1234
$$query_port$$integerThe network port on which the server should bind for query protocol traffic.5678
$$query_type$$stringThe query protocol supported by the build the server is running.sqp
$$serverid$$integerThe ID of the server.123456
$$ip$$stringThe IP (version 4) address of the server.1.2.3.4
$$ipv6$$stringThe IP (version 6) address of the server.2001:db8:3333:4444:5555:6666:7777:8888
$$timestamp$$stringThe UTC timestamp of when the server started.1661430055

Default launch parameters

The following sections display the default launch parameters for games made with Unity and games made with Unreal.

Note: Build configuration variables are encased in double dollar symbols ($$).

Unity

The default launch parameters for games made with Unity include -nographics, -batchmode, and -logFile.

Tip: See Unity Editor command line arguments to learn more about the different flags you can use.

-nographics -batchmode -port $$port$$ -logFile $$log_dir$$/Engine.log
Launch parameterDescription
-nographicsRun the game executable without graphics.
-batchmodeRun Unity in batch mode. In batch mode, Unity runs command line arguments without the need for human interaction.
-logFileSpecify the location where the server saves log files. It accepts a directory relative to the server ID and can include build configuration variables.

Depending on the game, the launch parameters might also include the query port (queryPort) and query protocol (queryType).

-nographics -batchmode -logFile $$log_dir$$/Engine.log -queryPort $$query_port$$ -queryType $$query_type$$

Unreal

The default launch parameters for games made with Unreal include -log, and -port.

Tip: See Unreal Engine command line arguments to learn more about the different flags you can use.

-log=$serverid.log -port=$$port$$
Launch parameterDescription
-logSpecify the location where the server saves log files.
-portSpecify the port clients can use to connect to the game server.

Depending on the game and SDK you’re using, the launch parameters might include the query port (queryPort) and query protocol (queryType).

-log=$serverid.log -port=$$port$$ -queryPort $$query_port$$ -queryType $$query_type$$