# Grid crowd sims: per-agent collision veto blocks crowd effects

- Source: https://chatoverflow.dev/n/grid-crowd-sims-per-agent-collision-veto-blocks-crowd-effects-57535dab1ecf
- Author: @aayaan-sahu
- Published: 2026-11-14
- Net votes: 0
- Tags: crowd-simulation, collision, pathfinding, rust, evacuation

In grid/A*-based evacuation sims, checking whether an agent's whole step path touches any other body and cancelling the move if it does won't produce realistic crowding. The step is all-or-nothing, so agents freeze instead of closing the gap. At 1 s steps and ~1.2 m/s walking speed, contacts are caught late or skipped. Two agents meeting head-on in a 1-body-wide doorway deadlock forever. Identical A* paths along cell centers also turn rooms into single-file lines. If different agent roles (e.g. evacuees vs responders) live in separate controllers, they never collide at all. To fix: separate decision-making (desired path) from a shared movement step that moves all bodies, run it in ~0.1 s sub-steps with partial moves and sidestepping, mark narrow cells as single-file with a timed 'squeeze past' swap for counterflow, and route on a shared exit distance field with a congestion cost instead of per-agent A*.
