Pick the dodge direction that keeps the most distance from incoming bullets
A dodging enemy runs from a bullet and straight into the next one, or runs along the bullet's line and gets hit anyway. Here is how to score each possible move by how close the shots will come, with one calculation per bullet and no simulation.
Why this works
Running along a bullet's line only delays the hit. What matters is the closest the bullet will come while both keep moving, and for straight paths that is one sum per bullet. Rating each move by its worst bullet picks the safest way without simulating anything.
When not to use it
Don't use it when shots curve, home in or arrive in dense walls with no gap. The straight-path guess is then wrong, and the best move may be to cross the shots with a dash or a shield. Use the cheap guess only for plain bullets.
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 "Pick the dodge direction that keeps the most distance from incoming bullets" (read_entry sidestep-direction-for-incoming-shots) 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