2025-07-04 23:19 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004290Spring engineGeneralpublic2014-01-24 12:06
ReporterBeherith 
Assigned Toabma 
PriorityhighSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version96.0 
Target Version97.0Fixed in Version 
Summary0004290: Fix stutter at lower frame rates - PATCH INCLUDED
Description
So, I noticed how spring stutters alot at lower frame rates (CTO assert errors) and I found the bug and have solved it on my local mingw build.

Inside CGame::ClientReadNet(), there is a switch which handles packetCode. ClientReadNet will keep on reading netmessages until it either: 1, runs out of its time to do so (unlikely, msgProcTimeLeft is usually >10ms) 2. runs out of netpackets (at the current time) OR if it encounters a NETMSG_SYNCRESPONSE. The bug is that if the sync check is correct (any of the following return true):
if (playerNum == gu->myPlayerNum) { return; }
if (gs->frameNum != frameNum) { return; }
if (checkSum == ourCheckSum) { return; }

then ClientReadNet will return and not continue processing packets. If it has not found NETMSG_KEYFRAME or a NETMSG_NEWFRAME before returning, then a draw frame will commence (because no new frame was issued)!

If many NETMSG_SYNCRESPONSE follow each other, then each one will result in a new draw frame and no new simframe.

Note the log for more info:
NETMSG_SYNCRESPONSE = 33

Steps To Reproducefix:

-- if (playerNum == gu->myPlayerNum) { return; }
-- if (gs->frameNum != frameNum) { return; }
-- if (checkSum == ourCheckSum) { return; }

++ if (playerNum == gu->myPlayerNum) { break; }
++ if (gs->frameNum != frameNum) { break; }
++ if (checkSum == ourCheckSum) { break; }

Additional Information[f=0009364] maxSimFPS= 97.019226, minDrawFPS= 6.762743 , simDrawRatio=14.346134, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.761150, avgDrawFrameTime=22.180347, limit=125.688637
[f=0009364] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009364] maxSimFPS= 97.019226, minDrawFPS= 6.735116 , simDrawRatio=14.404982, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.761150, avgDrawFrameTime=22.271330, limit=126.204208
[f=0009364] NETMSG_NEWFRAME
[f=0009364] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009365] msgProcTimeLeft= 14000.000000, packetcode= 11
[f=0009365] msgProcTimeLeft= 14000.000000, packetcode= 33
[f=0009365] maxSimFPS= 96.887154, minDrawFPS= 6.709079 , simDrawRatio=14.441201, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.773093, avgDrawFrameTime=22.357763, limit=126.694008
[f=0009365] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009365] maxSimFPS= 96.887154, minDrawFPS= 6.669668 , simDrawRatio=14.526534, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.773093, avgDrawFrameTime=22.489876, limit=127.442635
[f=0009365] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009365] Error: assert(CTO <= 1.3f) failed (SF=9365 : DF=7458 : CTO=1.593719 : WSF=0.028459 : DT=56.000000ms : DLNPPT=0.000000ms | DLRPT=0.000000ms | DSFPT=65.000000ms : NP=0)
[f=0009365] maxSimFPS= 96.887154, minDrawFPS= 6.647350 , simDrawRatio=14.575304, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.773093, avgDrawFrameTime=22.565382, limit=127.870499
[f=0009365] NETMSG_NEWFRAME
[f=0009365] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009366] msgProcTimeLeft= 14000.000000, packetcode= 33
[f=0009366] maxSimFPS= 98.442993, minDrawFPS= 6.626287 , simDrawRatio=14.856435, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.634439, avgDrawFrameTime=22.637114, limit=128.276978
[f=0009366] msgProcTimeLeft= 15000.000000, packetcode= 50
[f=0009366] NETMSG_NEWFRAME
[f=0009366] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009367] msgProcTimeLeft= 14000.000000, packetcode= 33
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.591883 , simDrawRatio=14.816806, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=22.755259, limit=128.946472
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.573903 , simDrawRatio=14.857330, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=22.817495, limit=129.299133
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 50
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009367] Error: assert(CTO <= 1.3f) failed (SF=9367 : DF=7462 : CTO=1.593719 : WSF=0.028459 : DT=56.000000ms : DLNPPT=0.000000ms | DLRPT=0.000000ms | DSFPT=66.000000ms : NP=0)
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.556912 , simDrawRatio=14.895829, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=22.876621, limit=129.634186
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009367] Error: assert(CTO <= 1.3f) failed (SF=9367 : DF=7463 : CTO=2.390579 : WSF=0.028459 : DT=84.000000ms : DLNPPT=0.000000ms | DLRPT=0.000000ms | DSFPT=94.000000ms : NP=0)
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.526623 , simDrawRatio=14.964960, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=22.982790, limit=130.235809
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009367] Error: assert(CTO <= 1.3f) failed (SF=9367 : DF=7464 : CTO=3.130520 : WSF=0.028459 : DT=110.000000ms : DLNPPT=0.000000ms | DLRPT=0.000000ms | DSFPT=120.000000ms : NP=0)
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.512211 , simDrawRatio=14.998077, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=23.033651, limit=130.524017
[f=0009367] NETMSG_NEWFRAME
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009368] msgProcTimeLeft= 14000.000000, packetcode= 33
[f=0009368] maxSimFPS= 99.211197, minDrawFPS= 6.512687 , simDrawRatio=15.233528, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.567581, avgDrawFrameTime=23.031969, limit=130.514496
[f=0009368] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009368] maxSimFPS= 99.211197, minDrawFPS= 6.513139 , simDrawRatio=15.232471, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.567581, avgDrawFrameTime=23.030371, limit=130.505432
[f=0009368] NETMSG_NEWFRAME
[f=0009368] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009369] msgProcTimeLeft= 14000.000000, packetcode= 33
[f=0009369] maxSimFPS= 98.961464, minDrawFPS= 6.513568 , simDrawRatio=15.193127, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.589202, avgDrawFrameTime=23.028852, limit=130.496826
[f=0009369] msgProcTimeLeft= 15000.000000, packetcode= 50
[f=0009369] NETMSG_NEWFRAME
[f=0009369] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009370] msgProcTimeLeft= 14000.000000, packetcode= 50
[f=0009370] NETMSG_NEWFRAME
[f=0009370] msgProcTimeLeft= 14000.000000, packetcode= 2
[f=0009371] msgProcTimeLeft= 13000.000000, packetcode= 50
[f=0009371] msgProcTimeLeft= 13000.000000, packetcode= 33
[f=0009371] maxSimFPS= 99.569458, minDrawFPS= 6.485811 , simDrawRatio=15.351891, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.536755, avgDrawFrameTime=23.127409, limit=131.055328
[f=0009371] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009371] maxSimFPS= 99.569458, minDrawFPS= 6.459659 , simDrawRatio=15.414042, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.536755, avgDrawFrameTime=23.221039, limit=131.585892
[f=0009371] msgProcTimeLeft= 15000.000000, packetcode= 50
[f=0009371] NETMSG_NEWFRAME
[f=0009371] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009372] msgProcTimeLeft= 14000.000000, packetcode= 14
[f=0009372] msgProcTimeLeft= 14000.000000, packetcode= 14
[f=0009372] msgProcTimeLeft= 14000.000000, packetcode= 14
[f=0009372] msgProcTimeLeft= 14000.000000, packetcode= 11
[f=0009372] msgProcTimeLeft= 14000.000000, packetcode= 11
[f=0009372] msgProcTimeLeft= 14000.000000, packetcode= 33
[f=0009372] maxSimFPS= 100.473801, minDrawFPS= 6.448843 , simDrawRatio=15.580128, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.459917, avgDrawFrameTime=23.259987, limit=131.806595
[f=0009372] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009372] maxSimFPS= 100.473801, minDrawFPS= 6.438601 , simDrawRatio=15.604913, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.459917, avgDrawFrameTime=23.296988, limit=132.016266
[f=0009372] msgProcTimeLeft= 15000.000000, packetcode= 50
[f=0009372] NETMSG_NEWFRAME
[f=0009372] msgProcTimeLeft= 15000.000000, packetcode= 2
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0012757

