What shape/form is the explosion radius?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

What shape/form is the explosion radius?

Post by Amuscaria »

What form does the area of effect take in Doom's engine? Is it a sphere? Or more like the monster's radius, where it's an octagon or square, where the radius (center to a corner) and [1/2 of] height is that of the explosion radius value? Or is it a cylinder?
User avatar
InsanityBringer
Posts: 3392
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

Re: What shape/form is the explosion radius?

Post by InsanityBringer »

I think it's square -- it definitely is in Vanilla (where it's an infinitely tall pillar) and I believe this is carried over into zdoom, though the infinitely tall aspect is removed and it's turned into a proper cube.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: What shape/form is the explosion radius?

Post by Gez »

It is square.

And it is still infinitely tall if you have the [wiki=Actor_flags#OLDRADIUSDMG]OLDRADIUSDMG[/wiki] flag. The way it works is like this: if the actor is within the square radius, but outside the vertical range, it is affected nonetheless if it has this flag. So you can have a situation where you have three things aligned vertically. You shoot a rocket at the lowest one, it is affected by the explosion. The middle one is too high above to be affected. The highest one is also too high, but it has this flag so it is affected nonetheless.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: What shape/form is the explosion radius?

Post by Amuscaria »

So does the radius rotate based on how the projectile is fired? Or does it stay with the same orientation like the monster's radius (always parallel to the map grid)?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: What shape/form is the explosion radius?

Post by Gez »

It's always aligned to the grid. Rotating it would be far too fancy.

The way it works is super simple: it simply compares the bomb's and the target's X and Y coordinates. If the x distance and the y distance are both less than the explosion radius, boom, the target takes damage.

Now you know that damage decreases with distance. It looks at which distance is the greatest, X or Y, and uses this value to compute by how much the explosion damage is reduced.
Post Reply

Return to “General”