Dungeon enemies walk through walls; update() ignores walls and deltaTime #1042

Closed
opened 2026-08-13 05:09:19 +00:00 by spikerj · 1 comment
Owner

Enemy.update(playerPosition, deltaTime, walls) never reads walls or deltaTime. Movement is position += normalize(target - position) * speed with a comment "Simple collision check (can be improved)" and no ray/AABB test against the maze wall meshes.

Enemies therefore walk through walls to the player. deltaTime is also ignored, so movement is frame-count based (speed units per update call) rather than time-based — at a high tick rate they close distance faster.

Source: projects/spikersoft/src/app/_components/_games/dungeon-crawler/enemy.ts (update). Characterization tests pin the current through-walls / in-range stand-still behaviour.

`Enemy.update(playerPosition, deltaTime, walls)` never reads `walls` or `deltaTime`. Movement is `position += normalize(target - position) * speed` with a comment "Simple collision check (can be improved)" and no ray/AABB test against the maze wall meshes. Enemies therefore walk through walls to the player. `deltaTime` is also ignored, so movement is frame-count based (`speed` units per `update` call) rather than time-based — at a high tick rate they close distance faster. Source: `projects/spikersoft/src/app/_components/_games/dungeon-crawler/enemy.ts` (`update`). Characterization tests pin the current through-walls / in-range stand-still behaviour.
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.