Skip to content

Commit

Permalink
New .ini files
Browse files Browse the repository at this point in the history
  • Loading branch information
wolveix committed Sep 10, 2024
1 parent 76bf722 commit 15ce928
Show file tree
Hide file tree
Showing 6 changed files with 290 additions and 16 deletions.
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,17 @@ RUN mkdir -p /config \
&& chown steam:steam /config

COPY init.sh /
COPY --chown=steam:steam run.sh /home/steam/
COPY --chown=steam:steam *.ini run.sh /home/steam/

WORKDIR /config

ENV AUTOPAUSE="true" \
AUTOSAVEINTERVAL="300" \
AUTOSAVENUM="5" \
AUTOSAVEONDISCONNECT="true" \
CRASHREPORT="true" \
DEBUG="false" \
ENV DEBUG="false" \
DISABLESEASONALEVENTS="false" \
GAMECONFIGDIR="/config/gamefiles/FactoryGame/Saved" \
GAMESAVESDIR="/home/steam/.config/Epic/FactoryGame/Saved/SaveGames" \
MAXOBJECTS="2162688" \
MAXPLAYERS="4" \
MAXTICKRATE="30" \
NETWORKQUALITY="3" \
PGID="1000" \
PUID="1000" \
ROOTLESS="false" \
Expand Down
127 changes: 127 additions & 0 deletions Engine.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/FactoryGame/Map/GameLevel01/Persistent_Level
LocalMapOptions=?sessionName=SatisfactoryServer?Visibility=SV_FriendsOnly?loadgame=savefile?listen?bUseIpSockets?name=Host

[/Script/Engine.Engine]
bSmoothFrameRate=true
bUseFixedFrameRate=false
SmoothedFrameRateRange=(LowerBound=(Type=Inclusive,Value=5.000000),UpperBound=(Type=Exclusive,Value=15.000000))
MinDesiredFrameRate=8.000000
FixedFrameRate=15.000000
NetClientTicksPerSecond=15

[/Script/Engine.GarbageCollectionSettings]
gc.MaxObjectsInEditor=2162688
gc.MaxObjectsInGame=2162688
gc.MaxObjectsNotConsideredByGC=476499
gc.SizeOfPermanentObjectPool=100378488
gc.ActorClusteringEnabled=True
gc.BlueprintClusteringEnabled=True

[/Script/Engine.Player]
ConfiguredInternetSpeed=300000
ConfiguredLanSpeed=340000

[/Script/OnlineSubsystemUtils.IpNetDriver]
InitialConnectTimeout=30
LanServerMaxTickRate=30
MaxNetTickRate=400
MaxInternetClientRate=300000
MaxClientRate=300000

[/Script/SocketSubsystemEpic.EpicNetDriver]
MaxClientRate=104857600
MaxInternetClientRate=104857600

[/Script/FactoryGame.FGSaveSession]
mNumRotatingAutosaves=5

[SystemSettings]
t.MaxFPS=15
AllowAsyncRenderThreadUpdates=1
AllowAsyncRenderThreadUpdatesDuringGamethreadUpdates=1
net.UseRecvMulti=0
net.RecvMultiCapacity=8192
net.IpNetDriverUseReceiveThread=0
net.IpConnectionUseSendTasks=1
net.IpNetDriverReceiveThreadQueueMaxPackets=8192
net.MaxNetStringSize=67108864
net.MaxRPCPerNetUpdate=8
tick.AllowAsyncComponentTicks=1
tick.AllowConcurrentTickQueue=1
tick.AllowAsyncTickDispatch=1
tick.AllowAsyncTickCleanup=1

[ConsoleVariables]
wp.Runtime.EnableServerStreaming=1

