The shape of fireball in 5-foot squares

area-of-effectbattle-mapdnd-5etools

The DMG provides this rule for areas of effect on a grid (p. 251):

AREAS OF EFFECT
The area of effect of a spell, monster ability, or other
feature must be translated onto squares or hexes to
determine which potential targets are in the area and
which aren't.
Choose an intersection of squares or hexes as the
point of origin of an area of effect, then follow its rules
as normal. If an area of effect is circular and covers at
least half a square, it affects that square
.

At floor level the correct template for fireball looks like this:

Correct fireball damage template for 5e

But fireball is a 3D effect. What would this template look like 5 feet up, 10 feet up, 15 feet up from the center?

Best Answer

Airburst templates for a 20' burst

For a 20' burst, this is what it would look like on the ground if you burst at 15' (red), 10' (orange), or 0-5' (yellow; airbursting at 5' is the same as bursting at 0').

Fireball floor diagrams at variable burst heights

Calculating the floor-level radius

The DMG guidance is, like many things in D&D, focused on two dimensions: it's talking about circles rather than spheres ("if an area of effect is circular and covers at least half a square, it affects that square"). You could calculate things based on a spherical burst and covering at least half of a cube, but that makes the math more complicated (and arguably goes against RAW) so I'll assume that the goal here is to get ground-based affected areas.

Hitting a character on the ground cares about the radius at ground level, per the DMG. You can calculate the floor-level circle's radius (r') with the radius of the initial burst (r, 20' in this case) and the height of the airburst (h). Viewed from the side (brown is ground):

Side view of a fireball at a 10' burst height

This gives us a right triangle, for which we can solve for the ground-imposed radius via

$$ h^2 + r'^2 = r^2\\ r' = \sqrt{r^2 - h^2} $$

Radius Airburst height Ground radius
40' 5' 39.7'
40' 10' 38.7'
40' 15' 37.7'
40' 20' 34.6'
40' 25' 31.2'
40' 30' 26.5'
40' 35' 19.4'
20' 5' 19.4'
20' 10' 17.3'
20' 15' 13.2'

Determining affected squares (the quick way)

If the center of a square is in the radius, generally at least half of the square will be in the radius. You can calculate the center of a square by adding 2.5' to the corner-to-nearest-corner distance, so if we have Purple and Blue as potential targets of a 20' burst, airbursted at 10' for a 17.3' ground radius:

Two characters bordering a burst

Purple is over two and up one, so their center is at [10 + 2.5, 5 + 2.5]. Blue is over three and up zero, so their center is at [15 + 2.5, 0 + 2.5]. Their distances from the center can be calculated with the quadratic formula:

$$ purpleDistance = \sqrt{12.5^2+7.5^2} \approx 14.6\\ blueDistance = \sqrt{17.5^2+2.5^2} \approx 17.7 $$

Purple's center is in the radius so they are affected; blue's center is not so they aren't. As I noted, this is only generally true. The edgecases are pretty rare, but they are possible: airbursting a fireball at 15.5' has edge squares where the center of the square is in the radius, but less than half of the square is covered by the effect. To calculate that, you can integrate along the circle (which also is easier for prefab templates; WolframAlpha will do the heavy lifting for you).

Determining affected squares (the accurate way)

Now that you have some circles of non-standard sizes, you need to calculate which squares actually get included. Take a burst, viewed from above, with doubt for some of the periphery squares, namely the red one up top (this is just a 20' ground radius), treating the center of the burst as \$x = y = 0\$:

Diagrammed top-down view of a fireball

To calculate the area of a vertical slice of the top half of a circle of radius \$r\$ centered at \$[0, 0]\$, covering \$x \$ coordinates \$[a, b]\$, you can use the following formula:

$$\int_a^b r * sin(acos(x/r)$$

For example, for a circle of radius 20, the top semicircle is

$$\int_{-20}^{20} 20 * sin(acos(x/20) \approx 628.32$$

The full area of a circle that size is ~1256.64, or double what we calculated for the semicircle, as expected. What we're really looking for here is just the "extra" bit on a vertical strip: the last square (the red part). This formula gets more complicated for certain parts, but it works for the squares you're looking for, since the circle intersects both vertical edges of a single square.

For those specific edge squares, we're working with

$$\int_{5}^{10} 20 * sin(acos(x/20) \approx 92.37$$

We then need to subtract out the three full squares (5' x 15' = 75 sqft, the yellow part), yielding 17.37 sqft, or over half a square. Due to rotational symmetry this also applies to the horizontal parts, flipping around some operations.

If you wanted to measure the dark grey areas (although they're clearly small enough to be visually discarded), you'd use the same formula, but would need to calculate the offsets. For the darker grey area, we need to find x when y = 15, which is just a simple

$$x = \sqrt{r^2 - y^2} = \sqrt{20^2 - 15^2} = \sqrt{400 - 225} \approx 13.23$$

We can then use the same integral:

$$\int_{10}^{13.23} 20 * sin(acos(x/20) \approx 52.46$$

Here we subtract partial squares ("rectangles" have not been invented yet) comprising 3.23' x 15' = 48.45 sqft to get 4.01 sqft, or well under half a square. This can be repeated for the 10' airburst, starting with this red maybe-square:

Top down view of another fireball

$$(\int_{0}^{5} 17.3 * sin(acos(x/17.3))) - 5 * 15 \approx 10.2$$

This is less than half a square, so the red one isn't included. Next, dark grey again:

$$ x = \sqrt{17.3^2 - 10^2} \approx 14.1\\ \left(\int_{10}^{14.1} 17.3 * sin\left(acos(x/17.3)\right)\right) - 4.1 * 10 \approx 9.4 $$

This one also wouldn't be included. These are probably doable from sight, but different sized bursts at different heights can get into hard-to-eyeball territory.