Spielerando

Stop crowded units from spinning when other units bump them around

In a dense group, units are nudged sideways and backwards by their neighbours, and if the picture follows the real movement, they twitch, face the wrong way and moonwalk. This entry explains which direction the body should follow instead, and what to do when a unit has arrived or stands still.

Why this works

What a unit wants and what its neighbours do to it are two different things, and the body should show the wish. Looking at the final motion mixes in every shove, so the picture twitches. When there is no wish, any direction is noise, so keep the last one.

When not to use it

Wrong when the push is the point: a unit sliding on ice, knocked back by an explosion or carried by a river should visibly be thrown. Then show the real motion, perhaps with a stumble picture.

In the full entry

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

Say this to your AI

Use the Spielerando entry "Stop crowded units from spinning when other units bump them around" (read_entry unit-faces-where-it-wants-to-go-not-where-it-is-pushed) 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