the symptom, in your words

"Smooth render mesh over quantized collision creates invisible curbs"

✓ verified on engine 26.07.15alane: Writing gameplayposted

▸ SYMPTOM

A vehicle (or character) drives along a visually smooth road and stops dead at invisible walls. Collision feedback shows fender impacts against surfaces that don't appear in the rendered scene. The road looks flat and continuous, but physics treats it as a staircase.

▸ CAUSE

The visible surface is built from a continuous float heightfield (corner-averaging gives smooth facets), but the collision mesh is built from quantized integer stepsSteps = floor(h / StepHeight) — producing flat quads at maxStep * StepHeight. Every place the smooth surface crosses a quantize boundary becomes a vertical collision face that the render hides.

With a StepHeight of 0.125 m, the collision staircases in 12.5 cm vertical faces roughly every ~1 m on a climb. Because a flattened lane is uniform across its width, the whole lane crosses each step boundary at the same position, creating a coherent transverse curb — not scattered bumps.

Extra sting: when collision uses a block-MAX of steps over a cell group, collision also sits above the render surface (a lift/high-centre term), making the invisible walls even harder to diagnose visually.

▸ FIX

Make the collision follow the same smooth corner surface the render uses, scoped to affected cells:

snippet
// For cells flagged as road (dilated 1 cell so the driven lane
// is fully covered and the block-max seam falls off the carriageway):
// emit two triangles from the render's own corner-height function
// instead of the block-max quad.

// Keep coarse block-max everywhere else — chunks with no flagged
// cells early-out to the verbatim coarse builder, so off-road
// physics is byte-identical.

With HeightfieldDecimation == CollisionBlockCells, the road-collision corners ARE the render lattice corners, so collision matches visual on the lane exactly (max face height drops from 12.5 cm to 0.0 cm).

Key constraints:

  • Do not globally refine collision if a coarse-collision mover/step-up assumption elsewhere depends on it — scope the smooth collision to flagged cells only.
  • Collision changes are pure geometry and don't affect determinism grid-hashes, so verify with a two-run same-seed hash comparison.

Diagnosis tip: this class of bug is best diagnosed offline. The generation pipeline is a pure deterministic function, so a small console harness can dump heightsM vs Steps vs block-max and locate the step faces without launching the editor.

▸ WHY IT WORKS

The invisible walls exist because two representations of the same surface disagree at quantize boundaries. By making the collision surface read from the same height function as the render surface (at least where it matters — the driven lane), the two meshes agree and the vertical faces disappear. Scoping the fix to flagged cells preserves the performance and behavior benefits of coarse collision everywhere else.

Verified on engine 26.07.15a: seen in a real project.
s&box moves fast; an undated fix is a liability. Spot a stale detail?

Want to know when new guides or fixes drop? Join the community to help build this out. Report gotchas, flag outdated fixes, or just lurk.

Join the Discord