Duke4.net Forums: Weird explosion behavior - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Weird explosion behavior

User is online   Ninety-Six 

#1

I'm noticing that in recent snapshots (8865+), explosions seem to have a random chance of pushing a target forward, and then not do full damage. Most noticeable with the commanders, which half the time they survive a second rocket. Not sure if the rocket is passing through them and detonating anyway, meaning they are only dealt splash damage and not the impact damage, or if they're being dealt the impact damage but somehow being pushed away from the explosion damage.

I'm not sure but it's wonky all the same.
0

User is offline   necroslut 

#2

Maybe we're not talking about the same thing, but commanders getting pushed forward by rockets have always been a thing as I can recall... They should still take full damage though, but I haven't noticed them not doing so.
0

User is online   Ninety-Six 

#3

View Postnecroslut, on 22 April 2020 - 11:42 PM, said:

Maybe we're not talking about the same thing, but commanders getting pushed forward by rockets have always been a thing as I can recall... They should still take full damage though, but I haven't noticed them not doing so.


Yeah I've seen them get pushed forward too, but it didn't come with a damage reduction until recently. Instead of dying to the second rocket, they're left extremely weak.

This post has been edited by Ninety-Six: 23 April 2020 - 12:43 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#4

Funny you mentioned this, because I am noticing enemies getting pushed forward by rockets too, and this is in a mod where I specifically have code prevented that until recent builds. As necroslut pointed out, enemies getting pushed the wrong way by explosions is normal vanilla behavior. The actor's xvel gets set to a positive value and that makes it move towards the player (because generally it is facing the player when it is hit). What my hack does in the mod in question is reverse the xvel so the actor moves backwards instead. The fact that this is no longer working is interesting. I will put it on my list of a hundred other things to look into.
0

User is online   Ninety-Six 

#5

View PostTrooper Dan, on 25 April 2020 - 03:09 PM, said:

Funny you mentioned this, because I am noticing enemies getting pushed forward by rockets too, and this is in a mod where I specifically have code prevented that until recent builds. As necroslut pointed out, enemies getting pushed the wrong way by explosions is normal vanilla behavior. The actor's xvel gets set to a positive value and that makes it move towards the player (because generally it is facing the player when it is hit). What my hack does in the mod in question is reverse the xvel so the actor moves backwards instead. The fact that this is no longer working is interesting. I will put it on my list of a hundred other things to look into.


I wonder if it's related to the damage shenanigans I'm talking about...
0

User is offline   Danukem 

  • Duke Plus Developer

#6

View PostNinety-Six, on 25 April 2020 - 03:13 PM, said:

I wonder if it's related to the damage shenanigans I'm talking about...


Impossible to say based on current information. I have noticed a lot of instances of rockets going right through enemies, and it seems like more than usual, but that is something that did happen before so it could just be RNG or who knows what.

The most likely cause of reduced rocket damage is the rocket impacting farther away from the enemy than usual. Rockets do direct contact damage and additionally do splash damage based on distance away. Even with direct contact, that does not mean the distance is zero. The contact is with the clipping sphere of the sprite, which is some distance away from the coords of the sprite origin. I do not think that anyone would have messed with the actual damage numbers, but if clipping was changed that could easily change damage indirectly by changing the distance from the rocket when it impacts.
0

User is online   Ninety-Six 

#7

View PostTrooper Dan, on 25 April 2020 - 04:41 PM, said:

The most likely cause of reduced rocket damage is the rocket impacting farther away from the enemy than usual. Rockets do direct contact damage and additionally do splash damage based on distance away. Even with direct contact, that does not mean the distance is zero. The contact is with the clipping sphere of the sprite, which is some distance away from the coords of the sprite origin. I do not think that anyone would have messed with the actual damage numbers, but if clipping was changed that could easily change damage indirectly by changing the distance from the rocket when it impacts.


That's kind of what I was theorizing on my initial post. If the clipping has changed, that might explain both my and your issues. It goes further vanilla, and goes far enough that it maybe exceeds whatever safeguards you put in place, being based on the original clipping behavior.


It's also entirely possible that I'm talking out of my ass.
0

User is offline   Mark 

