Startup parameters: Difference between revisions

From PZwiki
No edit summary
m (Infobox update)
(12 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Languages}}
{{Header|Project Zomboid|Multiplayer}}
{{Header|Modding|version=Version 41|incver=78.16}}
{{Page version|41.78.16}}
{{TOC right}}
{{toc|right}}
Project Zomboid has customizable '''startup parameters''', as either JVM arguments or game arguments. This can be used to override "vmArgs" in the .json file. JVM arguments must end with a <code>--</code>, even if there are no game arguments.
Project Zomboid has customizable '''startup parameters''', as either JVM arguments or game arguments. This can be used to override "vmArgs" in the .json file. JVM arguments must end with a <code>--</code>, even if there are no game arguments.


;Create shortcut:
;Create shortcut:
#Navigate to the game folder
#Navigate to the game folder<br>With Microsoft Windows 10, found in Program Files (x86):<br>C:\Program Files (x86)\Steam\steam\games
#Create a shortcut of the executable file (ProjectZomboid32.exe/ProjectZomboid64.exe)
#Create a shortcut of the executable file (ProjectZomboid32.exe/ProjectZomboid64.exe)
#Add the appropriate JVM arguments in the "Target:" line<br>Example: <code>C:\ProjectZomboid64.exe -Xmx1024m -Xms1024m -- -nosteam</code>
#Add the appropriate JVM arguments in the "Target:" line<br>Example: <code>C:\ProjectZomboid64.exe -Xmx1024m -Xms1024m -- -nosteam</code>
Line 11: Line 11:
;[[Steam]] application:
;[[Steam]] application:
#Right-click the game in the Library
#Right-click the game in the Library
#Select "Properties..."  
#Select "Properties..."
#Add desired options under "LAUNCH OPTIONS"
#Add desired options under "LAUNCH OPTIONS"


Line 27: Line 27:
==Game arguments==
==Game arguments==
===Client & server===
===Client & server===
{| class="pztable-com"  
{| class="wikitable theme-blue"
|-
|-
! Arguments
! Arguments
Line 35: Line 35:
| <code>-nosteam</code>
| <code>-nosteam</code>
| Disables Steam integration on client/server.
| Disables Steam integration on client/server.
|  
|
|-
|-
| <code>-cachedir=<path></code>
| <code>-cachedir=<path></code>
| Sets the path for the game data cache dir.  
| Sets the path for the game data cache dir.
| <code>-cachedir="C:\Zomboid</code>"
| <code>-cachedir="C:\Zomboid</code>"
|-
|-
Line 47: Line 47:
| <code>[[Debug mode|-debug]]</code>
| <code>[[Debug mode|-debug]]</code>
| Launches the game in the [[debug mode]].
| Launches the game in the [[debug mode]].
|  
|
|}
|}


===Client===
===Client===
{| class="pztable-com"
{| class="wikitable theme-blue"
|-
|-
! Arguments
! Arguments
Line 58: Line 58:
|-
|-
| <code>+connect <ip:port></code>
| <code>+connect <ip:port></code>
| Server address to connect, when joining a server using Steam.  
| Server address to connect, when joining a server using Steam.
| <code>+connect 127.0.0.1:16261</code>
| <code>+connect 127.0.0.1:16261</code>
|-
|-
| <code>+password <password></code>
| <code>+password <password></code>
| Server password to connect, when joining a server using Steam.  
| Server password to connect, when joining a server using Steam.
| <code>+password ServersPassword</code>
| <code>+password ServersPassword</code>
|-
|-
| <code>-debugtranslation</code>
| <code>-debugtranslation</code>
| Writes possible translation issues to homedir "/Zomboid/translationProblems.txt"
| Writes possible translation issues to homedir "/Zomboid/translationProblems.txt"
|  
|
|-
|-
| <code>-safemode</code>
| <code>-safemode</code>
| Launches the game with reduced resolution and disables some graphical effects to reduce strain on lower-end graphics cards.
| Launches the game with reduced resolution and disables some graphical effects to reduce strain on lower-end graphics cards.
|  
|
|-
|-
| <code>-nosound</code>
| <code>-nosound</code>
| Disables the game audio
| Disables the game audio
|  
|
|}
|}


