WIP checkpoint: TCP_NODELAY + dense-send + BT_JIT/BT_ANIM probes + FOGDAY test egg (task #50 investigation)

Session-in-progress peer-motion work, checkpointed before bisecting the
07-13/07-14 gait regression. Contains: TCP_NODELAY on game sockets (L4NET),
every-frame dense position send while moving + came-to-rest/REST send +
per-frame BT_JIT/BT_ANIM smoothness probes (mech4). bodyTargetSpeed feed
reverted to derived-velocity default. MOVER.cpp spline experiment already
reverted. NOT a fix -- a checkpoint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-14 13:43:35 -05:00
co-authored by Claude Opus 4.8
parent 94647dd378
commit d5d512e087
3 changed files with 374 additions and 27 deletions
+18
View File
@@ -2118,6 +2118,12 @@ Logical L4NetworkManager::CheckBuffers(NetworkPacket *network_packet)
{
continue;
}
// TCP_NODELAY on the accepted GAME socket (not the console):
// without it Nagle coalesces the inbound per-frame update
// records into bursts -> the peer is received in lurches.
BOOL gameNoDelay = TRUE;
if (setsockopt(tempSocket, IPPROTO_TCP, TCP_NODELAY, (char*)&gameNoDelay, sizeof(gameNoDelay)))
DEBUG_STREAM << "WARN: could not set TCP_NODELAY on accepted game socket; setsockopt() failed with " << WSAGetLastError() << "\n" << std::flush;
}
remote_host->SetNetworkSocket(tempSocket);
@@ -2798,6 +2804,18 @@ SOCKET L4NetworkManager::OpenConnection(
WSACleanup();
PostQuitMessage(AbortExitCodeID);
}
// TCP_NODELAY: disable Nagle so the small per-frame update records ship
// immediately instead of being coalesced. With Nagle on (the default),
// Nagle + delayed-ACK batch the tiny position packets into ~40-200ms
// bursts, so a peer that moves at a steady speed is RECEIVED in lurches
// (measured: dead-reckoned ground speed swinging 3x per 0.25s window).
// The pod net carries steady real-time state where latency, not
// throughput, is what matters -- exactly the case NODELAY is for.
{
BOOL noDelay = TRUE;
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char*)&noDelay, sizeof(noDelay)))
DEBUG_STREAM << "WARN: could not set TCP_NODELAY on active socket; setsockopt() failed with " << WSAGetLastError() << "\n" << std::flush;
}
return sock;
}
else if(connection_type == NETNUB_TCP_LISTEN)