29/05/2011 @22:11:58 ^22:57:58

Archviles and their targets

You may have noticed the following monster behaviours in Doom.

Recently in rboom I fixed the second thing, which is obviously a bug, so that the fire properly tracks the player or monster an archvile is trying to cast its spell at. But it got me thinking about the first part, about archviles instantly changing targets regardless of threshold.

It's always seemed a bit odd to me. It's certainly annoying, you have to make sure you don't disturb an archvile in mid-attack else you will get its damage full in the face with hardly any time to react. Of course the fire position bug I fixed means you sometimes don't even know you've disturbed it until the screen goes red and you suddenly lose 90-odd hit points. At least that can't happen to me any more.

Should archviles change targets at all?

Maybe the condition is exactly the wrong way round. The code says basically "change target if threshold has passed or you're an archvile". What if it said "change target if threshold has passed, unless you're an archvile"?

This makes sense to me. Consider, they're casting a complicated spell with an entire-body gesture, that submerges you in the fires of Hell and finally blows you up. This must take some concentration. The idea that they can instantly switch targets mid-spell seems to be at odds to the nature of their attack. Not to mention the image of them constantly spinning round on the spot when caught up in the middle of a large monster fight is ridiculous.

Another angle - they're demonic healers. It's well-known that an archvile's death sound is a highly distorted "why?" - they only see themselves as doing good, so they can't understand why you'd kill them. Also remember that no other demon will ever target an archvile: the code explicitly disallows it.* All in all, it's illogical that they'd go off attacking other demons if accidentally damaged by them. It'd break the demonic hippocratic oath, or something. It makes sense to me that they'd always stay intent on players, unless happening upon a deceased comrade.

Very debatable - the obvious counterargument is them changing targets instantly is how they're programmed, that's what they do, don't mess with it - but an interesting thought so I'm going to put it into rboom as an experiment. It wouldn't be the first time I found something not doing what it was obviously intended to do in Doom's source.

* Although this is probably more to do with the fact that archviles do most of their damage via the rocket explosion splash damage mechanism, so if they blew you up while you were surrounded, everything surrounding you would feel it and go off after their new "attacker".)