User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
 Doomworld Forums > Classic Doom > Doom Editing > barrel explosion radius?
Author
 All times are GMT. The time now is 06:19.
Soundblock
Super-Sverre

Posts: 341
Registered: 12-08

Anyone ever calculate the exact outer limit of the barrel explosion's effective radius? I've been to http://doomwiki.org/wiki/Barrel but it doesn't go there. The number and nature of the gradients of damage as you stand closer to the erupting barrel is also of interest.

I guess I could set up a test map but I'm currently busy finale stages testing of Plasmaplant so I thought I'd just throw the quick question out there...

Dec 21 2013 07:20 #
 || Blog || PM || Post History || Add Buddy IP || Edit || Quote
RjY
anARCHy

Posts: 1025
Registered: 05-02

```code:dx = abs(thing->x - bombspot->x);
dy = abs(thing->y - bombspot->y);

dist = dx>dy ? dx : dy;
dist = (dist - thing->radius) >> FRACBITS;

if (dist < 0)
dist = 0;

if (dist >= bombdamage)
return true;    // out of range```
which means it looks at the larger of the two differences in coordinates between you and the barrel. I forget what they call this metric (supremum metric is it?) but for an "explosion radius" I think it gives you a square of side 2*bombdamage centred on the barrel.

(At least that's the ideal case. There are probably complications introduced by scanning the blockmap...)

Edit: I should say, in the case of a barrel, bombdamage is 128

Dec 21 2013 08:04 #
 || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Soundblock
Super-Sverre

Posts: 341
Registered: 12-08

RjY said:
```code:dx = abs(thing->x - bombspot->x);
dy = abs(thing->y - bombspot->y);

dist = dx>dy ? dx : dy;
dist = (dist - thing->radius) >> FRACBITS;

if (dist < 0)
dist = 0;

if (dist >= bombdamage)
return true;    // out of range```
which means it looks at the larger of the two differences in coordinates between you and the barrel. I forget what they call this metric (supremum metric is it?) but for an "explosion radius" I think it gives you a square of side 2*bombdamage centred on the barrel.

(At least that's the ideal case. There are probably complications introduced by scanning the blockmap...)

Edit: I should say, in the case of a barrel, bombdamage is 128

Texels?

Danx dyde!

Dec 21 2013 08:36 #
 || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Memfis
Honestly, semen doesn't taste that bad.

Posts: 7033
Registered: 04-07

Cybermind from the Russian forums calculated this a long time ago and somehow I still had that *.txt on my drive:

this is assuming that the player and the barrel are on the same X or Y coordinate. first number is the distance but I'm not sure if it's the distance from the center of the barrel to the center of the player or maybe the distance between their bounding boxes?

136 - 8 damage
140 - 4 damage
142 - 2 damage
143 - 1 damage
144 or more - no damage

Dec 21 2013 12:44 #
 || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Soundblock
Super-Sverre

Posts: 341
Registered: 12-08

Memfis said:
Cybermind from the Russian forums calculated this a long time ago and somehow I still had that *.txt on my drive:

this is assuming that the player and the barrel are on the same X or Y coordinate. first number is the distance but I'm not sure if it's the distance from the center of the barrel to the center of the player or maybe the distance between their bounding boxes?

136 - 8 damage
140 - 4 damage
142 - 2 damage
143 - 1 damage
144 or more - no damage

Wow, if that's true it peters out rather abruptly. I thought it might have a randomizer added on the end of that - like the weapons damage... I mean sometimes shots seem to "crit", like when you one-shot a lost soul with a singlebarrel...

EDIT: Uhm, I meant two singlebarrel shots to down a lost soul, not one. My apologies, I blame my brain being sweaty at the time, from pre-christmas level design crunch.

Last edited by Soundblock on Dec 27 2013 at 17:55

Dec 21 2013 13:05 #
 || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Gez
Why don't I have a custom title by now?!

Posts: 12398
Registered: 07-07

Basically, the maximum damage is equal to the maximum distance, which is 128 units. If you are 128 units away from the exploding barrel, you take 128-128=0 damage. 127 units away? 1 damage. 8 units away? 120 damage.

Your radius is taken into account, and a player's radius is 16. So your player's center point needs to be 128+16=144 units away to get no damage.

And the distance being computed simplistically only as the greater of the two distances on the X and Y axes means that if you are 100 units away on the X axis and 100 units away on the Y axis, you aren't further away than if you are 100 units away on either axis and 0 units away on the other, even if trigonometry would tell you that in the former case, you are actually 141 units away from the center of the explosion. So the apparent distance, depending on the angle, can be greater than the effective distance.

Note that 128 damage/128 distance means that this is identical to a rocket's splash damage. This is the standard splash damage in Doom, only the arch-vile's blast differs. The rocket does deal an additional amount of random damage, but only if you get a direct hit -- the splash damage itself is never random and depends only on the distance.

Of course, some ports allow to change that. For example, ZDoom allows to define a distance within which full damage are applied, and you can use random values for the parameters.

Dec 21 2013 14:13 #
 || Blog || PM || Post History || Add Buddy IP || Edit || Quote
purist
Senior Member

Posts: 2351
Registered: 04-04

Is the barrel's own radius taken into account and could you therefore increase the damage range of the explosion in vanilla by increasing the radius?

Dec 21 2013 15:04 #
 || Blog || PM || Post History || Add Buddy IP || Edit || Quote
 All times are GMT. The time now is 06:19.
 Doomworld Forums > Classic Doom > Doom Editing > barrel explosion radius?

Forum Rules:
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is OFF vB code is ON Smilies are OFF [IMG] code is ON