Skip to content

Setup Headless Server

starfi5h edited this page May 18, 2022 · 4 revisions

After Nebula 0.8.7, Nebula can run in headless mode (#62, #553)
The following are steps to run it.

Preparation

Steam

If you buy the game on Steam, you'll require Steam login to run the game on your server.
If you only has one Steam account, you can setup Steam Offline Mode.

Create a steam_appid.txt file in the root of the game directory (next to DSPGame.exe) with the text 1366540. Now you can run the game from exe.

Mod Manager

I you're using mod manager, you can go to Settings -> Debugging -> Set launch parameters to set the following command line.
For example, -batchmode -nographics -server -load save1
Config file can be found in Config editor -> find BepInEx\config\nebula.cfg

Command Line

The dedicated server can be started from the command line by:
./DSPGAME.exe -batchmode -nographics -server -load save1
Where save1 is the name of the savefile.

Command Details
-batchmode Run the application in “headless” mode. In this mode, the application doesn’t display anything or accept user input.
-nographics When you use this argument in batch mode, Unity doesn’t initialize a graphics device.
-logFile <pathname> Specify where Unity writes the Editor or Windows/Linux/OSX standalone log file.

Nebula CLI arguments

Command Details
-server Start DSP in dedicated headless server mode.
-load <savename> Specify the save to load. App quit when the save doesn't exist.
-ups <integer value> Set UPS to value using FPSController.SetFixUPS(value). Range: 5-240.

Config Options

The config file is BepInEx\config\nebula.cfg

Config Options Default Details
AutoPauseEnabled true Auto pause the game when there is no player connecting.
EnableRemoteSaveAccess false Let clients load/save the game on server. Only enable this when all clients are trusted users.
ServerPassword If provided, this will set a password for hosted server.

Chat commands

When server has EnableRemoteSaveAccess enabled, clients can use following commands:

Command Example Details
/server list [saveNum] /server list 5 Show the recent [saveNum] savefiles by time and savename on the server.
/server save [saveName] /server save save1 Save current game as [saveName]. If saveName is not specify, it will save to _lastexit_.
/server load <saveName> /server load save1 Load game from saveName. Current game will be save to _lastexit_ before restart.

Demo

Headless server and a client, test chat commands
Check How to run 2 game instances on the same computer to run multiple instances of DSP.