From e25b91d5a1abf72f172a311fac0ed19882f4a1a8 Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Fri, 26 Sep 2014 16:11:52 +1200 Subject: [PATCH] Cleanup --- src/d_main.cpp | 4 ++-- src/d_net.cpp | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 8a8751041e..a24586bc4d 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -756,9 +756,9 @@ void D_Display () } screen->SetBlendingRect(viewwindowx, viewwindowy, viewwindowx + viewwidth, viewwindowy + viewheight); - //P_PredictPlayer(&players[consoleplayer]); + Renderer->RenderView(&players[consoleplayer]); - //P_UnPredictPlayer(); + if ((hw2d = screen->Begin2D(viewactive))) { // Redraw everything every frame when using 2D accel diff --git a/src/d_net.cpp b/src/d_net.cpp index c0585a3661..d33f47e38a 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -1402,13 +1402,10 @@ void NetUpdate (void) if (NetMode == NET_PeerToPeer) { - // Try to guess ahead the time it takes to send responses to the slowest node - // [ED850] It seems that there is a bias based on network adaption (which the arbitrator doesn't do), - // so I have set this up to assume one less tic, which appears to balance it out. int totalavg = 0; if (net_ticbalance) { - // We shouldn't adapt if we are already the slower then the arbitrator, otherwise it just adds more latency + // Try to guess ahead the time it takes to send responses to the slowest node int nodeavg = 0, arbavg = 0; for (j = 0; j < BACKUPTICS; j++) @@ -1419,12 +1416,14 @@ void NetUpdate (void) arbavg /= BACKUPTICS; nodeavg /= BACKUPTICS; + // We shouldn't adapt if we are already the arbitrator isn't what we are waiting for, otherwise it just adds more latency if (arbavg > nodeavg) { lastaverage = totalavg = ((arbavg + nodeavg) / 2); } else { + // Allow room to guess two tics ahead if (nodeavg > (arbavg + 2) && lastaverage > 0) lastaverage--; totalavg = lastaverage;