===Server===
===Server===
{| class="pztable-com"
{| class="wikitable theme-blue"
|-
|-
! Arguments
! Arguments
Line 86: Line 86:
|-
|-
| <code>-adminpassword</code>
| <code>-adminpassword</code>
| Option to bypasses the enter-a-password prompt when creating a server.  
| Option to bypasses the enter-a-password prompt when creating a server.
| <code>-adminpassword YourPasswdXYZ</code>
| <code>-adminpassword YourPasswdXYZ</code>
|-
|-
| <code>-servername</code>
| <code>-servername</code>
| You can choose a different servername by using this option when starting the server.  
| You can choose a different servername by using this option when starting the server.
| <code>-servername MySecondServer</code>
| <code>-servername MySecondServer</code>
|-
|-
| <code>-ip <ip></code>
| <code>-ip <ip></code>
| Option to handle multiple network cards. Example:  
| Option to handle multiple network cards. Example:
| <code>-ip 127.0.0.1</code>
| <code>-ip 127.0.0.1</code>
|-
|-
| <code>-port <port></code>
| <code>-port <port></code>
| Option which overrides the .ini option "DefaultPort".  
| Option which overrides the .ini option "DefaultPort".
| <code>-port 16261</code>
| <code>-port 16261</code>
|-
|-
| <code>-udpport <port></code>
| <code>-udpport <port></code>
| Option which overrides the .ini option "UDPPort".  
| Option which overrides the .ini option "UDPPort".
| <code>-port 16262</code>
| <code>-port 16262</code>
|-
|-
| <code>-steamvac <true/false></code>
| <code>-steamvac <true/false></code>
| Option to enable/disable VAC on Steam servers. On the server command-line use -steamvac true/false. In the server's INI file, use SteamVAC=true/false.
| Option to enable/disable VAC on Steam servers. On the server command-line use -steamvac true/false. In the server's INI file, use SteamVAC=true/false.
|  
|
|-
|-
| <code>-steamport1 <port></code> <br> <code>-steamport2 <port></code>
| <code>-steamport1 <port></code> <br> <code>-steamport2 <port></code>
| Steam servers require two additional ports to function (I'm guessing they are both UDP ports, but you may need TCP as well). These are in addition to the DefaultPort= setting. These can be specified in two ways: In the server's INI file as SteamPort1= and SteamPort2=. Using command-line options -steamport1 and -steamport2.
| Steam servers require two additional ports to function (I'm guessing they are both UDP ports, but you may need TCP as well). These are in addition to the DefaultPort= setting. These can be specified in two ways: In the server's INI file as SteamPort1= and SteamPort2=. Using command-line options -steamport1 and -steamport2.
|  
|
|}
|}


==JVM arguments==
==JVM arguments==
===Client & server===
===Client & server===
{| class="pztable-com"
{| class="wikitable theme-blue"
|-
|-
! Arguments
! Arguments
Line 135: Line 135:
|-
|-
| <code>-Duser.home=<path></code>
| <code>-Duser.home=<path></code>
| overwrites the "/Zomboid" homedir to whatever path you want.  
| overwrites the "/Zomboid" homedir to whatever path you want.
| <code>-Duser.home=C:\Zomboid</code>
| <code>-Duser.home=C:\Zomboid</code>
|-
|-
| <code>-Dsoftreset</code>
| <code>-Dsoftreset</code>
| option to perform a Soft Reset (this does not work as of 12/01/23; no mention from DEV team on a fix ETA)
| option to perform a soft reset (this does not work as of {{Current version|stable}}, the issue was reported and most likely be fixed in [[Build 42|future versions]]<ref>[https://steamcommunity.com/app/108600/discussions/0/3191367619812018387/ Dedicated Server Soft Reset :: Project Zomboid General Discussions]</ref>
|  
|
|-
|-
| <code>-Ddebug</code>
| <code>-Ddebug</code>
| enables debugging
| enables debugging
|  
|
|}
|}


===Server===
===Server===
{| class="pztable-com"
{| class="wikitable theme-blue"
|-
|-
! Arguments
! Arguments
Line 158: Line 158:
| <code>-Dorg.sqlite.lib.path=natives</code>
| <code>-Dorg.sqlite.lib.path=natives</code>
|}
|}
{{template:navbox modding}}
 
==References==
<references />
 
==See also==
{{Navbox modding}}
 
[[Category:Multiplayer]]
[[Category:Multiplayer]]
{{Template:Navbox modding}}

Revision as of 03:50, 15 April 2024

Project ZomboidMultiplayerStartup parameters
UI Tick.png
This page has been revised for the current stable version (41.78.16).
Help by adding any missing content. [edit]

Project Zomboid has customizable startup parameters, as either JVM arguments or game arguments. This can be used to override "vmArgs" in the .json file. JVM arguments must end with a --, even if there are no game arguments.

Create shortcut
  1. Navigate to the game folder
    With Microsoft Windows 10, found in Program Files (x86):
    C:\Program Files (x86)\Steam\steam\games
  2. Create a shortcut of the executable file (ProjectZomboid32.exe/ProjectZomboid64.exe)
  3. Add the appropriate JVM arguments in the "Target:" line
    Example: C:\ProjectZomboid64.exe -Xmx1024m -Xms1024m -- -nosteam
Steam application
  1. Right-click the game in the Library
  2. Select "Properties..."
  3. Add desired options under "LAUNCH OPTIONS"
StartServer64.bat Parameters
  1. Open the StartServer64.bat file with a text editor
  2. Add any appropriate JVM arguments after the -Xmx line in the .bat contents
  3. Add any appropriate Game Parameters after the %1 %2 text inside the .bat contents, which is at the end of the file before PAUSE.

Examples:

-Xmx16g -Duser.home=C:\Zomboid

%1 %2 -nosteam -servername MySecondServer -adminpassword YourPasswdXYZ

Game arguments

Client & server

Arguments Description Example
-nosteam Disables Steam integration on client/server.
-cachedir=<path> Sets the path for the game data cache dir. -cachedir="C:\Zomboid"
-modfolders Option to control where mods are loaded from. Any of the 3 keywords may be left out and may appear in any order. -modfolders workshop,steam,mods
-debug Launches the game in the debug mode.

Client

Arguments Description Example
+connect <ip:port> Server address to connect, when joining a server using Steam. +connect 127.0.0.1:16261
+password <password> Server password to connect, when joining a server using Steam. +password ServersPassword
-debugtranslation Writes possible translation issues to homedir "/Zomboid/translationProblems.txt"
-safemode Launches the game with reduced resolution and disables some graphical effects to reduce strain on lower-end graphics cards.
-nosound Disables the game audio

Server

Arguments Description Example
-adminpassword Option to bypasses the enter-a-password prompt when creating a server. -adminpassword YourPasswdXYZ
-servername You can choose a different servername by using this option when starting the server. -servername MySecondServer
-ip <ip> Option to handle multiple network cards. Example: -ip 127.0.0.1
-port <port> Option which overrides the .ini option "DefaultPort". -port 16261
-udpport <port> Option which overrides the .ini option "UDPPort". -port 16262
-steamvac <true/false> Option to enable/disable VAC on Steam servers. On the server command-line use -steamvac true/false. In the server's INI file, use SteamVAC=true/false.
-steamport1 <port>
-steamport2 <port>
Steam servers require two additional ports to function (I'm guessing they are both UDP ports, but you may need TCP as well). These are in addition to the DefaultPort= setting. These can be specified in two ways: In the server's INI file as SteamPort1= and SteamPort2=. Using command-line options -steamport1 and -steamport2.

JVM arguments

Client & server

Arguments Description Example
-Xmx Maximum amount of Memory.
(1024m=1Gig, 2048m=2Gig, 4096m=4Gig)
-Xmx1024m
-Xms Initial/Minimum Memory allocation.
(1024m=1Gig, 2048m=2Gig, 4096m=4Gig)
-Xms1024m
-Dzomboid.steam=<boolean> Disables/enables Steam integration on client/server.
(0=disabled, 1=enabled)
-Dzomboid.steam=1
-Duser.home=<path> overwrites the "/Zomboid" homedir to whatever path you want. -Duser.home=C:\Zomboid
-Dsoftreset option to perform a soft reset (this does not work as of 41.78.16, the issue was reported and most likely be fixed in future versions[1]
-Ddebug enables debugging

Server

Arguments Description Example
-Dorg.sqlite.lib.path=<path> Windows users: When the Server starts, a temporary sqlite file will be created in "TEMP", however it will not be deleted after stopping the Server. A way to avoid this is by adding a JVM option -Dorg.sqlite.lib.path=natives and put a copy of the .dll called sqlitejdbc.dll in the server's natives/ directory. It will then use that one instead of extracting the .dll from the .jar file every time. -Dorg.sqlite.lib.path=natives

References

See also