#8

.

Attached thumbnail(s)

  • Attached Image: assface.jpg

0

User is online   Ninety-Six 

#9

help ive been doxxed

This post has been edited by Ninety-Six: 25 April 2020 - 04:58 PM

1

User is online   Ninety-Six 

#10

Bump because this is still an issue. I have still been unable to figure out what triggers this behavior. It just does. It's like sometimes an enemy only takes splash damage even if it's a direct hit. And since explosions in this game push monsters towards the player, this has led to many an unfair death.
0

#11

The easiest way to analyze this in detail is probably the DAMAGESPRITE events. Though there are also issues related to explosions with them: https://voidpoint.io...32/-/issues/135

I will take a look at this in the coming days.

This post has been edited by Doom64hunter: 02 July 2021 - 05:57 AM

0

#12

View PostNinety-Six, on 22 April 2020 - 10:42 PM, said:

I'm noticing that in recent snapshots (8865+), explosions seem to have a random chance of pushing a target forward, and then not do full damage.


As mentioned, this forwards displacement has always been a part of the game.

View PostNinety-Six, on 22 April 2020 - 10:42 PM, said:

Most noticeable with the commanders, which half the time they survive a second rocket. Not sure if the rocket is passing through them and detonating anyway, meaning they are only dealt splash damage and not the impact damage, or if they're being dealt the impact damage but somehow being pushed away from the explosion damage.


Both of these cases are impossible.

1. Rockets in Duke3D do not deal impact damage if the splash damage connects. This is DOS-accurate behavior. Any and all damage from the projectile itself is completely overridden by the radius damage.
2. If somehow the radius damage did not connect, then the direct impact damage would apply. However, the impact damage of the projectile is roughly 50% higher than the radius damage itself. This means that if the radius damage did not apply, the commander would certainly be killed in 2 hits.

To hopefully lay rest to this issue, I have computed the mean and standard deviation of the radius damage of each rocket over 500 shots, once in r6775 from March 2018, and once in r9481 from July 2021.

r6775
N = 500
Mean: 200
Standard Deviation: 41


r9481
N = 500
Mean: 194
Standard Deviation: 41


The damage does not differ significantly between the two revisions. Moreover, because the commander has 350 HP, as of r9481, two shots will still kill it in expectation.

I did not examine earlier revisions because r6775 is one of the first stable revisions after the DAMAGESPRITE event was introduced. However, I'm sure this could also be computed by compiling the DOS binary with calculations made directly in the source.
1

User is online   Ninety-Six 

#13

View PostDoom64hunter, on 21 July 2021 - 08:39 AM, said:

two shots will still kill it in expectation.


My reasoning may have been incorrect, but this does not mean the issue doesn't exist. Two rockets does not always kill a commander. This is the case regardless of external cons.

This post has been edited by Ninety-Six: 21 July 2021 - 10:35 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#14

I think the fact that radius damage has priority could explain cases where commanders take 3 direct hits.

Perhaps the amount of damage varies depending on where on the clipping sphere the rocket hits. With build movement jank (both the movement of the rocket and victim) and vertical position/speed all being factors, the radius damage from direct hits could differ significantly, since even a direct hit is some distance away from the coords of the victim which is the exact center of the base of the sprite. I'm guessing that in Doom64hunter's tests he set it up so that the rockets would always hit in almost exactly the same place.
0

#15

View PostDanukem, on 21 July 2021 - 03:47 PM, said:

I think the fact that radius damage has priority could explain cases where commanders take 3 direct hits.

Perhaps the amount of damage varies depending on where on the clipping sphere the rocket hits. With build movement jank (both the movement of the rocket and victim) and vertical position/speed all being factors, the radius damage from direct hits could differ significantly, since even a direct hit is some distance away from the coords of the victim which is the exact center of the base of the sprite. I'm guessing that in Doom64hunter's tests he set it up so that the rockets would always hit in almost exactly the same place.


This is exactly the problem, but what I did wasn't what you assumed. In my tests I hit the commander pretty much anywhere on the sprite (as long as it was a direct hit).

