Spielerando

Area of Effect

An area of effect hurts everything inside a circle around one spot. It warns first, goes off, and a lingering zone hits again at a fixed beat until its time is up. Damage is highest in the middle and falls toward the edge, the edge of a body counts, and cover and allies take only a share.

Also called: AoE, Blast radius, Splash damage, Damage zone, Explosion.

A mole mage slams a glowing staff into the floor of a round arena, and a circle of magenta and orange light spreads out, throwing goblins up near the centre while one crouches safely behind a stone block.
Pestle Burrow, an invented neon arena-defence game. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Area of Effect" to my game.

What it should do: An area of effect lets one attack hit a crowd, punishes standing together and gives the player a way to answer many enemies. The warning, the falloff and the cover rules are what make it readable and fair instead of a surprise from nowhere.

Build it exactly as this state machine. First check that it fits my game, then build it like this:

```mermaid
stateDiagram-v2
  [*] --> warning
  warning: Warning
  active: Active
  over: Over
  warning --> warning: counting down
  warning --> active: goes off
  warning --> over: all within one long step
  active --> active: ticking
  active --> over: time is up
  over --> over: nothing more
  over --> [*]
```

Use these starting values:
- radius: 4 units
- damage: 30
- edgeShare: 0.4
- coverShare: 0.25
- allyShare: 0
- warnTime: 0.8 s
- duration: 3 s
- tickInterval: 0.5 s

Watch out for these common mistakes:
- Measuring to the middle of the body: Tell your AI: measure to the edge of the body, its distance to the middle minus its own radius.
- One character with several parts: Tell your AI: give all parts of one character the same id, and hit each id once per beat with its nearest part.
- Hits that depend on the frame rate: Tell your AI: keep a time for the next hit, and deliver every hit that falls inside the step.
- The last hit: Tell your AI: only hit while the hit time is below the duration, and make the first hit at zero.
- Friendly fire by accident: Tell your AI: mark every target with a side, and give allies their own share of the damage.
- Warning that arrives too late: Tell your AI: do no damage during the warning, and go off in the same step the warning ends.

Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP

What it does

An area of effect lets one attack hit a crowd, punishes standing together and gives the player a way to answer many enemies. The warning, the falloff and the cover rules are what make it readable and fair instead of a surprise from nowhere.

How it runs, as a diagram

Everything it can be in, and what moves it on. Your AI builds from exactly this.

counting downgoes offall within one long steptickingtime is upnothing moreWarningActiveOver
How it runs, as a diagram
  • Warning → Warning: counting down
  • Warning → Active: goes off
  • Warning → Over: all within one long step
  • Active → Active: ticking
  • Active → Over: time is up
  • Over → Over: nothing more

Good starting values

ValueStart withWhat it changes
radius4 unitsHow far the zone reaches from its middle. Four is wide enough to catch a group and small enough that the player can step out of it before the next hit.
damage30Damage in the middle. Pick it against your health numbers: here a target with 100 health survives three hits at the middle and eight at the edge, so a lingering zone punishes standing in it but not one mistake.
edgeShare0.4How much of the damage is left at the very edge. At 0.4 a target at the rim still takes 40 percent, so the edge is a warning and not a free pass. At 1 there is no falloff, at 0 the edge does nothing.
coverShare0.25The share of the damage that gets through cover. A quarter makes cover worth hiding behind without making the zone harmless. At 0 cover blocks everything, which turns every blast into a game of hiding.
allyShare0The share of the damage allies take. Zero is the safe start: the player's own blasts do not hurt friends. Raise it for a game where careless blasts should cost something.
warnTime0.8 sHow long the zone shows before it goes off. Under half a second the player cannot read it, and over two seconds the blast is too easy to avoid. Zero means no warning at all.
duration3 sHow long the zone lasts after it goes off. A one-time blast uses a time shorter than one beat, so it hits exactly once.
tickInterval0.5 sThe time between two hits of a lingering zone. Half a second gives six hits in three seconds: often enough to feel like fire on the ground, rarely enough to read each hit.

What usually goes wrong

Measuring to the middle of the body

A big enemy whose middle is outside the circle but whose arm is inside it takes nothing, and the player learns that large enemies are immune.

Fix: Tell your AI: measure to the edge of the body, its distance to the middle minus its own radius.

One character with several parts

A boss made of a head, two arms and a body is hit four times by one blast, and takes four times the damage you planned.

Fix: Tell your AI: give all parts of one character the same id, and hit each id once per beat with its nearest part.

Hits that depend on the frame rate

A zone that hits once per step hurts three times as much on a fast screen. A zone that checks time only once per step loses hits on a slow one.

Fix: Tell your AI: keep a time for the next hit, and deliver every hit that falls inside the step.

The last hit

A zone of 3 seconds with a hit every half second hits at 0, 0.5 and so on up to 2.5. A hit at exactly 3 would be a seventh one, after the zone is over.

Fix: Tell your AI: only hit while the hit time is below the duration, and make the first hit at zero.

Friendly fire by accident

The player's own blast hurts friends, or the player, because nobody asked whose side a body is on. Or the opposite: a trap hurts only the player and never the enemies that walk in.

Fix: Tell your AI: mark every target with a side, and give allies their own share of the damage.

Warning that arrives too late

A blast that appears and hurts in the same moment gives the player no chance to read it. A blast that hurts before the warning is over looks unfair.

Fix: Tell your AI: do no damage during the warning, and go off in the same step the warning ends.

How to check it works

Works well with

Common questions

how does area of effect damage work

Pick a spot and a radius, and hurt everything whose body reaches inside the circle. Damage is highest in the middle and falls toward the edge, and cover and allies can take a share.

how do i make a damage zone that hurts over time

Give the zone a duration and a beat, say 3 seconds and half a second. Keep the time of the next hit and deliver every hit that falls inside a step, so the damage does not depend on the frame rate.

why does my boss take too much damage from explosions

Each part of it is probably hit on its own. Give all parts the same id and hit each id once per beat, with the part that takes the most damage.

what do i tell my ai to add area damage

Paste this: Add a zone with a radius of 4 and 30 damage in the middle, falling in a straight line to 40 percent at the edge. Measure to the edge of the body. Cover lets a quarter through and allies take none. It warns 0.8 seconds, then hits every half second for 3 seconds.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

Your AI gets the code

Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it