[Core.System]
Paths=../../../Engine/Content
Paths=%GAMEDIR%Content
Paths=../../../Engine/Plugins/2D/Paper2D/Content
Paths=../../../Engine/Plugins/Animation/ACLPlugin/Content
Paths=../../../Engine/Plugins/Animation/ControlRigSpline/Content
Paths=../../../Engine/Plugins/Animation/ControlRig/Content
Paths=../../../Engine/Plugins/Animation/DeformerGraph/Content
Paths=../../../Engine/Plugins/Animation/IKRig/Content
Paths=../../../Engine/Plugins/Bridge/Content
Paths=../../../Engine/Plugins/Compositing/LensDistortion/Content
Paths=../../../Engine/Plugins/Developer/AnimationSharing/Content
Paths=../../../Engine/Plugins/Editor/BlueprintHeaderView/Content
Paths=../../../Engine/Plugins/Editor/GeometryMode/Content
Paths=../../../Engine/Plugins/Editor/ObjectMixer/LightMixer/Content
Paths=../../../Engine/Plugins/Editor/ObjectMixer/ObjectMixer/Content
Paths=../../../Engine/Plugins/Editor/SpeedTreeImporter/Content
Paths=../../../Engine/Plugins/Editor/UVEditor/Content
Paths=../../../Engine/Plugins/Enterprise/DatasmithContent/Content
Paths=../../../Engine/Plugins/Enterprise/GLTFExporter/Content
Paths=../../../Engine/Plugins/Experimental/ChaosCaching/Content
Paths=../../../Engine/Plugins/Experimental/ChaosClothEditor/Content
Paths=../../../Engine/Plugins/Experimental/ChaosNiagara/Content
Paths=../../../Engine/Plugins/Experimental/ChaosSolverPlugin/Content
Paths=../../../Engine/Plugins/Experimental/ChaosVehiclesPlugin/Content
Paths=../../../Engine/Plugins/Experimental/ControlFlows/Content
Paths=../../../Engine/Plugins/Experimental/Dataflow/Content
Paths=../../../Engine/Plugins/Experimental/FullBodyIK/Content
Paths=../../../Engine/Plugins/Experimental/GeometryCollectionPlugin/Content
Paths=../../../Engine/Plugins/Experimental/GeometryScripting/Content
Paths=../../../Engine/Plugins/Experimental/Landmass/Content
Paths=../../../Engine/Plugins/Experimental/PythonScriptPlugin/Content
Paths=../../../Engine/Plugins/Experimental/ToolPresets/Content
Paths=../../../Engine/Plugins/FX/Niagara/Content
Paths=../../../Engine/Plugins/Fab/Content
Paths=../../../Engine/Plugins/Interchange/Runtime/Content
Paths=../../../Engine/Plugins/Media/MediaCompositing/Content
Paths=../../../Engine/Plugins/Media/MediaPlate/Content
Paths=../../../Engine/Plugins/MovieScene/SequencerScripting/Content
Paths=../../../Engine/Plugins/Runtime/AudioSynesthesia/Content
Paths=../../../Engine/Plugins/Runtime/AudioWidgets/Content
Paths=../../../Engine/Plugins/Runtime/GeometryProcessing/Content
Paths=../../../Engine/Plugins/Runtime/HairStrands/Content
Paths=../../../Engine/Plugins/Runtime/MeshModelingToolset/Content
Paths=../../../Engine/Plugins/Runtime/Metasound/Content
Paths=../../../Engine/Plugins/Runtime/ResonanceAudio/Content
Paths=../../../Engine/Plugins/Runtime/RigVM/Content
Paths=../../../Engine/Plugins/Runtime/Synthesis/Content
Paths=../../../Engine/Plugins/Runtime/WaveTable/Content
Paths=../../../Engine/Plugins/Tests/EditorTests/Content
Paths=../../../Engine/Plugins/Tests/RuntimeTests/Content
Paths=../../../Engine/Plugins/TraceUtilities/Content
Paths=../../../Engine/Plugins/VirtualProduction/Takes/Content
Paths=../../../Engine/Plugins/WwiseNiagara/Content
Paths=../../../Engine/Plugins/Wwise/Content
Paths=../../../FactoryGame/Plugins/AbstractInstance/Content
Paths=../../../FactoryGame/Plugins/EditorTools/Content
Paths=../../../FactoryGame/Plugins/GameplayEvents/Content
Paths=../../../FactoryGame/Plugins/InstancedSplines/Content
Paths=../../../FactoryGame/Plugins/Online/OnlineIntegration/Content
Paths=../../../FactoryGame/Plugins/SignificanceISPC/Content