In this regard, there is actually a major factor that can influence the damage: autoaim. eduke32's autoaim guides the rocket much weaker than that of DOS Duke3D, leading to the latter having a much more consistent damage output than the former.

To empirically show that the same thing occurs in DOS as in eduke32, I went and compiled the original Duke3D DOS source release myself, altering it such that it computes the mean and standard deviation of the blast damage when a player rocket hits a commander.

I also disabled the hardcoded autoaim for the rocket to show how much the damage can vary.

DOSBOX Duke 1.4 with Autoaim
--------------------------------
N = 500
Mean Damage = 209
Standard Deviation = 44
--------------------------------
DOSBOX Duke 1.4 without Autoaim, direct hits but aiming away from the center
--------------------------------
N = 500
mean = 186
stddev = 32
--------------------------------
eduke32 r9481, without Autoaim, aiming at bottom center of the commander sprite
--------------------------------
N = 100
mean = 245
stddev = 33
--------------------------------
DOSBOX Duke 1.4, without Autoaim, aiming at bottom center of the commander sprite
--------------------------------
N = 100
mean = 250
stddev = 22


Finally, here's how the radius damage is computed in the source code.

Duke 1.4
                        if ( d < r/3 )
                        {
                            if(hp4 == hp3) hp4++;
                            hittype[j].extra = hp3 + (TRAND%(hp4-hp3));
                        }
                        else if ( d < 2*r/3 )
                        {
                            if(hp3 == hp2) hp3++;
                            hittype[j].extra = hp2 + (TRAND%(hp3-hp2));
                        }
                        else if ( d < r )
                        {
                            if(hp2 == hp1) hp2++;
                            hittype[j].extra = hp1 + (TRAND%(hp2-hp1));
                        }


eduke32

             // this is really weird
             int const k = blastRadius/3;
             int dmgBase = 0, dmgFuzz = 1;

             if (spriteDist < k)
                 dmgBase = dmg3, dmgFuzz = dmg4;
             else if (spriteDist < k*2)
                 dmgBase = dmg2, dmgFuzz = dmg3;
             else if (spriteDist < blastRadius)
                 dmgBase = dmg1, dmgFuzz = dmg2;

             if (dmgBase == dmgFuzz)
                 ++dmgFuzz;

             dmgActor.extra = dmgBase + (krand()%(dmgFuzz-dmgBase));



Substitute the variable names, transform the structure, and you'll see that this is exactly the same algorithm.
Edit: Since instead of being continuous, this damage is actually computed in 3 deterministic steps with some randomness applied, we could go even further and count in which ranges which damage triggers.

This post has been edited by Doom64hunter: 22 July 2021 - 12:08 AM

0

User is online   Ninety-Six 

#16

I use autoaim, though. In my experience it reduces how often projectiles either go through the enemy or hit them without actually damaging them. Hit detection was never great as-is even with that helping hand. Until and if there's some kind of massive overhaul of the hit detection (which I know was a problem since the dos days), I don't really intend to turn it off.

I've also never had this problem with the commanders in DOS before, nor in eduke until the revisions that prompted this topic in the first place.

This post has been edited by Ninety-Six: 22 July 2021 - 12:16 AM

0

#17

View PostNinety-Six, on 22 July 2021 - 12:05 AM, said:

I use autoaim, though. In my experience it reduces how often projectiles either go through the enemy or hit them without actually damaging them. Hit detection was never great as-is even with that helping hand. Until there's some kind of massive overhaul of the hit detection (which I know was a problem since the dos days), I don't really intend to turn it off.

I've also never had this problem with the commanders in DOS before, nor in eduke until the revisions that prompted this topic in the first place.


The autoaim in DOS is more aggressive than in eduke32. Unless the distance calculation was changed (which I doubt, since I saw the same location-based variance in DOS as in eduke32) I think this really just amounts to the rocket not hitting the commander in the optimal place and having a low damage roll.
0

User is online   Ninety-Six 

#18

View PostDoom64hunter, on 22 July 2021 - 12:43 AM, said:

I think this really just amounts to the rocket not hitting the commander in the optimal place and having a low damage roll.


So why is it only recently? I didn't have this issue on revisions in, say, the 6XXX or 7XXX families.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options