AI game generator · Collider boundaries
Why Does My Player Catch on Flat Wall Seams?
Inspect the collision boundary behind the artwork
If your player catches at the join between apparently flat tiles, show the collision shapes and record the contact normal at that join. Separate an unwanted internal edge from a real gap or height step. Use your engine's supported connected boundary or collider-combining workflow where appropriate, then retest both travel directions.
A wall can look seamless while its collision shapes disagree. Before asking an AI game generator to change the controls, keep one failing crossing and compare the physical boundary with the visible tiles. This guide concerns a repeated snag at a join; a closed corner and its slide response are a separate case.
Look for three different kinds of join
First, adjacent pieces may genuinely differ in height or position. That creates an exposed obstacle even when the textures line up. Second, a small gap may let the character settle between shapes. Third, a solver can encounter an internal vertex between connected pieces and produce a contact that does not represent the intended outer surface. Those possibilities require different repairs.
Box2D's collision documentation describes ghost collisions when a polygon slides along connected segments. It explains that an internal vertex can generate an internal collision normal and that chain segments store adjacent ghost vertices to address this. This is a specific engine feature, not evidence that every generated game uses Box2D or that every tile snag is a ghost collision.
Same movement, different supplied normal
We ran a small Node arithmetic model to isolate the diagnostic question. In screen coordinates, rectangle A occupies x zero to fifty and y fifty to seventy. Rectangle B occupies x fifty to one hundred with the same vertical range. Their union has a flat top at y fifty. The vertical join at x fifty is internal to that union below the top; it is not an exposed wall across the walking surface.
Imagine a character requesting twelve units to the right while already supported on that top. Our model does not detect a collision. We supply one unit contact normal at a time and remove only the movement component pointing into it. This deliberately narrow calculation shows why recording the normal is useful; it cannot prove which normal a real engine will generate.
For the valid upward-facing surface, the supplied normal is zero, minus one. Its dot product with twelve, zero is zero. The requested movement stays twelve, zero because it is parallel to the surface. Now intentionally supply a left-facing normal of minus one, zero at the internal join. Its dot product is minus twelve. Removing that inward component leaves zero, zero: a complete stop from the same request.
| Supplied case | Requested move | Allowed remainder |
|---|---|---|
| Aligned top face; normal (0,−1) | (12,0) | (12,0) |
| Artificial internal normal (−1,0) | (12,0) | (0,0) |
| Reverse away from that constraint | (−12,0) | (−12,0) |
| Real exposed step; normal (−1,0) | (12,0) | (0,0) |
The artificial seam normal is an input to this example, not a discovered collision or a measured defect in a product. When the request reverses to minus twelve, zero, that same normal does not remove it: the movement points away. A direction-dependent snag can therefore provide a useful clue, but it is not a diagnosis by itself. Other controller or geometry faults can also depend on direction.
A real step must keep its blocking face
Change only rectangle B's top from y fifty to y forty-eight. The right-hand floor is now two units higher on the screen. The short vertical face at x fifty between y forty-eight and fifty is exposed. A character that needs upward clearance cannot cross it merely by ignoring every left-facing normal near a tile boundary. That would erase a real constraint along with the unwanted one.
Our model returns zero, zero for that supplied step normal too. The arithmetic alone cannot tell whether the constraint belongs there; the outer geometry provides that distinction. Keep the rendered shape overlay and the contact record together. A rule that drops every horizontal normal, every tile join or every short edge can silently allow traversal through actual walls or steps.
The five assertions checked parallel motion, the intentionally blocking seam normal, reverse motion, the real-step constraint and its two-unit height difference. They did not simulate friction, gravity, tilemap construction, collision margins or a complete character controller. Replay the crossing in the actual shared or exported game before marking its snag fixed.
Compare one short strip before rebuilding the level
- Duplicate a small failing strip in a safe test scene. Preserve the player shape, movement speed and physics settings.
- Enable visible collision shapes. Record both pieces' positions, extents and collision roles at the failing join.
- Cross in both directions and record contact positions and normals if the engine exposes them. Compare a position away from the join.
- Make one engine-supported boundary change in that test scene. Confirm that the join becomes continuous while real corners, steps and openings remain.
- Repeat the same actions in the exported build. A smooth editor preview is only one check.
For a straight, static strip, a single deliberately sized collider can be a useful comparison. Connected segment chains, combined tilemap outlines and merged solid colliders have different constraints; use the workflow documented for your engine and version. Do not replace a whole level's collision with one large rectangle across intentional doors or gaps.
Give the generator a bounded repair request
Keep controls, player speed, collider size and level art unchanged. Reproduce the snag at this exact flat tile join. Show the collision shapes and contact normals, distinguish an internal boundary from a gap or exposed step, and identify the engine's supported way to represent the intended continuous surface. Change only the failing test strip first. Verify both directions, a real corner and an intentional opening on the exported build.
Questions before accepting the repair
Should I reduce friction to zero?
Only after confirming friction is relevant to this contact. Lower friction does not remove a misplaced collider or establish that an internal edge is valid. Keep the original value so you can compare one change.
Can I just increase the collision margin?
Margins are engine-specific and can change effective clearance. Check the geometry first and record the previous value. A tolerance adjustment is not proof that the boundary was corrected.
What if the player goes through the wall instead?
Follow the fast movement path checklist. Passing through an obstacle and stopping at a tile join are different symptoms. Use the one-bug repair guide to keep the request focused.
Watch the collider-seam explanation alongside this checklist.