The Server/s I will be hosting our going to have professional Quality Connection, but most of them will be running our official stuff.
The Fans who want to run modified servers are who I am worried about, some people still try to host on Dial-Up.
The timer isn't to make things consistent, it makes players flicker less than they would otherwise.r00k wrote:the 64 can be set as a cvar i used it cause on dm3 certain areas had flashing players, increased to 64 fixed it. A timer would atleast create a base time to draw so all servers update at the same rate.
OK, if I'm getting this straight the logic seems to be:LordHavoc wrote:The timer isn't to make things consistent, it makes players flicker less than they would otherwise.r00k wrote:the 64 can be set as a cvar i used it cause on dm3 certain areas had flashing players, increased to 64 fixed it. A timer would atleast create a base time to draw so all servers update at the same rate.
Each time a trace succeeds, it renews the timer, it still does the trace even if the timer is in the future, constantly renewing it.
Code: Select all
for (i = 0; i < 4; i++)
{
end[0] = seen->v.origin[0] + offsetrandom (seen->v.mins[0], seen->v.maxs[0]);
end[1] = seen->v.origin[1] + offsetrandom (seen->v.mins[1], seen->v.maxs[1]);
end[2] = seen->v.origin[2] + offsetrandom (seen->v.mins[2], seen->v.maxs[2]);
tr = SV_ClipMoveToEntity (sv.edicts, start, vec3_origin, vec3_origin, end);
if (tr.fraction == 1)
{
seen->tracetimer = sv.time + 0.2f;
break;
}
}
return (seen->tracetimer > sv.time);
You can trace against bsp models (use SV_Move) so that a closed door blocks view, but it's slower (because it has to check for entities along the ray, not just the single world model).Team Xlink wrote:Alright I have noticed some odd things.
If I set sv_cullentities to 0 the FPS is really fast. If If I leave it at 1 or set it to 2 it is a lot slower.
So, is that supposed to happen?
Also one more thing.
Is it possible to edit this so it works on brush's as well?
Like in this Five Minute paint drawing.
There is a trade-off though as it reduces the number of entities you render, so what you lose on doing traces you can potentially gain back by rendering less. A lot of entities will actually "early-out" after only 1 or 2 traces, whereas the full 64 traces will only be performed for an entity that is occluded by geometry. In a scene with lots of entities occluded it's gonna hurt, otherwise it's probably 50/50.LordHavoc wrote:Yes fps is lower with trace culling, but how much lower depends how many traces you use (64 is way too many to justify).
Ya I see what you mean. SV_ClipMoveToEntity is the bottleneck and adding a trace timer throttles the call. The flicker is inevitable, the timer just skips the culling. I still get >50 hits on start map, zombies if facing the pillar to lava.LordHavoc wrote:The timer isn't to make things consistent, it makes players flicker less than they would otherwise.r00k wrote:the 64 can be set as a cvar i used it cause on dm3 certain areas had flashing players, increased to 64 fixed it. A timer would atleast create a base time to draw so all servers update at the same rate.
Each time a trace succeeds, it renews the timer, it still does the trace even if the timer is in the future, constantly renewing it.
It's a routine that culls more the worse your testing is - a pretty backwards scaling behaviormh wrote:For occlusion by brush models one potential approach might be to (1) only perform it on entities that pass the above test, and (2) use pre-transformed bounding boxes rather than traces for the occlusion test. It's not perfect (it won't deal with a case where a brush model has a great big hole in the middle, for example). Overall I'm of the same opinion as LH - it ain't that big a deal.
Code: Select all
qboolean SV_InvisibleToClient(edict_t *viewer, edict_t *seen)
{
//coding by LordHavoc, Spike, MH, and someone else...
trace_t tr;
vec3_t start;
vec3_t end;
extern void QMB_CullTraceHightlight (vec3_t start, vec3_t end, int color);
if (seen->v.movetype == MOVETYPE_PUSH )//dont cull doors and plats :(
{
return false;
}
if (seen->tracetimer > sv.time)
return false;
if (sv_cullentities.value == 1) //1 only check player models, 2 = check all ents
if (strcmp(pr_strings + seen->v.classname, "player"))
return false;
memset (&tr, 0, sizeof(tr));
tr.fraction = 1;
start[0] = viewer->v.origin[0];
start[1] = viewer->v.origin[1];
start[2] = viewer->v.origin[2]+viewer->v.view_ofs[2];
//aim straight at the center of "seen" from our eyes
end[0] = seen->v.origin[0];
end[1] = seen->v.origin[1];
end[2] = seen->v.origin[2];
if (SV_RecursiveHullCheck(cl.worldmodel->hulls, 0, 0, 1, start, end, &tr))
{
seen->tracetimer = sv.time + 0.2;
if (developer.value == 1)
QMB_CullTraceHightlight (start, end, 4);//Draw a RED line to the ent
return false;
}
if ((!strcmp(pr_strings + seen->v.classname, "player")) || (sv_cullentities.value > 1))
{
end[0] = seen->v.origin[0] + offsetrandom(seen->v.mins[0], seen->v.maxs[0]);
end[1] = seen->v.origin[1] + offsetrandom(seen->v.mins[1], seen->v.maxs[1]);
end[2] = seen->v.origin[2] + offsetrandom(seen->v.mins[2], seen->v.maxs[2]);
tr = SV_ClipMoveToEntity (sv.edicts, start, vec3_origin, vec3_origin, end);
if (tr.fraction == 1)// line hit the ent
{
seen->tracetimer = sv.time + 0.2;
if (developer.value == 1)
QMB_CullTraceHightlight (start, end, 12);//Draw a yellow line to the ent.
return false;
}
}
return true;
}
I was thinking of overly optimistic assumptions of FOV with also take into account that a player may turn quickly. Regardless of the FOV, anything above 180 can't happen (yes, I know about PanQuake, hehe ... I mean in practical non-fantastic reality it can't happen). Give or take some degrees of leeway to allow for turning, the player still shouldn't be able to see the 120 degrees directly behind him/her.mh wrote:One idea I had was that the client could send it's view frustum (or at least enough info to recreate it) to the server, and the server could then use that to perform culling, yeah. It would need a protocol change, and wouldn't be perfectly in sync, but you could sloppily extend it and get most of the way there.
For simplistic cases all you need is FOV and aspect ratio
The old gripe about particles is that players using r_wateralpha can see particles underwater they shouldn't know about.For particles you can group them by type (which is really just the function that generates them), compute a bbox for each type and update it as particle positions change, then cull based on that bbox. Culling at the individual particle level is overkill. Performance-wise it's faster to just draw the thing (especially Quake's little dot particles). And server-side you have no control, as soon as a rocket explosion is generated it's handed over to the client (via TE_EXPLOSION), and that's the last the server ever sees of it. You'd have to cull or whatever at generation-time, which means sniffing the server packet for svc_temp_entity messages.
If you didn't want them to go through walls on the client, another option that's probably better than culling or any other similar test is to just Mod_PointInLeaf them and set p->die to -1 as soon as they hit solid. They'll still go through doors and plats of course.