cvar_t cl_shownet = {0, "cl_shownet","0","1 = print packet size, 2 = print packet message list"};
cvar_t cl_nolerp = {0, "cl_nolerp", "0","network update smoothing"};
+cvar_t cl_lerpexcess = {0, "cl_lerpexcess", "0","maximum allowed lerp excess (hides, not fixes, some packet loss)"};
cvar_t cl_lerpanim_maxdelta_server = {0, "cl_lerpanim_maxdelta_server", "0.1","maximum frame delta for smoothing between server-controlled animation frames (when 0, one network frame)"};
cvar_t cl_lerpanim_maxdelta_framegroups = {0, "cl_lerpanim_maxdelta_framegroups", "0.1","maximum frame delta for smoothing between framegroups (when 0, one network frame)"};
}
f = (cl.time - cl.mtime[1]) / (cl.mtime[0] - cl.mtime[1]);
- return bound(0, f, 1);
+ return bound(0, f, 1 + cl_lerpexcess.value);
}
void CL_ClearTempEntities (void)
VectorCopy(cl.movement_origin, origin);
VectorSet(angles, 0, cl.viewangles[1], 0);
}
- else if (interpolate && e->persistent.lerpdeltatime > 0 && (lerp = (cl.time - e->persistent.lerpstarttime) / e->persistent.lerpdeltatime) < 1)
+ else if (interpolate && e->persistent.lerpdeltatime > 0 && (lerp = (cl.time - e->persistent.lerpstarttime) / e->persistent.lerpdeltatime) < 1 + cl_lerpexcess.value)
{
// interpolate the origin and angles
lerp = max(0, lerp);
Cvar_RegisterVariable (&cl_anglespeedkey);
Cvar_RegisterVariable (&cl_shownet);
Cvar_RegisterVariable (&cl_nolerp);
+ Cvar_RegisterVariable (&cl_lerpexcess);
Cvar_RegisterVariable (&cl_lerpanim_maxdelta_server);
Cvar_RegisterVariable (&cl_lerpanim_maxdelta_framegroups);
Cvar_RegisterVariable (&cl_deathfade);
}
extern cvar_t slowmo;
+extern cvar_t cl_lerpexcess;
extern void CSQC_UpdateNetworkTimes(double newtime, double oldtime);
static void CL_NetworkTimeReceived(double newtime)
{
if (cl.mtime[0] > cl.mtime[1])
World_Physics_Frame(&cl.world, cl.mtime[0] - cl.mtime[1], cl.movevars_gravity);
+
+ // only lerp entities that also get an update in this frame, when lerp excess is used
+ if(cl_lerpexcess.value > 0)
+ {
+ int i;
+ for (i = 1;i < cl.num_entities;i++)
+ {
+ if (cl.entities_active[i])
+ {
+ entity_t *ent = cl.entities + i;
+ ent->persistent.lerpdeltatime = 0;
+ }
+ }
+ }
}
#define SHOWNET(x) if(cl_shownet.integer==2)Con_Printf("%3i:%s(%i)\n", msg_readcount-1, x, cmd);