Spielerando

Make a ranged enemy hold a good distance without jittering back and forth

An archer who backs away when you come close and steps forward when you leave sounds easy, but at the border it flips every frame and shakes in place. And one cornered against a wall must do something else. Here are the rules for a calm, believable archer.

Why this works

A choice with a single border flips whenever the player takes a tiny step. Making it harder to leave a behaviour than to start it gives the enemy a stubborn mind, which reads as intention, and a way out when cornered keeps it believable.

When not to use it

Skip it for enemies that rush in, such as melee brutes or swarms, and for tiny arenas with no room to back away. There, close the distance at once or let the archer stand and fire.

In the full entry

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

Say this to your AI

Use the Spielerando entry "Make a ranged enemy hold a good distance without jittering back and forth" (read_entry archer-keeps-distance-without-jitter) 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