From 0d21847877e5f8dc112430921d1e9d86c56a6087 Mon Sep 17 00:00:00 2001 From: Thijs van Loef Date: Mon, 26 Feb 2024 15:46:05 +0100 Subject: [PATCH 1/2] initial engine.ini generating --- Dockerfile | 3 +- .../configuration/engine-settings.md | 46 +++++++++ .../configuration/server-commands.md | 2 +- scripts/compile-engine.sh | 60 ++++++++++++ scripts/files/Engine.ini.template | 95 +++++++++++++++++++ scripts/start.sh | 3 + 6 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 docusaurus/docs/getting-started/configuration/engine-settings.md create mode 100644 scripts/compile-engine.sh create mode 100644 scripts/files/Engine.ini.template diff --git a/Dockerfile b/Dockerfile index 5c8358231..552bb68b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,7 +108,8 @@ ENV HOME=/home/steam \ DISCORD_PRE_SHUTDOWN_MESSAGE="Server is shutting down..." \ DISCORD_POST_SHUTDOWN_MESSAGE="Server has been stopped!" \ ENABLE_PLAYER_LOGGING=true \ - PLAYER_LOGGING_POLL_PERIOD=5 + PLAYER_LOGGING_POLL_PERIOD=5 \ + DISABLE_GENERATE_ENGINE=true COPY ./scripts /home/steam/server/ diff --git a/docusaurus/docs/getting-started/configuration/engine-settings.md b/docusaurus/docs/getting-started/configuration/engine-settings.md new file mode 100644 index 000000000..bb1d68fcd --- /dev/null +++ b/docusaurus/docs/getting-started/configuration/engine-settings.md @@ -0,0 +1,46 @@ +--- +sidebar_position: 3 +--- + +# Engine Settings + +Changing Engine Settings with Environment variables. + +## With Environment Variables + +:::warning +These Environment Variables and Settings are subject to change since the game is still in beta. +::: + +Converting engine settings to environment variables follow the same principles (with some exceptions): + +* all capital letters +* split words by inserting an underscore +* remove the single letter if the setting starts with one (like 'b') + +For example: + +* LanServerMaxTickRate -> LAN_SERVER_MAX_TICK_RATE +* bUseFixedFrameRate -> USE_FIXED_FRAME_RATE +* NetClientTicksPerSecond -> NET_CLIENT_TICKS_PER_SECOND + +| Variable | Description | Default Value | Allowed Value | +|-------------------------------|-----------------------------------------------------------------------------------------------------------------|---------------|--------------------| +| LAN_SERVER_MAX_TICK_RATE | Sets maximum ticks per second for LAN servers, higher rates result in smoother gameplay. | 120 | Integer | +| NET_SERVER_MAX_TICK_RATE | Sets maximum ticks per second for Internet servers, similarly ensuring smoother online gameplay. | 120 | Integer | +| CONFIGURED_INTERNET_SPEED | Sets the assumed player internet speed in bytes per second. High value reduces chances of bandwidth throttling. | 104857600 | Integer (in bytes) | +| CONFIGURED_LAN_SPEED | Sets the LAN speed, ensuring LAN players can utilize maximum network capacity. | 104857600 | Integer (in bytes) | +| MAX_CLIENT_RATE | Maximum data transfer rate per client for all connections, set to a high value to prevent data capping. | 104857600 | Integer (in bytes) | +| MAX_INTERNET_CLIENT_RATE | Specifically targets internet clients, allowing for high-volume data transfer without restrictions. | 104857600 | Integer (in bytes) | +| SMOOTH_FRAME_RATE | Enables the game engine to smooth out frame rate fluctuations for a more consistent visual experience. | true | Boolean | +| SMOOTH_FRAME_RATE_UPPER_LIMIT | Sets a max target frame rate range for smoothing. | 120.000000 | Float | +| SMOOTH_FRAME_RATE_LOWER_LIMIT | Sets a min target frame rate range for smoothing. | 30.000000 | Float | +| USE_FIXED_FRAME_RATE | Enables the use of a fixed frame rate | false | Boolean | +| FIXED_FRAME_RATE | Fixed frame rate | 120.000000 | Float | +| MIN_DESIRED_FRAME_RATE | Specifies a minimum acceptable frame rate, ensuring the game runs smoothly at least at this frame rate. | 60.000000 | Float | +| NET_CLIENT_TICKS_PER_SECOND | Increases the update frequency for clients, enhancing responsiveness and reducing lag. | 120 | Integer | + +:::tip +While setting the server tickrate above to 120 fps will make some gameplay aspect smother, +it won't fix rubber-banding and will tax your hardware significantly more. +::: diff --git a/docusaurus/docs/getting-started/configuration/server-commands.md b/docusaurus/docs/getting-started/configuration/server-commands.md index e08335ef7..ef6ede464 100644 --- a/docusaurus/docs/getting-started/configuration/server-commands.md +++ b/docusaurus/docs/getting-started/configuration/server-commands.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 4 --- # Server Commands (RCON) diff --git a/scripts/compile-engine.sh b/scripts/compile-engine.sh new file mode 100644 index 000000000..17caab056 --- /dev/null +++ b/scripts/compile-engine.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# shellcheck source=scripts/helper_functions.sh +source "/home/steam/server/helper_functions.sh" + +engine_file="/palworld/Pal/Saved/Config/LinuxServer/Engine.ini" +engine_dir=$(dirname "$engine_file") + +mkdir -p "$engine_dir" || exit +# If file exists then check if it is writable +if [ -f "$engine_file" ]; then + if ! isWritable "$engine_file"; then + LogError "Unable to create $engine_file" + exit 1 + fi +# If file does not exist then check if the directory is writable +elif ! isWritable "$engine_dir"; then + # Exiting since the file does not exist and the directory is not writable. + LogError "Unable to create $engine_file" + exit 1 +fi + +LogAction "Compiling Engine.ini" + +export LAN_SERVER_MAX_TICK_RATE=${LAN_SERVER_MAX_TICK_RATE:-120} +export NET_SERVER_MAX_TICK_RATE=${NET_SERVER_MAX_TICK_RATE:-120} +export CONFIGURED_INTERNET_SPEED=${CONFIGURED_INTERNET_SPEED:-104857600} +export CONFIGURED_LAN_SPEED=${CONFIGURED_LAN_SPEED:-104857600} +export MAX_CLIENT_RATE=${MAX_CLIENT_RATE:-104857600} +export MAX_INTERNET_CLIENT_RATE=${MAX_INTERNET_CLIENT_RATE:-104857600} +export SMOOTH_FRAME_RATE=${SMOOTH_FRAME_RATE:-true} +export SMOOTH_FRAME_RATE_UPPER_LIMIT=${SMOOTH_FRAME_RATE_UPPER_LIMIT:-120.000000} +export SMOOTH_FRAME_RATE_LOWER_LIMIT=${SMOOTH_FRAME_RATE_LOWER_LIMIT:-30.000000} +export USE_FIXED_FRAME_RATE=${USE_FIXED_FRAME_RATE:-false} +export FIXED_FRAME_RATE=${FIXED_FRAME_RATE:-120} +export MIN_DESIRED_FRAME_RATE=${MIN_DESIRED_FRAME_RATE:-60} +export NET_CLIENT_TICKS_PER_SECOND=${NET_CLIENT_TICKS_PER_SECOND:-120} + +if [ "${DEBUG,,}" = true ]; then +cat < "$engine_file" < Date: Tue, 27 Feb 2024 11:30:39 +0100 Subject: [PATCH 2/2] fix typos --- .../getting-started/configuration/engine-settings.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docusaurus/docs/getting-started/configuration/engine-settings.md b/docusaurus/docs/getting-started/configuration/engine-settings.md index bb1d68fcd..ab50d5627 100644 --- a/docusaurus/docs/getting-started/configuration/engine-settings.md +++ b/docusaurus/docs/getting-started/configuration/engine-settings.md @@ -9,14 +9,14 @@ Changing Engine Settings with Environment variables. ## With Environment Variables :::warning -These Environment Variables and Settings are subject to change since the game is still in beta. +These environment variables and settings are subject to change since the game is still in beta. ::: Converting engine settings to environment variables follow the same principles (with some exceptions): -* all capital letters -* split words by inserting an underscore -* remove the single letter if the setting starts with one (like 'b') +* All capital letters +* Split words by inserting an underscore +* Remove the single letter if the setting starts with one (like 'b') For example: @@ -41,6 +41,6 @@ For example: | NET_CLIENT_TICKS_PER_SECOND | Increases the update frequency for clients, enhancing responsiveness and reducing lag. | 120 | Integer | :::tip -While setting the server tickrate above to 120 fps will make some gameplay aspect smother, +While setting the server tickrate above to 120 fps will make some gameplay aspect smoother, it won't fix rubber-banding and will tax your hardware significantly more. :::