Quasar
Moderator

Posts: 4613
Registered: 08-00 |
printz said:
As you may know, if you make a Dehacked modification to cause an attacking object to just disappear without dying, the monsters it had angered will switch target to someone undefined, probably one of their neighbours. You can try this by making projectiles shoot other projectiles that'll hit enemies, or try the MBF Mushroom explosion. Some times I believe I saw monsters attacking the ceiling, especially in vanilla Doom.
What I'm gonna ask is this:
- is this phenomenon safe? Or may it corrupt the Doom system?
- is the result (chosen target) different between Doom, Boom and Eternity (which transitioned actors from structs to classes)?
- Did ZDoom fix it? If so, how can I emulate it?
They don't actually attack something undefined; they are still attacking the removed monster.
Answers:
- It is safe in BOOM-based engines (and in ZDoom) due to a reference counting system, which will ensure that "mobj" structures (aka actors) are not freed until they are unreferenced. It was NOT safe in vanilla DOOM, and could crash the game in some circumstances.
- BOOM and Eternity have identical behavior in this regard.
- Last time I tested, ZDoom still shared the same behavior. That was well before they changed to a garbage collector, however, so I'm not confident of that now. If it doesn't work that way, then the only way to emulate would be to make the monster really become invisible, invincible, intangible, and glued to the roof, yet not ignored by enemies, instead of being freed. It might be difficult but I'm sure there's a flag combo that can achieve it in ZDoom.
|