From fe9705bec290c8b98f8c8c4841e31c9a9e7cd62a Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 20 Jan 2008 19:45:25 +0000 Subject: [PATCH] For some reason, cl_netinputpacketsperserverpacket > 1 causes choppiness when cl_movement is active and fps are high. As workaround, disable the "replying to server frames" code for cl_netinputpacketsperserverpacket > 1, and make it ONLY respond to server frames (or after 0.1s when no server frame came) when set to 0. 0 MAY be a bit more smooth than 1, but something tells me it is LESS smooth when packet loss is involved. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7985 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_input.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/cl_input.c b/cl_input.c index da986f25..06144935 100644 --- a/cl_input.c +++ b/cl_input.c @@ -1389,8 +1389,28 @@ void CL_SendMove(void) { // movement should be sent immediately whenever a server // packet is received, to minimize ping times - if (!cl.movement_needupdate && realtime < lastsendtime + packettime) - return; + // + + if(cl_netinputpacketsperserverpacket.value > 1) + { + // FIXME: needupdate causes odd behaviour with movement reply as it + // seems, if cl_netinputpacketsperserverpackets is > 1. Don't know + // why. No idea if it ever gets fixed, but until it does... + if (realtime < lastsendtime + packettime) + return; + } + else if(cl_netinputpacketsperserverpacket.value == 1) + { + // the way it is meant to be + if (!cl.movement_needupdate && realtime < lastsendtime + packettime) + return; + } + else + { + // only ever send input as replies to server packets or if we REALLY got nothing else (FIXME may be the more sane default) + if (!cl.movement_needupdate && realtime < lastsendtime + packettime + 0.1) + return; + } } // don't let it fall behind if CL_SendMove hasn't been called recently -- 2.39.2