Talk:Monster infighting

Cyberdemon infighting?
As I read this it would be possible to get two Cyberdemons to infight with each other if they caused each other damage with barrels.

Has anyone ever done that? 210.86.119.59 03:21, 26 Dec 2005 (UTC)
 * That would be interesting, because Cyberdemon rockets don't hurt other Cyberdemons. Fraggle 14:49, 26 Dec 2005 (UTC)
 * It's not possible since Cyberdemons are immune to all blast damage, including barrel explosions. Janizdreg 16:11, 2 Jan 2006 (UTC)

Wikipedia article on monster infighting
Assistance would be appreciated concerning the accuracy of this edit to the Wikipedia version of this article. Fredrik 10:31, 15 Jan 2006 (UTC)


 * The Lost Soul vs. Lost Soul part is correct (this phenomenon is extremely annoying to the marine, because if you're trying to conserve ammo through monster infighting, and Lost Souls are involved, you usually have to re-start the fight over and over and over and over again).


 * I am not sure that a Lost Soul fighting another monster remembers its target better &mdash; rather, the other monster will keep attacking the Lost Soul until it eventually turns away from the player again.


 * I don't believe the AI part for a minute. To use an obvious example, doesn't the Cyberdemon on MAP08: Tricks and Traps fire straight into the crowd without waiting for you to be exposed?


 * IANASCM (I am not a source code maven).   Ryan W 10:07, 16 Jan 2006 (UTC)


 * Yeah, I used the map08 example as well to motivate partially reverting the edit. Fredrik 15:46, 16 Jan 2006 (UTC)


 * I don't think it would be difficult to test my second assertion above. You'd just need to make a PWAD consisting of a single room (not too large, because you don't want the Lost Soul to wander too far away) with you, a Demon, and a Lost Soul in it.  Don't fire at anybody, and see whether or not the following sequence of events takes place:
 * Lost Soul accidentally damages the Demon.
 * Demon attacks the Lost Soul and manages to hurt it.
 * Lost Soul attacks the Demon on purpose.
 * Lost Soul then attacks the player again without having taken any additional damage from the Demon.
 * If this all happens, then what I said was correct.   Ryan W 23:04, 18 January 2006 (UTC)


 * You're not imagining this, and it's not unique to the Lost Soul either. Any monster that gets set back to its spawn state in the course of its other frame transitions will have an edge for attacking the player instead of infighting. This is because a call to A_Look will cause it to look for a new target even though it already has one, and monsters only look for players in Doom. Some Heretic monsters "suffer" the same phenomenon.--Quasar 09:08, 25 June 2006 (UTC)

Pain chance check?
The top part of this article glosses over a certain aspect of monster infighting very important in speedrunning:


 * An undamaged monster who gets hit by another monster will immediately start infighting, but a monster who has already been damaged by the player probably will not.
 * If monster A and monster B are infighting, and the player damages monster A, monster A will not necessarily stop attacking monster B right away.
 * If monster A and monster B are infighting, and monster C damages monster A, monster A will not necessarily stop attacking monster B right away.

In other words, it's not as simple as "monster targets the guy who hit him last". Now, what is necessary to get the monster to change targets? I'm not sure. I want to say it's the pain chance check, but that's just a guess, since I don't know the source code.

For example, this phenomenon is crucial to Andy Kempling's Tyson demo of MAP32: Grosse (bashing away at the Cyberdemon while he's got his back turned to blow up Nazis), and plays a lesser role in Yonatan Donner's UV -fast demo of MAP13: The Crypt (he sprays the first arachnotron with the chaingun by mistake, then has to wait for the mancubi behind it to land several blows before the arachnotron turns away).

I'm not sure how to modify the article at this point, but I thought I'd point the problem out. Ryan W 04:35, 27 January 2006 (UTC)


 * Monsters in Doom have a "threshold" that ticks down as long as they are chasing a target. When that threshold has expired, the monster may, at random, look for a new target. If the threshold is too high, monsters will tend less often to change targets even when something else hurts them. This first behavior was presumably primarily added to make cooperative more balanced; otherwise, monsters would insist on chasing the first player they see and would never change targets. Note that the reason Arch-viles switch targets instantly is precisely because they ignore and do not use the threshold value (Eternity makes this behavior into a flag so it can be given to any monster).--Quasar 09:12, 25 June 2006 (UTC)

Blur artifact effect / targets for inanimate monsters
My recent revision raises two more questions not yet addressed in this article: Ryan W 09:12, 30 January 2006 (UTC)
 * The statement about the blur artifact (which was already there) contradicts the Blur artifact article, which says that invisibility only affects the appearance of melee attacks, not their actual direction. I think this one is correct, but that's just a guess, since I don't know the source code.
 * Does Romero's head even have a target? What about Commander Keen?

Monster melee attacks cannot miss
The blur article is correct, not this one, so I have removed all information indicating that "misdirected" monster melee attacks can cause infighting. This idea is not supported by the source code.

void A_SargAttack(mobj_t *actor) {   if(!actor->target) return; A_FaceTarget(actor); if(P_CheckMeleeRange(actor)) {      int damage = ((P_Random(pr_sargattack)%10)+1)*4; P_DamageMobj(actor->target, actor, actor, damage, MOD_HIT); } }

Here is the complete source code for a demon's bite attack. The call to A_FaceTarget is where the perceived inaccuracy comes in -- when a thing's target is blurry, it will get a random amount added to its angle to make it appear confused. This would only affect a tracer attack, however. As you can see, there are no calls in this function or any of the other monster melee attack functions to P_LineAttack. Instead, a direct call is made to P_DamageMobj on the actor's target -- if called, this function cannot "miss" under any circumstance, nor can it mistakenly injure a thing nearby (there is no implicit radius of damage or anything similar -- it just subtracts a determined amount from the target's health and possibly makes the target angry).--Quasar 00:01, 16 May 2006 (UTC)


 * Marvelous. This is exactly what I was asking above.  Thank you.  (I do know a little C, but I can never find this stuff when I look at the sources.)


 * Now what about revenants, barons, knights, imps, and cacos? Also, by this definition, are charging lost souls "melee attacks"?    Ryan W 18:42, 16 May 2006 (UTC)   (EDIT: Uh, that would be where he says "or any of the other monster melee attack functions", Ry-Ry.  Try to cut down on the sugar intake before editing.)

Monsters will infight if they are caused pain, thus flinching. Monsters with low pain chance ( Cyberdemon, Spider Mastermind ) will need a very powerful attack to make them flinch. It is possable, however hard, too get certain monsters to infight themselves, though it won't nessicarily damage them, e.g. a Cyberdemon can be tricked into "Sucicide" attempts, but it is impossable to make certain creaturs kill themselves. --drake raider