[Fixed] Bouncing projectiles don't hurt when hitting top/bottom

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Bouncing projectiles don't hurt when hitting top/bottom

Postby Marisa Kirisame » Wed Oct 09, 2019 7:07 am

Bouncing projectiles explode/die as expected, but don't deal damage to the actor they hit. Linked here is an example to show this behaviour. I'd check if the bug happens on 4.2.1 but I can no longer compile it due to glibc updates and versioned symbol nonsense.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Marisa Kirisame » Fri Mar 06, 2020 1:20 am

Is anyone ever going to bother with this? A crapton of mods trigger this bug, you know.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby SanyaWaffles » Fri Mar 06, 2020 5:48 am

This explains the weird behavior I've been experiencing with DD2's gem bombs.

Let me see if I can reproduce it.
User avatar
SanyaWaffles
Navy Did Nothing Wrong
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Major Cooke » Mon Mar 09, 2020 4:33 pm

There's a couple ways this could be fixed.

I could either move the P_DamageMobj call into P_ExplodeMissile that's found in PIT_CheckThing (p_map.cpp line 1565), ensuring P_ExplodeMissile accurately handles all future impact damage appropriately:
Code: Select allExpand view
damage = tm.thing->GetMissileDamage((tm.thing->flags4 & MF4_STRIFEDAMAGE) ? 3 : 7, 1);
if ((damage > 0) || (tm.thing->flags6 & MF6_FORCEPAIN) || (tm.thing->flags7 & MF7_CAUSEPAIN))
{
   int newdam = P_DamageMobj(thing, tm.thing, tm.thing->target, damage, tm.thing->DamageType);
   //...


Or I could go the simple route and insert P_DamageMobj here:

Code: Select allExpand view
if (Vel.Z != 0 && (BounceFlags & BOUNCE_Actors))
{
   bool res = P_BounceActor(this, onmo, true);
   // If the bouncer is a missile and has hit the other actor it needs to be exploded here
   // to be in line with the case when an actor's side is hit.
   if (!res && (flags & MF_MISSILE))
   {
      P_ExplodeMissile(this, nullptr, onmo);
   }
}


Which one seems better? The former, I can include a boolean that disables damage as needed.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Marisa Kirisame » Tue Mar 10, 2020 3:40 am

wouldn't calling explodemissile cause the projectile to, you know, explode, even in cases where they might still keep bouncing?
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Graf Zahl » Tue Mar 10, 2020 3:42 am

Yes. It's also not the function inflicting the damage.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Major Cooke » Tue Mar 10, 2020 7:30 am

If neither of those are fitting solutions, what is?
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Graf Zahl » Tue Mar 10, 2020 7:36 am

That's the problem, I don't really know how to do it without causing unintended side effects.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby SanyaWaffles » Wed Mar 18, 2020 2:46 pm

This is becoming extremely noticeable at times in my project. You can hit an enemy square on the top and there's no damage or whatever when using bouncing bombs. It's an extremely aggravating bug and there's no way to fix.
User avatar
SanyaWaffles
Navy Did Nothing Wrong
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Major Cooke » Wed Mar 18, 2020 4:41 pm

It might be worth going back to Cacodemon345's commits and finding out what he fixed.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Cacodemon345 » Fri Apr 03, 2020 2:46 am

All I fixed is the missile not entering bouncing state when hit from top. I don't really believe it could cause any possible side-effects.
Cacodemon345
 
Joined: 22 Dec 2017
Discord: Cacodemon345#9151
Github ID: Cacodemon345
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Cacodemon345 » Fri Apr 03, 2020 11:55 am

Now that I look into the source code, P_XYMovement function calls P_BounceActor with "ontop = false" in two places. The only function where I found that function called with "ontop = true" is the main Actor Tick function.

When I used a breakpoint in line 1483 of p_map, I found that the code in PIT_CheckThing only reaches there with the non-bouncing projectile, it does not even reach there with the bouncing project when I used Marisa's bug reproduction example. When that happens, P_BounceActor is called with "ontop = true".

This means that there HAS to be some place in the code which uses the Actor Bounce flag to change something that causes that portion of PIT_CheckThing to be unreachable.

Edit: further testing reveals a oddity: CanCollideWith() is called more than once for the non-bouncing projectile when it does not actually hit, but is only called once when the bouncing projectile actually hits the monster.
Cacodemon345
 
Joined: 22 Dec 2017
Discord: Cacodemon345#9151
Github ID: Cacodemon345
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Major Cooke » Tue Apr 07, 2020 6:17 pm

I'm going to merge in this PR into QZDoom if no one has any qualms about it, since I very much am finding myself in need of it.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby SanyaWaffles » Tue Apr 07, 2020 11:30 pm

If you do Cooke, when can you expect a build? This has been messing with one of my projects and I very much wish to test it out. I normally don't use qzdoom so I have no idea how frequently it gets updated. I also worry about it being out of date with recent GZDoom features.
User avatar
SanyaWaffles
Navy Did Nothing Wrong
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Bouncing projectiles don't hurt when hitting top/bottom

Postby Major Cooke » Wed Apr 08, 2020 9:09 am

I've merged it. It'll become available whenever the next build is scheduled, which is usually daily. The release times can be seen here.

Don't be, I usually keep it up to date whenever it's needed. I have contributor access to the repository so I can keep it up to date.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Next

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 2 guests