Bouncing projectiles don't hurt when hitting top/bottom
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.
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.
- Marisa the Magician
- Banned User
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Bouncing projectiles don't hurt when hitting top/bottom
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.
- Marisa the Magician
- Banned User
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
Is anyone ever going to bother with this? A crapton of mods trigger this bug, you know.
- SanyaWaffles
- Posts: 842
- Joined: Thu Apr 25, 2013 12:21 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
- Graphics Processor: nVidia with Vulkan support
- Location: The Corn Fields
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
This explains the weird behavior I've been experiencing with DD2's gem bombs.
Let me see if I can reproduce it.
Let me see if I can reproduce it.
- Major Cooke
- Posts: 8208
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
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:
Or I could go the simple route and insert P_DamageMobj here:
Which one seems better? The former, I can include a boolean that disables damage as needed.
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 all
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);
//...
Code: Select all
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);
}
}
- Marisa the Magician
- Banned User
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
wouldn't calling explodemissile cause the projectile to, you know, explode, even in cases where they might still keep bouncing?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49225
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Bouncing projectiles don't hurt when hitting top/bottom
Yes. It's also not the function inflicting the damage.
- Major Cooke
- Posts: 8208
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
If neither of those are fitting solutions, what is?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49225
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Bouncing projectiles don't hurt when hitting top/bottom
That's the problem, I don't really know how to do it without causing unintended side effects.
- SanyaWaffles
- Posts: 842
- Joined: Thu Apr 25, 2013 12:21 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
- Graphics Processor: nVidia with Vulkan support
- Location: The Corn Fields
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
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.
- Major Cooke
- Posts: 8208
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
It might be worth going back to Cacodemon345's commits and finding out what he fixed.
-
- Posts: 422
- Joined: Fri Dec 22, 2017 1:53 am
- Graphics Processor: ATI/AMD (Modern GZDoom)
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
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.
-
- Posts: 422
- Joined: Fri Dec 22, 2017 1:53 am
- Graphics Processor: ATI/AMD (Modern GZDoom)
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
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.
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.
- Major Cooke
- Posts: 8208
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
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.
- SanyaWaffles
- Posts: 842
- Joined: Thu Apr 25, 2013 12:21 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
- Graphics Processor: nVidia with Vulkan support
- Location: The Corn Fields
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
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.
- Major Cooke
- Posts: 8208
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: Bouncing projectiles don't hurt when hitting top/bottom
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.
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.