Skip to content

Commit

Permalink
Performance tweaks + configurable client timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
wolveix committed Oct 14, 2022
1 parent 69a59e0 commit 27b4578
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WORKDIR /config

ENV AUTOPAUSE="true" \
AUTOSAVEINTERVAL="300" \
AUTOSAVENUM="3" \
AUTOSAVENUM="5" \
AUTOSAVEONDISCONNECT="true" \
CRASHREPORT="true" \
DEBUG="false" \
Expand All @@ -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

Expand Down
36 changes: 34 additions & 2 deletions Engine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
16 changes: 15 additions & 1 deletion Game.ini
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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

Expand Down
22 changes: 15 additions & 7 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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^}"
Expand Down

0 comments on commit 27b4578

Please sign in to comment.