From 27b45782726d58d198c361f08cb623025f399fd0 Mon Sep 17 00:00:00 2001 From: Robert Thomas <31854736+wolveix@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:49:13 +0100 Subject: [PATCH] Performance tweaks + configurable client timeout --- Dockerfile | 5 +++-- Engine.ini | 36 ++++++++++++++++++++++++++++++++++-- Game.ini | 16 +++++++++++++++- README.md | 3 ++- run.sh | 22 +++++++++++++++------- 5 files changed, 69 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8b3472d..f0b785f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ WORKDIR /config ENV AUTOPAUSE="true" \ AUTOSAVEINTERVAL="300" \ - AUTOSAVENUM="3" \ + AUTOSAVENUM="5" \ AUTOSAVEONDISCONNECT="true" \ CRASHREPORT="true" \ DEBUG="false" \ @@ -35,7 +35,8 @@ ENV AUTOPAUSE="true" \ SERVERQUERYPORT="15777" \ SKIPUPDATE="false" \ STEAMAPPID="1690800" \ - STEAMBETA="false" + STEAMBETA="false" \ + TIMEOUT="300" EXPOSE 7777/udp 15000/udp 15777/udp diff --git a/Engine.ini b/Engine.ini index be6c6f6..4da1f7f 100644 --- a/Engine.ini +++ b/Engine.ini @@ -2,14 +2,30 @@ 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=104857600 ConfiguredLanSpeed=104857600 +[/script/Engine.StreamingSettings] +s.AsyncLoadingThreadEnabled=True +s.EventDrivenLoaderEnabled=True + [/Script/OnlineSubsystemUtils.IpNetDriver] NetServerMaxTickRate=120 MaxNetTickRate=400 @@ -24,8 +40,24 @@ MaxClientRate=104857600 MaxInternetClientRate=104857600 [/Script/FactoryGame.FGSaveSession] -mNumRotatingAutosaves=3 +mNumRotatingAutosaves=5 [CrashReportClient] -bImplicitSend=True +bAgreeToCrashUpload=true +bImplicitSend=true +[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 diff --git a/Game.ini b/Game.ini index 1a16d53..3be854a 100644 --- a/Game.ini +++ b/Game.ini @@ -1,7 +1,21 @@ [/Script/Engine.GameNetworkManager] TotalNetBandwidth=104857600 MaxDynamicBandwidth=104857600 -MinDynamicBandwidth=10485760 +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] MaxPlayers=4 diff --git a/README.md b/README.md index 85a287a..44b5619 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ helm install satisfactory k8s-at-home/satisfactory -f values.yaml | ----------------------- | :-------: | --------------------------------------------------- | | `AUTOPAUSE` | `true` | pause game when no player is connected | | `AUTOSAVEINTERVAL` | `300` | autosave interval in seconds | -| `AUTOSAVENUM` | `3` | number of rotating autosave files | +| `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 | @@ -116,6 +116,7 @@ helm install satisfactory k8s-at-home/satisfactory -f values.yaml | `SERVERQUERYPORT` | `15777` | set the game's query port | | `SKIPUPDATE` | `false` | avoid updating the game on container start/restart | | `STEAMBETA` | `false` | set experimental game version | +| `TIMEOUT` | `300` | set client timeout (in seconds) | ## Loading Your Save diff --git a/run.sh b/run.sh index 08ee560..07ec792 100755 --- a/run.sh +++ b/run.sh @@ -13,13 +13,6 @@ set_ini_val() { NUMCHECK='^[0-9]+$' ## START Engine.ini -if ! [[ "$AUTOSAVENUM" =~ $NUMCHECK ]] ; then - printf "Invalid autosave number given: %s\\n" "${AUTOSAVENUM}" - AUTOSAVENUM="3" -fi -printf "Setting autosave number to %s\\n" "${AUTOSAVENUM}" -set_ini_prop "Engine.ini" "\/Script\/FactoryGame\.FGSaveSession" "mNumRotatingAutosaves" "${AUTOSAVENUM}" - if ! [[ "$MAXOBJECTS" =~ $NUMCHECK ]] ; then printf "Invalid max objects number given: %s\\n" "${MAXOBJECTS}" MAXOBJECTS="2162688" @@ -28,6 +21,21 @@ 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 ! [[ "$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" "InitialConnectTimeout" "${TIMEOUT}" +set_ini_prop "Engine.ini" "\/Script\/OnlineSubsystemUtils\.IpNetDriver" "ConnectionTimeout" "${TIMEOUT}" + +if ! [[ "$AUTOSAVENUM" =~ $NUMCHECK ]] ; then + printf "Invalid autosave number given: %s\\n" "${AUTOSAVENUM}" + AUTOSAVENUM="3" +fi +printf "Setting autosave number to %s\\n" "${AUTOSAVENUM}" +set_ini_prop "Engine.ini" "\/Script\/FactoryGame\.FGSaveSession" "mNumRotatingAutosaves" "${AUTOSAVENUM}" + [[ "${CRASHREPORT,,}" == "true" ]] && CRASHREPORT="true" || CRASHREPORT="false" printf "Setting crash reporting to %s\\n" "${CRASHREPORT^}" set_ini_prop "Engine.ini" "CrashReportClient" "bImplicitSend" "${CRASHREPORT^}"