[4.2.3] Splash damage is occasionally dealt twice

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [4.2.3] Splash damage is occasionally dealt twice

Re: [4.2.3] Splash damage is occasionally dealt twice

by StroggVorbis » Tue Nov 12, 2019 9:12 am

Since this is mentioned in 4.2.4's changelog to be fixed, I guess this can be moved to Closed Bugs :)

Re: [4.2.3] Splash damage is occasionally dealt twice

by _mental_ » Sat Oct 26, 2019 10: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.

Re: [4.2.3] Splash damage is occasionally dealt twice

by Graf Zahl » Sat Oct 26, 2019 10: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.

Re: [4.2.3] Splash damage is occasionally dealt twice

by _mental_ » Sat Oct 26, 2019 9:44 am

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

Re: [4.2.3] Splash damage is occasionally dealt twice

by Graf Zahl » Sat Oct 26, 2019 9: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.

Re: [4.2.3] Splash damage is occasionally dealt twice

by _mental_ » Sat Oct 26, 2019 9: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.

Re: [4.2.3] Splash damage is occasionally dealt twice

by Graf Zahl » Sat Oct 26, 2019 9:04 am

This was an optimization made by Randi, it's definitely ZDoom-based.

Re: [4.2.3] Splash damage is occasionally dealt twice

by _mental_ » Sat Oct 26, 2019 8: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.

[4.2.3] Splash damage is occasionally dealt twice

by StroggVorbis » Mon Oct 21, 2019 4: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.


Top