Beherith (reporter)

[f=0009366] NETMSG_NEWFRAME
[f=0009366] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009367] msgProcTimeLeft= 14000.000000, packetcode= 33
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.591883 , simDrawRatio=14.816806, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=22.755259, limit=128.946472
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.573903 , simDrawRatio=14.857330, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=22.817495, limit=129.299133
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 50
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009367] Error: assert(CTO <= 1.3f) failed (SF=9367 : DF=7462 : CTO=1.593719 : WSF=0.028459 : DT=56.000000ms : DLNPPT=0.000000ms | DLRPT=0.000000ms | DSFPT=66.000000ms : NP=0)
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.556912 , simDrawRatio=14.895829, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=22.876621, limit=129.634186
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009367] Error: assert(CTO <= 1.3f) failed (SF=9367 : DF=7463 : CTO=2.390579 : WSF=0.028459 : DT=84.000000ms : DLNPPT=0.000000ms | DLRPT=0.000000ms | DSFPT=94.000000ms : NP=0)
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.526623 , simDrawRatio=14.964960, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=22.982790, limit=130.235809
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 33
[f=0009367] Error: assert(CTO <= 1.3f) failed (SF=9367 : DF=7464 : CTO=3.130520 : WSF=0.028459 : DT=110.000000ms : DLNPPT=0.000000ms | DLRPT=0.000000ms | DSFPT=120.000000ms : NP=0)
[f=0009367] maxSimFPS= 97.670647, minDrawFPS= 6.512211 , simDrawRatio=14.998077, reconnectSimDrawBalance=0.150000, avgSimFrameTime=8.702717, avgDrawFrameTime=23.033651, limit=130.524017
[f=0009367] NETMSG_NEWFRAME
[f=0009367] msgProcTimeLeft= 15000.000000, packetcode= 2
[f=0009368] msgProcTimeLeft= 14000.000000, packetcode= 33
+Notes

-Issue History
Date Modified Username Field Change
2014-01-23 21:36 Beherith New Issue
2014-01-23 21:40 Beherith Note Added: 0012757
2014-01-24 11:43 abma Target Version => 97.0
2014-01-24 11:43 abma Description Updated View Revisions
2014-01-24 12:05 abma Changeset attached => spring develop 7d7441e1
2014-01-24 12:05 abma Assigned To => abma
2014-01-24 12:05 abma Status new => resolved
2014-01-24 12:05 abma Resolution open => fixed
2014-01-24 12:06 abma Changeset attached => spring CRNfix 382e6261
+Issue History