Quick answer: Use Bridson's algorithm with a background grid sized to the minimum radius so each candidate only checks nearby cells, and reject any candidate closer than the radius to an existing point.

If your scattered trees or rocks bunch up and overlap, the spacing check is incomplete. A grid-accelerated Poisson-disk pass guarantees a uniform, non-overlapping spread.

How to fix it

1. Back the sampler with a grid

Create a grid with cell size r / sqrt(2) so each cell holds at most one sample. Store each accepted point's index in its cell for fast neighbor lookup.

2. Check only nearby cells

When testing a candidate, examine the points in the surrounding grid cells (a 5x5 block is enough for the chosen cell size) and reject if any is within distance r.

3. Use an active list for even coverage

Follow Bridson's method: keep an active list, pick a random active point, try k candidates in the annulus between r and 2r around it, and retire points whose candidates all fail. This fills the space evenly with no clumps.

Catching the ones you can't reproduce

The hardest version of this to fix is the one you can't reproduce — it only happens on a player's hardware, OS, driver, or save state, under conditions that simply aren't present on your machine. A report that says “it crashed” or “it froze” gives you nothing to act on, so the bug survives release after release while quietly costing you players.

Automatic error capture closes that gap. Each failure arrives with its full stack trace, the device and OS, the build number, and a breadcrumb trail of what the player did right before it broke, so even a failure you have never seen becomes a specific, reproducible issue. Fold identical failures into one signature ranked by how many players each hits, and your worklist sorts itself worst-first instead of arriving as a stream of vague complaints.

This is where a tool like Bugnet earns its place. Its SDK captures every error automatically with the full stack trace plus device, OS, memory, build, and game-state context, folds duplicates into one grouped issue with an occurrence count, and ties each to the build it first appeared on — so you fix the problem that hurts the most players first and confirm it is gone when its signature disappears from the next release.

Ship the fix, watch the signature disappear from the next build. That's how you know it's really gone.