Routes are walked without re-checking collision #22

Closed
opened 2026-07-27 22:31:57 +00:00 by sickday · 0 comments
Owner

A route is computed once, when the click is handled, and then walked without
being looked at again. World.step_player/2 takes the tiles from
World.Movement.stride/3 and consults only World.MovementAuthority.claim/4,
which is entity occupancy — never terrain.

So anything that changes the world between the click and the last step is not
noticed. A door closed behind a player mid-walk, a loc added by a script, a
region whose diffs were replayed — the player walks through it. audit_walk/3
will log stepped through collision and nothing will stop it.

Today the only thing that mutates collision at runtime is a door swap, so the
window is small and the consequence is one tile. It gets wider with every
feature that adds or removes a loc.

Shape of a fix

Validate each tile in the stride against World.Collision.step?/2 before
claiming it, and drop the rest of the path when one fails. That is the same
predicate the route was built with, so it costs two map reads per step and can
only reject steps that have genuinely become illegal.

A route is computed once, when the click is handled, and then walked without being looked at again. `World.step_player/2` takes the tiles from `World.Movement.stride/3` and consults only `World.MovementAuthority.claim/4`, which is entity occupancy — never terrain. So anything that changes the world between the click and the last step is not noticed. A door closed behind a player mid-walk, a loc added by a script, a region whose diffs were replayed — the player walks through it. `audit_walk/3` will log `stepped through collision` and nothing will stop it. Today the only thing that mutates collision at runtime is a door swap, so the window is small and the consequence is one tile. It gets wider with every feature that adds or removes a loc. ### Shape of a fix Validate each tile in the stride against `World.Collision.step?/2` before claiming it, and drop the rest of the path when one fails. That is the same predicate the route was built with, so it costs two map reads per step and can only reject steps that have genuinely become illegal.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Revenant/Server#22
No description provided.