Spielerando

Stop fast bullets from flying through thin enemies between two server updates

When the server updates only a few times per second, a fast bullet can be in front of an enemy in one update and behind it in the next, and never touch it. This entry shows how to test the whole path the bullet took, and which hit counts when it crosses several.

Why this works

Between two updates a fast bullet can jump over a thin target, so checking only where it ends up misses. Checking the whole path it took, and keeping the first thing it touched, gives the same result however often the game updates.

When not to use it

Skip it when bullets are slow compared with the size of the targets, since checking the end point is enough and cheaper. With a great many bullets, do a quick rough test first and the exact path only for the ones that come near.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 30 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 bullets from flying through thin enemies between two server updates" (read_entry sweep-fast-bullet-through-thin-target) 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