Skip to content

Nav: a goal by a wall, a doorway the grid misses, and the reads of the levels' navmesh - #131

Merged
larelgit merged 1 commit into
mainfrom
claude/level-navmesh-reads
Nov 22, 2026
Merged

larelgit merged 1 commit into
mainfrom
claude/level-navmesh-reads

Conversation

@larelgit

Copy link
Copy Markdown
Owner

What

Three fixes to the navmesh of hand-made levels (#130), found by switching it on in a game's real levels.

  • A goal by a wall took the roof for its node. Where the baked body has no room in the goal's own column (the goal stands by a wall) but a floor lies over it (a walkway, the room's roof), the goal's node was that floor, and the route had no way or led up there. In hand-made levels a goal's node is now a floor within 1.5 m of its height, in its own column or within two meters, before any floor far over or under it.
  • A doorway the grid misses cut the navmesh in two. The cells are fixed in the world, so a doorway narrower than the baked body and a cell together can fall between two columns. Where the levels' navmesh has no route, navmesh_path now asks the local grid too, which is centred on the walker and plans with its own body. A region's navmesh still has the last word.
  • What the build reads of content is the simulation's, whoever asked for the navmesh first (a tick, a tool that only looks, a snapshot being loaded): levels::rebuild opens the simulation's scope, so the replay check content names the same definitions in a recording and in its playback.

Also

  • The test level's stairs get rails. A route could plan a climb onto a stair's tread from its side (1.5 m, within the default body's mantle_height), which the controller does not make (a tread is half a meter deep), and the NPC stood pressed against the stair; the test passed only when the NPC's next goal happened to lead it away. The manual says what a level or a game does about it (close the stair's sides, or bake a class for a body whose mantle_height is its step_height).
  • The manual also says when the navmesh is built, and that a game placing levels as it builds its world calls nav::refresh right after.

Checks

  • New tests in crates/shards_npc/tests/npc/level_nav.rs: a_goal_by_a_wall_under_the_walkway_is_on_the_floor, a_doorway_the_grid_misses_is_walked_on_the_local_grid (9 in the file).
  • Local: cargo test -p shards_npc (71 + 224 pass), cargo test -p shards_motion --test readers, cargo clippy -p shards_npc --all-targets -- -D warnings. The whole workspace is left to CI (it does not fit this machine's memory next to other work).
  • Only hand-made levels with nav: true are touched: a region's navmesh takes the same paths as before.

🤖 Generated with Claude Code

…e levels' navmesh

Three fixes to the navmesh of hand-made levels, found by switching it on in a game's real levels. A goal that stands by a wall, where the baked body has no room in the goal's own column, took the floor over it (a walkway, the roof) for its node: in hand-made levels a goal's node is now a floor within 1.5 m of its height, in its column or within two meters, where there is one. A doorway narrower than the baked body and a cell together could fall between two columns and cut the navmesh in two: where the levels' navmesh has no route, navmesh_path asks the local grid too. And what building it reads of content is the simulation's whoever asked first, so a replay names the same definitions.

The test level's stairs get rails: a route could plan a climb onto a tread from the stair's side, which the controller does not make, and the NPC stood pressed against the stair. The manual says what a level or a game does about it.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@larelgit
larelgit merged commit b7e5a0f into main Nov 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants