A problem with "dimensionless" monsters
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
A problem with "dimensionless" monsters
Hello,
I need some help fixing an annoying problem with a monster I've made to respawn after being dead for a while.The problem is that sometimes this respawned monster begins walking through walls, while being almost unshootable. It can only be hit with radius damage and very well aimed projectile hits (which must pass through the center of the actor). I've had this problem for a long time, but I only now figured the cause could be its radius and height being set to zero by the game (perhaps the spawn shot was too crowded at the time?). I was assuming this because hitscan attacks are dimensionless as well, while projectiles are not, having their own radius and height, and therefore should register a hit regardless if they pass close enough through the actor's center.
So I made a test by deliberately setting the monster to have zero height and radius, and as expected, it became almost unshootable (like described above) and started walking through walls as well.
Any suggestions on how to get this sorted out? Apparently changing radius and height after spawning isn't possible at this time, at least. If the problem is the spawn spot being too crowded, then is there a way to delay the respawning until there's enough room for the monster to spawn? Anything else I could try?
I need some help fixing an annoying problem with a monster I've made to respawn after being dead for a while.The problem is that sometimes this respawned monster begins walking through walls, while being almost unshootable. It can only be hit with radius damage and very well aimed projectile hits (which must pass through the center of the actor). I've had this problem for a long time, but I only now figured the cause could be its radius and height being set to zero by the game (perhaps the spawn shot was too crowded at the time?). I was assuming this because hitscan attacks are dimensionless as well, while projectiles are not, having their own radius and height, and therefore should register a hit regardless if they pass close enough through the actor's center.
So I made a test by deliberately setting the monster to have zero height and radius, and as expected, it became almost unshootable (like described above) and started walking through walls as well.
Any suggestions on how to get this sorted out? Apparently changing radius and height after spawning isn't possible at this time, at least. If the problem is the spawn spot being too crowded, then is there a way to delay the respawning until there's enough room for the monster to spawn? Anything else I could try?
-
Blue Shadow
- Posts: 5046
- Joined: Sun Nov 14, 2010 12:59 am
Re: A problem with "dimensionless" monsters
To get a monster back to life, there is [wiki]Thing_Raise[/wiki]. There is also [wiki=Actor_flags#ALWAYSRESPAWN]ALWAYSRESPAWN[/wiki] flag.
Re: A problem with "dimensionless" monsters
What does your code look like?
Re: A problem with "dimensionless" monsters
There is nothing too special in the respawning code:
Anyway, I'm 99% sure I could fix this particular problem (nearly incorporeal monsters) by being able to reset the monster radius and height some time after it has respawned, whether it would lead to new bugs or not. But currently, there seems to be no way to even try this.
As for the "Wait" keyword: someone suggested this in the past; it was supposed to delay the respawning until there is enough room. But apparently doing so hasn't prevented this bug from occurring.
Code: Select all
Death: MUMM I 4 A_ScreamAndUnblock
MUMM J 4 A_SpawnItemEx("MummySoul", 0, 0, 10, 0, 0, 1)
MUMM KLMNO 4
MUMM P 4000
Respawning: MUMM P 1 A_FadeOut(.01, FALSE)
MUMM P 0 A_JumpIf(alpha > 0, "Respawning")
MUMM P 1 A_Respawn
Wait
As for the "Wait" keyword: someone suggested this in the past; it was supposed to delay the respawning until there is enough room. But apparently doing so hasn't prevented this bug from occurring.
Re: A problem with "dimensionless" monsters
sounds like a variation on the infamous "Ghost" bug in Doom 2 where an arch vile resurrects a crushed monster.
- Cryomundus
- Posts: 497
- Joined: Thu Oct 31, 2013 12:33 pm
Re: A problem with "dimensionless" monsters
Saw this awhile ago, and then I completely forgot about it. WOOPS!D2JK wrote:There is nothing too special in the respawning code:Anyway, I'm 99% sure I could fix this particular problem (nearly incorporeal monsters) by being able to reset the monster radius and height some time after it has respawned, whether it would lead to new bugs or not. But currently, there seems to be no way to even try this.Code: Select all
Death: MUMM I 4 A_ScreamAndUnblock MUMM J 4 A_SpawnItemEx("MummySoul", 0, 0, 10, 0, 0, 1) MUMM KLMNO 4 MUMM P 4000 Respawning: MUMM P 1 A_FadeOut(.01, FALSE) MUMM P 0 A_JumpIf(alpha > 0, "Respawning") MUMM P 1 A_Respawn Wait
As for the "Wait" keyword: someone suggested this in the past; it was supposed to delay the respawning until there is enough room. But apparently doing so hasn't prevented this bug from occurring.
Anywho, the problem is the A_ScreamAndUnblock, which essentially results in a monster with no collision. And since I take it that you never set set the SOLID state back to true, you've got an ghost monster.
I think you've got to set a +SOLID somewhere in the see state for it to gain collision again. Or maybe it's something like a true/false flag? Someone correct me on this, I forgot what you need to state exactly.
Basically, the A_ScreamAndUnblock is what's causing your mummy to walk through walls and be impossible to shoot.
Re: A problem with "dimensionless" monsters
Hmm, the thing is: most of the respawned mummies work just fine, and only a few of them may become ghost-like. If this was a problem like you said, wouldn't each and every one of the respawned mummies become ghost-like?
Besides, I think the A_ScreamAndUnblock wiki page suggests that using it replaces A_Scream + A_NoBlocking with an identical functionality. And finally, A_Respawn is supposed to reset most properties and flags of the actor. At least this is my understanding. But I actually have tried manually enabling the SOLID flag (and a few others too) in the Spawn state using A_ChangeFlag, but it didn't seem to fix the problem. So I'm still suspecting the radius and height properties having been set too low (0 or 1) upon the respawn.
Besides, I think the A_ScreamAndUnblock wiki page suggests that using it replaces A_Scream + A_NoBlocking with an identical functionality. And finally, A_Respawn is supposed to reset most properties and flags of the actor. At least this is my understanding. But I actually have tried manually enabling the SOLID flag (and a few others too) in the Spawn state using A_ChangeFlag, but it didn't seem to fix the problem. So I'm still suspecting the radius and height properties having been set too low (0 or 1) upon the respawn.
Re: A problem with "dimensionless" monsters
In object is never supposed to have neither a radius nor height less than 2.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A problem with "dimensionless" monsters
Please disregard Cryomundus's post, it's all wrong. A_Respawn is supposed to reset everything, but it turns out it resets everything EXCEPT the actor's original radius. This must get altered somewhere and gets stuck on this alternative value.
Just one question: A_Respawn teleports the actor back to its spawn position. Is that desired? Otherwise Thing_Raise may indeed be a better option.
Just one question: A_Respawn teleports the actor back to its spawn position. Is that desired? Otherwise Thing_Raise may indeed be a better option.
Re: A problem with "dimensionless" monsters
To me, it doesn't matter much whether the actor teleports back or respawns in place (I only slightly prefer the former); the idea is to constantly have monsters to shoot at, while you navigate towards the map exit (revisited areas won't be clear of monsters). Tougher monsters take longer to respawn than the weak ones.
The fact that this is challenging is intentional, but monsters ambushing you through walls while being much more difficult to damage, is going a bit too far.
The fact that this is challenging is intentional, but monsters ambushing you through walls while being much more difficult to damage, is going a bit too far.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A problem with "dimensionless" monsters
I fixed the bug, btw, so it should be better in the next dev build.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: A problem with "dimensionless" monsters
How could that happen? My understanding was that an actor's height and radius couldn't be changed.Graf Zahl wrote:...original radius. This must get altered somewhere and gets stuck on this alternative value.
Re: A problem with "dimensionless" monsters
It can change, it just can't change arbitrarily (as there's no way to push an actor into safe bounds once it happens). I believe crushing is one function that does.
