What shape/form is the explosion radius?
What shape/form is the explosion radius?
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?
			
			
									
						
										
						- InsanityBringer
- Posts: 3392
- Joined: Thu Jul 05, 2007 4:53 pm
- Location: opening the forbidden box
Re: What shape/form is the explosion radius?
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.
			
			
									
						
										
						Re: What shape/form is the explosion radius?
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.
			
			
									
						
										
						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.
Re: What shape/form is the explosion radius?
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)?
			
			
									
						
										
						Re: What shape/form is the explosion radius?
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.
			
			
									
						
										
						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.