[/Script/SteamSockets.SteamSocketsNetDriver]
MaxClientRate=300000
MaxInternetClientRate=300000

[/Script/SocketSubsystemEOS.NetDriverEOSBase]
MaxClientRate=300000
MaxInternetClientRate=300000

23 changes: 23 additions & 0 deletions Game.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=104857600
MaxDynamicBandwidth=104857600
MinDynamicBandwidth=104857600
MAXPOSITIONERRORSQUARED=32.00f
MoveRepSize=512.0f
CLIENTADJUSTUPDATECOST=512.0f
bMovementTimeDiscrepancyDetection=false
bMovementTimeDiscrepancyResolution=false
bMovementTimeDiscrepancyForceCorrectionsDuringResolution=false
MAXCLIENTUPDATEINTERVAL=2.20f
MaxMoveDeltaTime=0.700f
MaxClientSmoothingDeltaTime=2.20f
MaxClientForcedUpdateDuration=1.0f
ClientNetSendMoveDeltaTime=0.0332
ClientNetSendMoveDeltaTimeStationary=0.0664
ClientNetSendMoveThrottleOverPlayerCount=99
ServerForcedUpdateHitchThreshold=2.800f

[/Script/Engine.GameSession]
ConnectionTimeout=30
InitialConnectTimeout=30
MaxPlayers=4
60 changes: 60 additions & 0 deletions GameUserSettings.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[/Script/FactoryGame.FGGameUserSettings]
mFloatValues=(("FG.AutosaveInterval", 300.000000))
mIntValues=(("FG.DisableSeasonalEvents", 0),("FG.NetworkQuality", 3))
mAudioVolumes=(Name="Master_Bus_Volume",Value=1.000000)
mAudioVolumes=(Name="Ambient_Bus_Volume",Value=1.000000)
mAudioVolumes=(Name="Factory_Bus_Volume",Value=1.000000)
mAudioVolumes=(Name="Music_Bus_Volume",Value=0.500000)
mAudioVolumes=(Name="SFX_Bus_Volume",Value=1.000000)
mAudioVolumes=(Name="VO_Bus_Volume",Value=1.000000)
mNetworkQuality=3
mIsArachnophobiaMode=False
mInvertY=False
mAutoSortInventory=False
mPrimaryLanguage=
CurrentFGGameUserSettingsVersion=0
bUseVSync=False
bUseDynamicResolution=False
ResolutionSizeX=1280
ResolutionSizeY=720
LastUserConfirmedResolutionSizeX=1280
LastUserConfirmedResolutionSizeY=720
WindowPosX=-1
WindowPosY=-1
FullscreenMode=1
LastConfirmedFullscreenMode=1
PreferredFullscreenMode=1
Version=5
AudioQualityLevel=0
LastConfirmedAudioQualityLevel=0
FrameRateLimit=0.000000
DesiredScreenWidth=1280
DesiredScreenHeight=720
LastUserConfirmedDesiredScreenWidth=1280
LastUserConfirmedDesiredScreenHeight=720
LastRecommendedScreenWidth=-1.000000
LastRecommendedScreenHeight=-1.000000
LastCPUBenchmarkResult=-1.000000
LastGPUBenchmarkResult=-1.000000
LastGPUBenchmarkMultiplier=1.000000
bUseHDRDisplayOutput=False
HDRDisplayOutputNits=1000
mDismissedFirstLaunchPopupScreen=False
mPreferredOnlineIntegrationMode=Undefined

