Rare case of missiles not going through portals

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
User avatar
Fishytza
Posts: 781
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference
Contact:

Rare case of missiles not going through portals

Post by Fishytza »

Tested with GZDoom 3.1.0 and GZDoom g3.2pre-43-g78061f1

While working with line portals, I have noticed a rare situation in which when a monster attacks while being very close to a portal the launched missile fails to pass through said portal, instead it goes behind the portal line.

EDIT: Attachment removed.

In this test map there is a modified cacodemon placed close enough to a portal line for this effect to occur. The caco is stationary and will spam its attack animation. The fireballs are completely harmless.

Load the map and the caco will instantly see you and begin 'attacking'. You should hear fireballs being created and then destroyed yet it looks like no fireballs are being created. Strafe left or right and the fireballs should come towards you now.
Or shoot the test caco once or twice. This should push it back just enough for its fireballs to actually cross the portal line (instead of being spawned behind the line, which I think is what's going on here).
Last edited by Fishytza on Fri Jun 09, 2017 3:29 pm, edited 1 time in total.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Rare case of missiles not going through portals

Post by Rachael »

I am not entirely sure this can be fixed, but Graf may have ideas on how to work around this from the engine side.

It sounds like what is happening is the missiles are being spawned past the portal line, which simply cannot be accounted for very easily since missiles are spawned at an offset, anyhow.

If Graf says this cannot be fixed, you might be able to work around it the following way: Use a sector teleport (Duke Nukem 3D style) so that anything that appears in the offending sector appears instead where it is supposed to. This can be done with a combination of SecActEnter with flags +DORMANT +AMBUSH assigned to it, and a TeleportInSector special assigned to it, with a matching TeleportDestination where the projectiles are supposed to go. Unfortunately, this trick will only work if the portal's exit is the same facing as the portal, itself.

I am not sure how viable this solution is - but it's better than nothing at all, if you absolutely need projectile-flinging monsters near portal lines.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Rare case of missiles not going through portals

Post by Graf Zahl »

Normally the case of a displacement for a spawn reaching through a portal should work. I will have to run some tests later.
User avatar
Fishytza
Posts: 781
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference
Contact:

Re: Rare case of missiles not going through portals

Post by Fishytza »

Thanks for the tip, Rachael!

No, it's not exactly important if I have monsters near the portal lines. This was just a little quirk that happened to me at least 3 times so I decided to report it.

I just tested, this also happens from the player's side, too. If you have a missile shooting gun such as the Rocket Launcher and stand just close enough to the portal, the rockets will spawn behind the portal line instead of going through the portal. Just to let you know this issue isn't exclusive to monsters.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Rare case of missiles not going through portals

Post by Graf Zahl »

Fixed. There was a small but critical error that moved the projectile past the portal in a way that just skipped the handling.
User avatar
Fishytza
Posts: 781
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference
Contact:

Re: Rare case of missiles not going through portals

Post by Fishytza »

Took a quick look at the fix: https://github.com/coelckers/gzdoom/com ... 67712R6761

Shouldn't this temporarily clear MF2_PCROSS as well? I reckon P_TryMove checks both MF2_MCROSS and MF2_PCROSS.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Rare case of missiles not going through portals

Post by Graf Zahl »

Damnit, I mixed up the two flags. It needed to clear PCROSS but you are right, both are better.
Post Reply

Return to “Closed Bugs [GZDoom]”