A problem with "dimensionless" monsters

Archive of the old editing forum
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.
Locked
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

A problem with "dimensionless" monsters

Post by D2JK »

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?
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: A problem with "dimensionless" monsters

Post by Blue Shadow »

To get a monster back to life, there is [wiki]Thing_Raise[/wiki]. There is also [wiki=Actor_flags#ALWAYSRESPAWN]ALWAYSRESPAWN[/wiki] flag.
User avatar
XCVG
Posts: 561
Joined: Fri Aug 09, 2013 12:13 pm

Re: A problem with "dimensionless" monsters

Post by XCVG »

What does your code look like?
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: A problem with "dimensionless" monsters

Post by D2JK »

There is nothing too special in the respawning code:

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
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.
User avatar
Virtue
Posts: 919
Joined: Sun Nov 19, 2006 8:15 am
Location: Manchester UK

Re: A problem with "dimensionless" monsters

Post by Virtue »

sounds like a variation on the infamous "Ghost" bug in Doom 2 where an arch vile resurrects a crushed monster.
User avatar
Cryomundus
Posts: 497
Joined: Thu Oct 31, 2013 12:33 pm

Re: A problem with "dimensionless" monsters

Post by Cryomundus »

D2JK wrote:There is nothing too special in the respawning code:

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
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.
Saw this awhile ago, and then I completely forgot about it. WOOPS!

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.
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: A problem with "dimensionless" monsters

Post by D2JK »

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.
User avatar
edward850
Posts: 5906
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: A problem with "dimensionless" monsters

Post by edward850 »

In object is never supposed to have neither a radius nor height less than 2.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A problem with "dimensionless" monsters

Post by Graf Zahl »

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.
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: A problem with "dimensionless" monsters

Post by D2JK »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A problem with "dimensionless" monsters

Post by Graf Zahl »

I fixed the bug, btw, so it should be better in the next dev build.
User avatar
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

Post by Ed the Bat »

Graf Zahl wrote:...original radius. This must get altered somewhere and gets stuck on this alternative value.
How could that happen? My understanding was that an actor's height and radius couldn't be changed.
User avatar
edward850
Posts: 5906
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: A problem with "dimensionless" monsters

Post by edward850 »

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.
Locked

Return to “Editing (Archive)”