A_SkullAttack and SKULLFLY-related issue

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

A_SkullAttack and SKULLFLY-related issue

Post by Blue Shadow »

In this file (an edited Overlord monster made by Eriance; all I did was to omit its other attacks so it's easier to test), there is a monster (Overlord) that spawns other monsters (Hade Spheres) through A_PainAttack. The spawns have the following code:
Spoiler:
The spheres' behavior consists of chasing after the targets and exploding in their faces through their (the spheres) melee state. They can also be shot to explode, as well. In addition, they sometimes, while chasing, "teleport out" and then "teleport in".

The problem: If you take a look at the code above, the spheres become unshootable and unsolid when they're at the beginning of the teleportation sequence, when they teleport in again, they become shootable and solid again. In normal circumstances that sequence cannot be interrupted, so there is no way for the spheres to roam around in a visible, unshootable and unsolid state while chasing the target. It's the same thing with their melee state; once they enter the state, they'll become invulnerable, play the sequence, become vulnerable and die (detonate). And just like with the teleportation sequence, there is no chance for the melee state sequence to be interrupted under normal circumstances, and thus you won't have roaming invulnerable spheres, naturally. However, despite that, they sometimes can "break" this and become invulnerable and/or unshootable in other situations.

Through testing and observation, I found out that they only exhibit this strange behavior while flying after being spawned by the Overlord but before exiting the "state" A_SkullAttack puts them in (note that this doesn't happen 100% of the times, but will eventually). My "theory" is that they try to execute these sequences (melee and teleportation) while in that state, but don't succeed entirely (they fail to complete the sequences fully), due to them being in that A_SkullAttack-induced state.

According to the wiki on the [wiki=Actor_flags#SKULLFLY]SKULLFLY[/wiki] flag (which is set by A_SkullAttack), a monster with this flag will not enter its pain state. Now, could the flag has something to do with that peculiar behavior seen on the hade spheres here, in the sense that it's, somehow, affecting the sphere's ability when it comes to changing their states?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: A_SkullAttack and SKULLFLY-related issue

Post by Gez »

I don't see any call to A_SkullAttack in the code you have posted...
User avatar
TheMightyHeracross
Posts: 2100
Joined: Sun Aug 18, 2013 9:41 am
Location: Philadelphia, PA

Re: A_SkullAttack and SKULLFLY-related issue

Post by TheMightyHeracross »

That's the actor shot by the A_SkullAttack.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: A_SkullAttack and SKULLFLY-related issue

Post by Gez »

[wiki]A_SkullAttack[/wiki] doesn't shoot anything, [wiki]A_PainAttack[/wiki] does. And A_PainAttack should be used with the PAF_NOSKULLATTACK flag when used to shoot monsters that do not behave like lost souls.
User avatar
TheMightyHeracross
Posts: 2100
Joined: Sun Aug 18, 2013 9:41 am
Location: Philadelphia, PA

Re: A_SkullAttack and SKULLFLY-related issue

Post by TheMightyHeracross »

Welp, I FAIL.. :lol:
Wait, there's a flag for non-soul actors??
Time to update my custom Programmer, thanks for the tip. :)
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: A_SkullAttack and SKULLFLY-related issue

Post by Blue Shadow »

Gez wrote:[wiki]A_SkullAttack[/wiki] doesn't shoot anything, [wiki]A_PainAttack[/wiki] does. And A_PainAttack should be used with the PAF_NOSKULLATTACK flag when used to shoot monsters that do not behave like lost souls.
I knew about the flag and had tested it. However, the spheres lose the ability to be "shot" at the target (since A_SkullAttack is no longer called), and instead just spawn besides their creator, which changes this particular behavior. And I'm not sure if it's desired in this instance.

And for the record, I do have a workaround for this, which seems fine. I'm just posting this here on the premise that I'm observing a strange behavior on the engine's part, and I thought it might be worth investigating by the developers.
Blzut3
 
 
Posts: 3219
Joined: Wed Nov 24, 2004 12:59 pm
Operating System Version (Optional): Kubuntu
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: A_SkullAttack and SKULLFLY-related issue

Post by Blzut3 »

Behavior seems to be correct. When A_PainAttack calls A_SkullAttack it sets SKULLFLY. This flag has a few side effects, but the one in question here is that if the velocity becomes 0 with the flag set then it will force the actor into the See state. Effectively what happens here is that when they're about to slam into the player, they can enter their melee state and become invulnerable. A tic or two later they actually hit the player and thus enter the See state invulnerable.
Post Reply

Return to “Closed Bugs [GZDoom]”