Spielerando

Stop fast shots and falling heroes from going straight through thin walls

A fast bullet can jump from one side of a thin wall to the other between two frames and never touch it. The AI checks only where the bullet is, not where it travelled. This entry shows how to test the whole path and where along it the hit happened.

Why this works

A moving thing does not teleport; it covers every point between two frames. Asking only where it ended up misses what it crossed on the way, so you ask about the whole stretch it travelled and take the first thing it met.

When not to use it

Skip it when nothing moves faster than a fraction of the thinnest wall per frame, or when walls are thick: the simple end-point check is then enough and cheaper. For very crowded scenes, first sort out which walls are even nearby.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 37 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 "Stop fast shots and falling heroes from going straight through thin walls" (read_entry action-fast-bullet-passes-wall) 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