Help! Scrags dont attack

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Help! Scrags dont attack

Post 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....
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Help! Scrags dont attack

Post 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.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Post 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 :(
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Help! Scrags dont attack

Post 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.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Post 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!! ;)
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Help! Scrags dont attack

Post 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. :)
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Post 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
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Help! Scrags dont attack

Post by Spike »

world.c is indeed where the bulk of the traceline code is... :P
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Help! Scrags dont attack

Post 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.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Post 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
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Help! Scrags dont attack

Post by Spike »

r00k wrote:that or my subconscious is creating new threads to awake this forum on a daily basis :O
ooo cunning.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Post 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
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Post 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....
Post Reply