Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless mode/dedicated server #553

Merged
merged 6 commits into from
May 13, 2022
Merged

Conversation

starfi5h
Copy link
Collaborator

@starfi5h starfi5h commented May 7, 2022

Continue the work of Baldie-dev from PR #62

Possibility to run the server in headless mode without the usage of GPU or any rendering.
The dedicated server can be started from the command line by:
steam.exe -applaunch 1366540 -batchmode -nographics -server -load "asd"
or
./DSPGAME.exe -batchmode -nographics -server -load "asd"
Where "asd" is the name of the savefile.

In order to run the game from the exe you must create a steam_appid.txt file in the root of the game directory (next to DSPGame.exe) with the text 1366540

New command parameters
-server : Start DSP in headless server mode.
-load <savename> : Currently headless mode needs to specify the save to load.
-ups <integer value>: Set UPS to value using FPSController.SetFixUPS(value)

New config options
These options are not shown in settings, have to open the config file to edit.
AutoPauseEnabled: Auto pause the game when there is no player connecting. Default: true
EnableRemoteSaveAccess: Enable following chat commands. This should only be enabled when all clients are trusted users. Default: false

New chat commands
Performance server load/save by client commands.
Only works when server is dedicated and has EnableRemoteSaveAccess enabled.

  • /server list [saveNum]
    sever-list
    Show the recent [saveNum] savefiles by time and savename on the server.

  • /server save [saveName]
    Save current game as [saveName]. If saveName is not specify, it will save to _lastexit_.dsv.

  • /server load <saveName>
    Load game from saveName. Current game will be save to _lastexit_.dsv before restart.


From observing DysonSwarm.GameTick(), dyson sails position and velocity, which are processed by GPU device, are only affecting visual, so we can safely skip updating them. The sails absorbing and expiring are determined by time and processed by CPU.

The downside is dyson swarm might look weird on client, I'm planning to make another mod to compress and reconstruct dyson swarm by sail lifetime histogram and orbit parameters to solve this issue.

@starfi5h starfi5h marked this pull request as ready for review May 7, 2022 21:54
@starfi5h starfi5h marked this pull request as draft May 7, 2022 23:58
@starfi5h
Copy link
Collaborator Author

starfi5h commented May 8, 2022

TODO:

  • Add rate limit to /-server save
  • Add admin system
    Use EnableRemoteSaveAccess for situation when all clients are trusted.
    More grain control will be added in another branch in future when player permission system is implemented.

@starfi5h starfi5h marked this pull request as ready for review May 12, 2022 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants