Spielerando

Make a scripted chase end at the cliff whether the player runs fast or slow

The story needs the pursuer to reach the hero at the edge of the cliff. A fast player leaves the pursuer far behind and the scene makes no sense, a stalling player is caught in the middle of the road. Here is how your AI adjusts the pursuer's pace and finds the speed above which the plan breaks.

Why this works

A chase is a promise about where it ends, so the pursuer should follow from where the player is going, not from a fixed speed. Working out how fast it must move to arrive on time, and limiting that speed, keeps the scene believable and still beatable.

When not to use it

Skip it when the chase is a skill test, where the pursuer must be fair and fast players should truly escape. Rubber-banding would take that away. Also unwise if the player can see the pursuer's speed change, which gives the trick away.

In the full entry

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

Say this to your AI

Use the Spielerando entry "Make a scripted chase end at the cliff whether the player runs fast or slow" (read_entry scripted-chase-must-end-at-the-cliff) 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