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

Add a dedicated Hosting on windows file #223

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* [Prerequisites](hosting-a-server-with-northstar/prerequisites.md)
* [Hosting a Basic Listen Server](hosting-a-server-with-northstar/basic-listen-server.md)
* [Hosting a Dedicated Server](hosting-a-server-with-northstar/dedicated-server/README.md)
* [Best practices](hosting-a-server-with-northstar/dedicated-server/best-practices.md)
* [Hosting on Windows](hosting-a-server-with-northstar/dedicated-server/hosting-on-windows.md)
* [Hosting on Linux](hosting-a-server-with-northstar/dedicated-server/hosting-on-linux.md)
* [RCON](hosting-a-server-with-northstar/dedicated-server/rcon.md)
* [Server settings](hosting-a-server-with-northstar/server-settings/README.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
description: Tweaks and tricks to improve both your experience in hosting and others' in playing on your server
---
# Hosting on Windows

# Best practices
## Hardware

{% hint style="info" %}
TODO: If you have experience in hosting Northstar servers and want to share your knowledge, please open a [pull request](https://github.com/R2Northstar/NorthstarWiki/pulls).
Expand All @@ -14,10 +12,10 @@ The current minimum requirements are as follows:

**Requirements per server:**

- 5GB free disk space (+3 GB if you're on windows due to origin and deps)
- 8GB free disk space (5GB of the game and 3 for Origin/EA app)
- 3+ cores (2 might work, though)
- 3GB+ total memory (RAM or swap will do)
- Windows 8.1 (and built-in WARP [use `-softwared3d11`] or a graphics card) + or wine 6.0.0+ (and dxvk+lavapipe+x11, wined3d+llvmpipe+x11, or a working graphics setup with dxvk or llvmpipe) (see [this](https://github.com/pg9182/northstar-dedicated) for more)
- Windows 8.1

**Per instance:**

Expand All @@ -26,11 +24,27 @@ The current minimum requirements are as follows:

**Note:** It is recommended to surpass the listed requirements. Currently the number of available servers covers the daily playerbase more than enough. If you're planning to host public servers for the community it is therefore recommended to either fill a niche (like a gamemode that is so popular that all existing servers are full) or provide a better service than existing hosts (less lag, more stable, etc.).

## Monitoring

You can set the Convar `ns_should_log_all_clientcommands` to `1` to log all client commands. This includes both benign things like the command a client sends to server to respawn after death but also nefarious, like a malicious client calling `emit`, a command that before being patched out allowed clients to spam voice lines to other clients.
## Setup

Due to the increased verbosity `ns_should_log_all_clientcommands` is set to `0` (disabled) by default but should be enabled in cases where you want to investigate suspicious activity on your server.
Dedicated servers allow you to host a Northstar server without having to use a full client, making them more lightweight and easier to host for longer periods of time. Dedicated servers are still in development for Northstar, so while they do work, expect some bugs and general jank.\
NoCatt marked this conversation as resolved.
Show resolved Hide resolved
To start a dedicated server on Northstar, launch NorthstarLauncher.exe with the argument `-dedicated`, this can be done manually, but releases also provide the batch file `r2ds.bat`, which will also do this.\
When using a dedicated server, arguments are read from `ns_startup_args_dedi.txt`, rather than `ns_startup_args.txt`.

#### Useful configuration files

* `ns_startup_args_dedi.txt`\
contains the [startup arguments](../server-settings/README.md/#startup-arguments)
* `R2Northstar\mods\Northstar.CustomServers\mod.json`\
contains [ConVars](../server-settings/convars.md) default values
* `R2Northstar\mods\Northstar.CustomServers\mod\cfg\autoexec_ns_server.cfg`\
contains [ConVars](../server-settings/convars.md) and [overrides](../server-settings/playlistvars.md)

### Dedicated Server Caveats

At the moment, dedicated servers still require DirectX 11 to work, which typically requires a physical GPU, though they use almost no GPU processing power while in use, this can be an issue especially on GPU-less setups, so the launch argument `-softwared3d11` can be used to force DirectX to run in software mode.\
While this is absolutely not ideal, it's the best solution for truly headless dedicated servers at the moment, and surprisingly hardly uses any CPU time, though it can use roughly up to 1GB of RAM.\
Regarding RAM usage, dedicated servers also use significant amounts of RAM at the moment, often requiring 1.5-2GB, though I expect this to lower as development continues.

## Optimization Commands (Optional)

Expand All @@ -41,3 +55,4 @@ Due to the increased verbosity `ns_should_log_all_clientcommands` is set to `0`
| `sv_maxrate 127000` | Sets the maximum bandwidth rate allowed (both incoming/outcoming) per second (in bytes) |

**Note:** The effect is dependent on your network, system, etc. Therefore, you should really add the command one by one and test it to see if there is any benefit for your server.

Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# ConVars
## Monitoring

You can set the Convar `ns_should_log_all_clientcommands` to `1` to log all client commands. This includes both benign things like the command a client sends to server to respawn after death but also nefarious, like a malicious client calling `emit`, a command that before being patched out allowed clients to spam voice lines to other clients.

Due to the increased verbosity `ns_should_log_all_clientcommands` is set to `0` (disabled) by default but should be enabled in cases where you want to investigate suspicious activity on your server.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from the best-practies page, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes copy paste

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, saw it as well now. Made #232 to move it out separately ^^

## Convars

Convars are located inside the `R2Northstar\mods\Northstar.CustomServers\mod\cfg\autoexec_ns_server.cfg` file.
Expand Down