Forum

Help! Scrags dont attack

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Help! Scrags dont attack

Postby r00k » Mon Jul 08, 2013 4:52 pm

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

Re: Help! Scrags dont attack

Postby Spike » Mon Jul 08, 2013 8:04 pm

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

Re: Help! Scrags dont attack

Postby r00k » Mon Jul 08, 2013 8:39 pm

ya thats what i was diggn thru. I only changed the dclipnodes to mclipnodes for sv_move in traceline.
Reverting back didnt help :(
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Postby frag.machine » Mon Jul 08, 2013 11:08 pm

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)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Re: Help! Scrags dont attack

Postby r00k » Tue Jul 09, 2013 11:15 pm

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!! ;)
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Postby frag.machine » Wed Jul 10, 2013 1:51 am

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)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Re: Help! Scrags dont attack

Postby r00k » Wed Jul 10, 2013 3:43 pm

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

Re: Help! Scrags dont attack

Postby Spike » Wed Jul 10, 2013 6:31 pm

world.c is indeed where the bulk of the traceline code is... :P
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Help! Scrags dont attack

Postby frag.machine » Wed Jul 10, 2013 10:05 pm

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)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Re: Help! Scrags dont attack

Postby r00k » Thu Jul 11, 2013 4:54 am

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

Re: Help! Scrags dont attack

Postby Spike » Thu Jul 11, 2013 8:54 am

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

ooo cunning.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Help! Scrags dont attack

Postby r00k » Thu Jul 11, 2013 6:21 pm

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: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Re: Help! Scrags dont attack

Postby r00k » Fri Jul 12, 2013 5:11 pm

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


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest