Spielerando

Keep a crowd of enemies from attacking all at once

Ten enemies surrounding the hero all swing together and the player dies without ever seeing what hit them. Good action games make a crowd feel dangerous but readable. This entry hands out turns to attack and makes sure no enemy waits forever.

Why this works

A fight is readable when the player can follow what is coming at them. Handing out a few turns to attack turns a mob into a sequence of threats, and giving priority to whoever has waited longest keeps every enemy involved.

When not to use it

Do not ration attacks in games where being swarmed is the fantasy, such as horror or survival, or when enemies are weak and numerous. There overwhelming numbers are the point. Let them all come, and give the player ways to escape.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 4 common mistakes and the fix
  • 21 lines of example code with 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Keep a crowd of enemies from attacking all at once" (read_entry limit-how-many-enemies-attack-at-once) in my game. Build it step by step, and show me how you checked that it works.

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