Avirox's Rotation Tutorial Adapted to NetQuake
I wouldn't mind a copy of it, just to test that my fix actually does work with it, before you make any changes to your own engine.
(deleted stuff that wasn't actually needed; mental note to self: read the original code first!!! )
Also note the nifty "sv_novis" cvar.
(deleted stuff that wasn't actually needed; mental note to self: read the original code first!!! )
Also note the nifty "sv_novis" cvar.
Last edited by mh on Wed Jul 14, 2010 9:50 pm, edited 1 time in total.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
My bsp understanding is limited, but I'd guess it is probably just commenting out this in SV_WriteEntitiesToClient in sv_main.cgoldenboy wrote:That sounds like the cleanest possible solution, but it's probably above my skill level to implement that.
Code: Select all
for (i=0 ; i < ent->num_leafs ; i++)
if (pvs[ent->leafnums[i] >> 3] & (1 << (ent->leafnums[i]&7) ))
break;
if (i == ent->num_leafs)
continue; // not visible
Hmmmmh wrote:Also note the nifty "sv_novis" cvar.
The night is young. How else can I annoy the world before sunsrise? Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
It's BSP entities only isn't it, so you'd need to get the model name (something like pr_strings + ent->v.model), check if the first char is '*', then ignore the PVS test if so.
It's a solution to this problem for sure, but one I'd be dubious about as there is a possibility of alias or instanced brush models also being big enough enough to need a fix. Add enough models to the mix, take a map that's well stocked with even just inline brush models (like ne_tower for example) and you're entering a world of hurt. I just prefer the more general fix, it seems cleaner overall.
Edit: my code works with this one.
It's a solution to this problem for sure, but one I'd be dubious about as there is a possibility of alias or instanced brush models also being big enough enough to need a fix. Add enough models to the mix, take a map that's well stocked with even just inline brush models (like ne_tower for example) and you're entering a world of hurt. I just prefer the more general fix, it seems cleaner overall.
Edit: my code works with this one.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
Oddly enough, it also works perfectly with Enhanced GLQuake (aguirRe's engine) and he doesn't seem to have done anything to particularly fix this one - although I haven't looked too far yet. It does suffer from a "keyname too long" Sys_Error when parsing globals though, on account of the fact that he reduced the max key name length to 32 (from 64).
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
if (ent->v.solid == SOLID_BSP &&
(ent->v.angles[0] || ent->v.angles[1] || ent->v.angles[2]) )
{ // expand for rotation
float max, v;
int i;
max = 0;
for (i=0 ; i<3 ; i++)
{
v =fabs( ent->v.mins);
if (v > max)
max = v;
v =fabs( ent->v.maxs);
if (v > max)
max = v;
}
for (i=0 ; i<3 ; i++)
{
ent->v.absmin = ent->v.origin - max;
ent->v.absmax = ent->v.origin + max;
}
}
that code will pick the biggest axis and assume that all are that large.
On a long thin (bridge) thing, your absmin/absmax is huuuge. It also extends up and down too, by the same distance...
This is even worse if you didn't change the origin in qbsp.
This is why a func_wall is fine, but anything bsp with rotation will flicker, and also why you need so many leafs.
It really should rotate the bbox, then build a new bbox around the rotated coords instead. I wonder though, would it still be possible for an entity to exceed 16 leafs even if that was done? I had originally put my code in to fix the very same problem with an elevator in apsp1.
I wouldn't dispute that handling the bbox better is one way of fixing this specific problem (and should probably be done anyway), but I would argue that it is more of a general problem which needs more of a general solution. It's perfectly possible to construct a huuuuuge brush model that exceeds 16 leafs without even having it rotate, for example, and we haven't even touched on huge alias models yet.
I wouldn't dispute that handling the bbox better is one way of fixing this specific problem (and should probably be done anyway), but I would argue that it is more of a general problem which needs more of a general solution. It's perfectly possible to construct a huuuuuge brush model that exceeds 16 leafs without even having it rotate, for example, and we haven't even touched on huge alias models yet.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
For some odd reason i have MAX_ENT_LEAFS at 256 ?!?!
i thought it was added for something in the HL map support addition some time ago... overkill?? BTW the model's mins/max are validated in the loader code.
I've reverted to 16 leafs, and implemented MH's code for testing. (seems to work on normal maps).
@GB: do u have your rotating ent in a small 1 room map that i can test this rotation with?
i thought it was added for something in the HL map support addition some time ago... overkill?? BTW the model's mins/max are validated in the loader code.
I've reverted to 16 leafs, and implemented MH's code for testing. (seems to work on normal maps).
@GB: do u have your rotating ent in a small 1 room map that i can test this rotation with?
To get phat map capacity, take FitzQuake 0.80 and FitzQuake 0.85 and WinMerge (or whatever you prefer).r00k wrote:Cool, thanks. I would want Qrack to definitely support your mod out of the box when its available.
Metlslime documented it very well.
The night is young. How else can I annoy the world before sunsrise? Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
r00k: Like Baker said, start with phat map capacity, skyboxes, fog, alpha, support -sndspeed 44100, raise static entities limit to like 1024, raise max_channels, modify Read/WriteCoord for higher map size limit and include this rotation stuff with the smooth angles fix and the flicker fix.
RMQ's engine source is available at my blog. We declared our collection of hacks protocol 999.
We have this evil plan to add csqc support, so be warned.
RMQ's engine source is available at my blog. We declared our collection of hacks protocol 999.
We have this evil plan to add csqc support, so be warned.