Page 1 of 1

Help! Scrags dont attack

Posted: Mon Jul 08, 2013 4:52 pm
by r00k
Oddly, I've found a bug in my engine. I know its the engine cause I am using stock progs.dat.
plus ive tested with my november version. Which i forked and added protocol 666 to.
If i load up e1m3 the scrags just hover around me and never attack. Any ideas? :(

Edit: ogres dont attack niether, though the Hell Knight and the zombies do. :roll:

Edit2: Ok something is weird. If I load, -game ITSDEMO (for example havent tried the missionpaks) and then load up
map e1m3 all the monsters act like normal :| maybe its a cfg problem....

Re: Help! Scrags dont attack

Posted: Mon Jul 08, 2013 8:04 pm
by Spike
monsters not attacking sounds like the tracelines to see if the player is actually visible are not impacting on the player. you'll see a similar effect with noclip. monsters will know to attack you but won't think they can hit you so they just run around and don't shoot.

Re: Help! Scrags dont attack

Posted: Mon Jul 08, 2013 8:39 pm
by r00k
ya thats what i was diggn thru. I only changed the dclipnodes to mclipnodes for sv_move in traceline.
Reverting back didnt help :(

Re: Help! Scrags dont attack

Posted: Mon Jul 08, 2013 11:08 pm
by frag.machine
I'd suggest to grab vanilla progs source and place a handful of dprint()'s in key points of ai.qc and combat.qc (specially FindTarget()). This may give some hint about what's wrong.

Re: Help! Scrags dont attack

Posted: Tue Jul 09, 2013 11:15 pm
by r00k
welll

Code: Select all

float (entity targ) visible =
{
	local vector	spot1, spot2;
	
	spot1 = self.origin + self.view_ofs;
	spot2 = targ.origin + targ.view_ofs;
	traceline (spot1, spot2, TRUE, self);	// see through other monsters
	
	if (trace_inopen && trace_inwater)
	{		
		return FALSE;			// sight line crossed contents
	}

	if (trace_fraction == 1)
	{
		bprint("(trace_fraction == 1)\n");
		return TRUE;
	}
	bprint("visible = FALSE\n");
	return FALSE;
};
spams both
trace_fraction == 1
visible = false
over and over when the dog is running in my face :(

thought it was the clipnodes but reverting back to normal, still nothing. ARrrrggghhh!! ;)

Re: Help! Scrags dont attack

Posted: Wed Jul 10, 2013 1:51 am
by frag.machine
If trace_fraction == 1 when sitting in front a monster then you have something really f*cked up in the engine side. :)

Re: Help! Scrags dont attack

Posted: Wed Jul 10, 2013 3:43 pm
by r00k
I think i got it fixed, someting in world.c I just copied the world.c from the stable into the beta... but that doesnt help me understand! :S

Re: Help! Scrags dont attack

Posted: Wed Jul 10, 2013 6:31 pm
by Spike
world.c is indeed where the bulk of the traceline code is... :P

Re: Help! Scrags dont attack

Posted: Wed Jul 10, 2013 10:05 pm
by frag.machine
Since apparently you isolated the problem in one single source file, applying a diff between the broken code and the working one is the next logical step to nail the bug.

Re: Help! Scrags dont attack

Posted: Thu Jul 11, 2013 4:54 am
by r00k
yes, i might be too pragmatic.
I used the november stable exe by accident.
copied over, without a total rebuild.
so i waaas getting a false positive, as th e nov exe was immune..

BUT

i have a MARCH version post 666 protocol that doesnt have the bug.

digging.


man i shouldnt drink when i work on this kinda shiznit ;)

i'm just a laymen that like to swing the axe, and sometimes my axe gets stuck in a tree-stump ;)

that or my subconscious is creating new threads to awake this forum on a daily basis :O

Re: Help! Scrags dont attack

Posted: Thu Jul 11, 2013 8:54 am
by Spike
r00k wrote:that or my subconscious is creating new threads to awake this forum on a daily basis :O
ooo cunning.

Re: Help! Scrags dont attack

Posted: Thu Jul 11, 2013 6:21 pm
by r00k
ok after copying 1 file at a time until the march version broke I tracked it down to the sv_cullentities code :/

Code: Select all

qboolean SV_InvisibleToClient(edict_t *viewer, edict_t *seen)
{
	int i;
	trace_t	tr;
    vec3_t	start;
    vec3_t	end;
	extern trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end);
	extern qboolean CL_Clip_Test(vec3_t org);
	int it;
	int vi;

	vi = (int)viewer->v.colormap - 1;

	if (seen->visibletime[vi] > sv.time)
		return false;
Oddly the "player" was constantly becoming culled. :S
Now i have to clean up all this mess i made >:#

edit:
well im baffled aas if i set (sv_cullentities 0) i still get the BUG

well im just gonna dig a hole and let the topside deal with it, :D

Re: Help! Scrags dont attack

Posted: Fri Jul 12, 2013 5:11 pm
by r00k
ok, the world is sane again.

I had a 'culled' field in the edict_t struct, which was really not required.
REmoving it, fixed the bug, and kept my hair intact. :D

Sheez! Now i can go back and play Sock's new map again....