Skip to content

Setup Headless Server

Chris Yeninas edited this page May 18, 2024 · 8 revisions

Headless Server

Nebula can run on a server without a GPU device.
The following are the steps to run it.

Preparation

Steam

If you purchased the game on Steam, you're required to be logged into Steam in order to run the game on your server.
If you only have one Steam account, you can set up 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 the exe.

Mod Manager

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

If you are using the mod manager and you wish to load the server from the command line, go to Settings -> Set launch parameters and copy the arguments from the Modded: section and include them in the arguments below.

image

BepInEx Console

By default, the BepInEx package on Thunderstore comes with the console window disabled. This means that when you run Nebula in headless server mode you will have no indication of the status of the server other than the fact that DSPGame.exe will appear in Task Manager. It is recommended to enable the BepInEx console either by accessing the BepInEx config from the Mod Manager's config editor or by opening BepInEx/config/BepInEx.cfg and changing Enabled = false under the Logging.Console section to Enabled = true
Hitting Ctrl + C will save the game to _lastexit_.dsv and exit.

Command Line

The dedicated server can be started from the command line with:
./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 quits when the save doesn't exist.
-load-latest Load _lastexit_.dsv which is the autosave from the last game existing.
-newgame <seed> <starCount> <resourceMultiplier> Start a new game with 3 parameters.
-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 are no connected players.
RemoteAccessEnabled false Let authenticated clients access remote server commands
RemoteAccessPassword If provided, this will set a password used for clients to authenticate for access to remote server commands
ServerPassword If provided, this will set a password for the hosted server.

Chat commands

When the server has RemoteAccessEnabled set to true, clients can use following commands:

Command Example Details
/server login [RemoteAccessPassword] /server login hunter2 Enables access to the following commands
/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 specified, it will save to _lastexit_.
/server load <saveName> /server load save1 Load game from saveName. Current game will be saved to _lastexit_ before restart.
/server info /server info Show /info command response on the server.

Save Files Transfer

  • Nebula stores the players data in a separate file [SaveName].server beside the save. When transferring save, make sure it is transferred too.
  • Make sure player.key file is not the same in original owner and the server. The default path of the file is in the upper layer of the save folder (%userprofile%\Documents\Dyson Sphere Program\player.key). Delete the file can generate a new one and join as a new player.
  • There is chat command /playerdata to list, delete or load player data. So you can load the data from the last login session back if you host a save that was transferred from other players.

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.