#101 posted by yhe1 on 2019/12/06 04:36:56
Can you do an experiment? Can a fiend fight back against Faust?
#102 posted by yhe1 on 2019/12/06 08:41:02
Can a Scrag fight back against a Faust?
Lame
#103 posted by madfox on 2019/12/06 11:08:13
You could have searched that out in the dev pack.
Faust will fight a wizard, mongrunt,enforcer, army and stratos but they won't respond.
Faust will fight a demon and ogre and they will fight back.
It looks as if most monsters become astrayed when attacked by Faust.
#104 posted by yhe1 on 2019/12/06 18:32:00
What about a quake dog? Will that fight the faust?
#105 posted by yhe1 on 2019/12/06 18:39:51
I know that the chasm spider also has this issue, where is that code from, a quake fiend?
#106 posted by madfox on 2019/12/06 18:50:12
When I started coding the Chasm entities I assumed they were alert enough to fight the player. The idea they would fight eachother wasn't in my viewpoint.
The spider code is the same as the rottweiler without the jump code. It will attack other chasm monsters.
#107 posted by yhe1 on 2019/12/06 18:51:42
Also check the mincer
#108 posted by yhe1 on 2019/12/06 18:53:03
Can you test chasm spider vs quake grunt?
#109 posted by madfox on 2019/12/06 20:14:50
The map starts with a grunt and a spider. It isn't that hard to check.
For clearance, quake sodier is monster_army, chasm soldier is monster_mongrunt.
#110 posted by yhe1 on 2019/12/06 20:16:29
I remember army becoming lame after being attacked by a chasm spider, is this true for you?
Hmm...
#111 posted by Qmaster on 2019/12/06 21:17:57
I never had trouble with infighting since I used AD's classtype system, but the magic should happen within T_Damage...usually located in combat.qc or foght.qc depending on the mod's organization.
Lemme take a look at your dev2.09...be a bit
#112 posted by Qmaster on 2019/12/06 21:20:24
Bah! It's all pak'ed up. Do you have just the qc files available separately not in a Pak file? I can't open the pak on mobile.
I'm needing to check combat.qc, ai.qc, and monsters.qc and maybe fight.qc.
@master
#113 posted by madfox on 2019/12/06 22:15:59
Here is the chasm_quakeqc_dev2.09.zip.
It's also in the included progs file in the pak.
And yes, my Army soldier has no attack against spider.
I changed the fight.qc with the same kind of attacks like the army soldier. So the cause must be there somewhere.
A Few Things To Check
#114 posted by Qmaster on 2019/12/06 22:20:36
For infighting to work make sure that all the new monsters have monster flag FL_MONSTER.
This is the bit in T_Damage:
if ( ((self.flags & FL_MONSTER) && (attacker != world)) ) {
if ( ((self != attacker) && (attacker != self.enemy)) ) {
if ( ((self.classname != attacker.classname) || (self.classname == "monster_army")) ) {
if ( (self.enemy.classname == "player") ) {
self.oldenemy = self.enemy;
}
self.enemy = attacker;
FoundTarget ();
}
}
}
Check to make sure your enemies are actually different classnames.
So for instance for this entity
void monster_chasmthing = { .....
the classname is monster_chasmthing
Two monster_chasmthings won't fight unless you want them too in which case remove the check for if the classnames are the same.
#115 posted by Qmaster on 2019/12/06 22:21:26
Ah hang on, was typing that before you sent the link, let me look at your source.
Hrmm
#116 posted by Qmaster on 2019/12/06 22:34:54
It all looks good so far. Not seeing anything obvious. FL_MONSTER is getting set in monsters.qc, you aren't doing any weird classname masking, it's a simple classname check too so nothing fancy there in T_Damage in combat.qc, and the enemies you've mentioned all have a walkmonster_start.
Not sure yet...maybe because in ai.qc inside the CheckAnyAttack function you only ever assign the basic CheckAttack? Try adding in your specialized CheckAttacks for the new monsters?
#117 posted by yhe1 on 2019/12/06 23:56:04
Currently, this issue affects three monsters, spider, mong, and faust. Still need to check whether alien warrior will fight back after being hit by mincer and fiend.
#118 posted by yhe1 on 2019/12/06 23:59:24
Part of the infighting code works, when a enforcer is hit by a mong, it will turn around and run towards the mong, but it will never fire it weapon. So I guess the more accurate question is: what causes the enforcer to just run in infighting?
#119 posted by yhe1 on 2019/12/07 00:00:34
All of the monsters that do not respond have ranged attacks, so maybe that has something to do with it as well.
#120 posted by yhe1 on 2019/12/07 04:40:18
Just checked, mincer has this bug also
#121 posted by Qmaster on 2019/12/07 14:23:22
Mincer doesn't fire its long range attacks because in progs.src you are compiling mincer.qc and it only has melee. Maybe change to use mincer1.qc since it has a th_missile attack.
Not seeing any reason why the enemies won't shoot back...won't be back home for a couple days so I can't test it myself.
Are the following true??:
Enemy hit by spider will not change enemy
Enemy hit by mong will not change enemy
Enemy hit by faust will not change enemy
Or only enemy with ranged attack hit by spider/mong/faust will not change enemy?
Enforcer hit by spider will change enemy but not attack ever
Enforcer hit by mong will change enemy but not attack ever
Enforcer hit by faust will change enemy but not attack ever
mincer is same as enforcer?
Or Enforcer hit by mincer will change enemy but not attack
Also...
#122 posted by Qmaster on 2019/12/07 14:25:37
Most of the special CheckAttack functions in fight.qc don't ever get used anywhere and all the new enemies default to the basic CheckAttack()...FYI in case their behaviour isn't quite like it should be.
Solution Re: Lack Of Infighting
#123 posted by iw on 2019/12/07 16:21:18
Qmaster's post #116 piqued my curiosity because he already looked at, and ruled out, the sorts of problems I would have expected this to be.
I took a look at the code, and the problem is that the new monsters have unusual-sized bounding boxes.
The CheckAttack function (in fight.qc) contains a test where it does a traceline from the attacker's view_ofs to the target's view_ofs. If the traceline doesn't hit the target, the function returns FALSE and the attacker won't launch an attack:
spot1 = self.origin + self.view_ofs;
spot2 = targ.origin + targ.view_ofs;
traceline (spot1, spot2, FALSE, self);
if (trace_ent != targ)
return FALSE; // don't have a clear shot
There's a similar test in e.g. SoldierCheckAttack() etc.
A monster's view_ofs represents its eye level, and is set in walkmonster/flymonster/swimmonster_start_go(). Walking and flying monsters have it at 25 units above their origin, while swimming monsters have it at 10 units above.
The problem with e.g. the Scorpion, Stratos, and Faust is that their bounding boxes are very "short", and don't extend 25 units above their origin. So their view_ofs ends up outside their bounding box. Consequently, when *CheckAttack() aims a trace at the view_ofs, it doesn't collide with the bounding box, and the check fails.
This can be solved by using regular-sized bounding boxes for the new monsters. For a player-sized bbox:
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
... or for a shambler-sized bbox:
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
Alternatively, you could modify the *monster_start() functions to allow you to specify a custom view_ofs. That way you could keep the current bbox sizes. However, I'm not sure that would be a good idea. I've seen other issues in the past involving moving entities with weird-sized bboxes. It seems less problematic to just stick to player- or shambler-sized bboxes; that way, there's no risk of violating assumptions made by existing code (or the engine).
#124 posted by Qmaster on 2019/12/07 23:21:39
Dah, that makes sense. For collisions against the world the nearest sized hull is used but for raycasts the actual setsize specified at whatever size is used (might be a limit, not sure). So shooting or sight checks would fail, but collisions for moving stay the same (unless using DarkPlaces hacks but those are horribly buggy).
#125 posted by yhe1 on 2019/12/07 23:53:43
Chasm contains three boss monsters bigger than Shamblers, will this become an issue once again?
|