[Fixed] [4.2.3] Splash damage is occasionally dealt twice

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[4.2.3] Splash damage is occasionally dealt twice

Postby StroggVorbis » Mon Oct 21, 2019 5:46 pm

Steps how to reproduce:
1. Start Hexen as Fighter
2. Load MAP04 Guardian of Fire
3. Warp to coordinates X= 670, Y= -880
4. Kill the FireDemon via console (the ettins mustn't wake up!)
5. Face the chain switch
6. Give yourself grenade flechettes (give all/give artifacts)
7. Throw a flechette in such a way that it bounces off the floor first before hitting the wall
8. If after bouncing back it directly hits an ettin it may die at full health, even though they have 175 HP and flechettes only deal 128.

I recommend making a quicksave between steps 6 and 7, this can take multiple tries.

Note: I remember this already occuring in previous GZDoom versions. I'd have completely forgotten about it if it wasn't for Doomreal. The Autocannon deals 2400 damage total with the altfire, yet I managed to kill a maulotaur (3000HP) in one trigger pull.

Note 2: I enabled DamNums' Shotgun Spray option to double check and indeed it shows. Credits to Marisa Kirisame for the idea. Screenshot below.

User avatar
StroggVorbis
Donut eat me pls!
 
Joined: 08 Nov 2017
Location: Germany
Operating System: Windows Vista/7 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [4.2.3] Splash damage is occasionally dealt twice

Postby _mental_ » Sat Oct 26, 2019 9:15 am

The problem is in the way radius damage is applied.

During blockmap iteration, ettin spans two blocks when it's damaged.
Depending on randomization, it may move a bit, and when this happens, it occupies only one block.
Because of this, the same actor can be returned twice, the first one is here and the second one is here.

I'll try to check how Chocolate Hexen works in this case, but I cannot promise a quick solution.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: [4.2.3] Splash damage is occasionally dealt twice

Postby Graf Zahl » Sat Oct 26, 2019 10:04 am

This was an optimization made by Randi, it's definitely ZDoom-based.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [4.2.3] Splash damage is occasionally dealt twice

Postby _mental_ » Sat Oct 26, 2019 10:20 am

In such case, I have nothing else to propose except to remove this code.

Unrelated to screwed blockmap iteration, I have noticed that hitting ettins with flechettes does not wake them sometimes.
Honestly, I have no idea is it original behavior or another bug.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: [4.2.3] Splash damage is occasionally dealt twice

Postby Graf Zahl » Sat Oct 26, 2019 10:28 am

That code was added when the validcount variable was replaced with an array in which all already checked actors were put. The main problem I see here is that changing this can become a major performance drag because it is a fundamental optimization in performance critical code.

TBH, I think the entire algorithm needs to be changed to first collect all actors within radius and only then process the compiled list to reduce the side effects at play here. In that case it can use validcount again and completely omit the expensive checking loop. That may in some cases collect a bit more but the way this code works is essentially broken.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [4.2.3] Splash damage is occasionally dealt twice

Postby _mental_ » Sat Oct 26, 2019 10:44 am

Is it about radius attack only, or blockmap iteration in general? If the former, I guess it can be fixed like this.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: [4.2.3] Splash damage is occasionally dealt twice

Postby Graf Zahl » Sat Oct 26, 2019 11:11 am

It is about blockmap iterations in general, but I'd be careful with such a fix because the side effects of such things are to be taken seriously. For radius attacks something needs to be done immediately, though, so I'd say for now this is fine.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [4.2.3] Splash damage is occasionally dealt twice

Postby _mental_ » Sat Oct 26, 2019 11:27 am

Indeed, for iteration in general it will be rather complicated to verify. I doubt that it’s possible to do this reliably in a reasonable amount of time. Even for radius damage it’s hard to validate that something doesn’t depend on that side effect.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: [4.2.3] Splash damage is occasionally dealt twice

Postby StroggVorbis » Tue Nov 12, 2019 10:12 am

Since this is mentioned in 4.2.4's changelog to be fixed, I guess this can be moved to Closed Bugs :)
User avatar
StroggVorbis
Donut eat me pls!
 
Joined: 08 Nov 2017
Location: Germany
Operating System: Windows Vista/7 64-bit
Graphics Processor: nVidia with Vulkan support


Return to Closed Bugs

Who is online

Users browsing this forum: Ahrefs [Bot], Awario [RSS], DotBot, Trendiction.de [Bot] and 0 guests