[ScalabilityGroups]
sg.ResolutionQuality=100
sg.ViewDistanceQuality=3
sg.AntiAliasingQuality=3
sg.ShadowQuality=3
sg.PostProcessQuality=3
sg.TextureQuality=3
sg.EffectsQuality=3
sg.FoliageQuality=3
sg.ShadingQuality=3
sg.GlobalIlluminationQuality=1
sg.ReflectionQuality=3

[/Script/Engine.GameUserSettings]
bUseDesiredScreenHeight=False

8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,11 @@ helm install satisfactory k8s-at-home/satisfactory -f values.yaml

| Parameter | Default | Function |
|-------------------------|:---------:|-----------------------------------------------------|
| `AUTOPAUSE` | `true` | pause game when no player is connected |
| `AUTOSAVEINTERVAL` | `300` | autosave interval in seconds |
| `AUTOSAVENUM` | `5` | number of rotating autosave files |
| `AUTOSAVEONDISCONNECT` | `true` | autosave when last player disconnects |
| `CRASHREPORT` | `true` | automatic crash reporting |
| `DEBUG` | `false` | for debugging the server |
| `DISABLESEASONALEVENTS` | `false` | disable the FICSMAS event (you miserable bastard) |
| `MAXOBJECTS` | `2162688` | set the object limit for your server |
| `MAXPLAYERS` | `4` | set the player limit for your server |
| `MAXTICKRATE` | `30` | set the maximum sim tick rate for your server |
| `NETWORKQUALITY` | `3` | set the network quality/bandwidth for your server |
| `PGID` | `1000` | set the group ID of the user the server will run as |
| `PUID` | `1000` | set the user ID of the user the server will run as |
| `ROOTLESS` | `false` | run the container as a non-root user |
Expand Down Expand Up @@ -151,7 +145,7 @@ services:
container_name: 'sftp-server'
image: 'atmoz/sftp:latest'
volumes:
- '/path/to/config:/home/your-ftp-user'
- './satisfactory-server:/home/your-ftp-user'
ports:
- '2222:22'
# set the user and password, and the user's UID (this should match the PUID and PGID of the satisfactory-server container)
Expand Down
78 changes: 77 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,82 @@

set -e

set_ini_prop() {
sed "/\[$2\]/,/^\[/ s/$3\=.*/$3=$4/" -i "/home/steam/$1"
}

set_ini_val() {
sed "s/\(\"$2\", \)[0-9]*/\1$3/" -i "/home/steam/$1"
}

if [ -f "/config/overrides/Engine.ini" ]; then
echo "Config override /config/overrides/Engine.ini exists, ignoring environment variables"
cp /config/overrides/Engine.ini "${GAMECONFIGDIR}/Config/LinuxServer/"
else
if ! [[ "$MAXOBJECTS" =~ $NUMCHECK ]] ; then
printf "Invalid max objects number given: %s\\n" "$MAXOBJECTS"
MAXOBJECTS="2162688"
fi
printf "Setting max objects number to %s\\n" "$MAXOBJECTS"
set_ini_prop "Engine.ini" "\/Script\/Engine\.GarbageCollectionSettings" "gc.MaxObjectsInEditor" "$MAXOBJECTS"
set_ini_prop "Engine.ini" "\/Script\/Engine\.GarbageCollectionSettings" "gc.MaxObjectsInGame" "$MAXOBJECTS"

if ! [[ "$MAXTICKRATE" =~ $NUMCHECK ]] ; then
printf "Invalid max tick rate number given: %s\\n" "$MAXTICKRATE"
MAXTICKRATE="120"
fi
printf "Setting max tick rate to %s\\n" "$MAXTICKRATE"
set_ini_prop "Engine.ini" "\/Script\/OnlineSubsystemUtils.IpNetDriver" "NetServerMaxTickRate" "$MAXTICKRATE"
set_ini_prop "Engine.ini" "\/Script\/OnlineSubsystemUtils.IpNetDriver" "LanServerMaxTickRate" "$MAXTICKRATE"

if ! [[ "$TIMEOUT" =~ $NUMCHECK ]] ; then
printf "Invalid timeout number given: %s\\n" "$TIMEOUT"
TIMEOUT="300"
fi
printf "Setting timeout number to %s\\n" "$TIMEOUT"
set_ini_prop "Engine.ini" "\/Script\/OnlineSubsystemUtils\.IpNetDriver" "ConnectionTimeout" "$TIMEOUT"
set_ini_prop "Engine.ini" "\/Script\/OnlineSubsystemUtils\.IpNetDriver" "InitialConnectTimeout" "$TIMEOUT"

[[ "${SERVERSTREAMING,,}" == "true" ]] && SERVERSTREAMING="1" || SERVERSTREAMING="0"
printf "Setting server streaming to %s\\n" "$SERVERSTREAMING"
set_ini_prop "Engine.ini" "ConsoleVariables" "wp.Runtime.EnableServerStreaming" "$SERVERSTREAMING"

cp /home/steam/Engine.ini "${GAMECONFIGDIR}/Config/LinuxServer/"
fi

if [ -f "/config/overrides/Game.ini" ]; then
echo "Config override /config/overrides/Game.ini exists, ignoring environment variables"
cp /config/overrides/Game.ini "${GAMECONFIGDIR}/Config/LinuxServer/"
else
if ! [[ "$TIMEOUT" =~ $NUMCHECK ]] ; then
printf "Invalid timeout number given: %s\\n" "$TIMEOUT"
TIMEOUT="300"
fi
printf "Setting timeout number to %s\\n" "$TIMEOUT"
set_ini_prop "Game.ini" "\/Script\/Engine\.GameSession" "ConnectionTimeout" "$TIMEOUT"
set_ini_prop "Game.ini" "\/Script\/Engine\.GameSession" "InitialConnectTimeout" "$TIMEOUT"

if ! [[ "$MAXPLAYERS" =~ $NUMCHECK ]] ; then
printf "Invalid max players given: %s\\n" "$MAXPLAYERS"
MAXPLAYERS="4"
fi
printf "Setting max players to %s\\n" "$MAXPLAYERS"
set_ini_prop "Game.ini" "\/Script\/Engine\.GameSession" "MaxPlayers" "$MAXPLAYERS"

cp /home/steam/Game.ini "${GAMECONFIGDIR}/Config/LinuxServer/"
fi

if [ -f "/config/overrides/GameUserSettings.ini" ]; then
echo "Config override /config/overrides/GameUserSettings.ini exists, ignoring environment variables"
cp /config/overrides/GameUserSettings.ini "${GAMECONFIGDIR}/Config/LinuxServer/"
else
[[ "${DISABLESEASONALEVENTS,,}" == "true" ]] && DISABLESEASONALEVENTS="1" || DISABLESEASONALEVENTS="0"
printf "Setting disable seasonal events to %s\\n" "$DISABLESEASONALEVENTS"
set_ini_val "GameUserSettings.ini" "FG.DisableSeasonalEvents" "$DISABLESEASONALEVENTS"

cp /home/steam/GameUserSettings.ini "${GAMECONFIGDIR}/Config/LinuxServer/"
fi

if [[ "${SKIPUPDATE,,}" != "false" ]] && [ ! -f "/config/gamefiles/FactoryServer.sh" ]; then
printf "%s Skip update is set, but no game files exist. Updating anyway\\n" "${MSGWARNING}"
SKIPUPDATE="false"
Expand Down Expand Up @@ -41,4 +117,4 @@ fi

cd /config/gamefiles || exit 1

exec ./FactoryServer.sh -Port="$SERVERGAMEPORT"
exec ./FactoryServer.sh -Port="$SERVERGAMEPORT" "$@"

0 comments on commit 15ce928

Please sign in to comment.