Repository navigation
fix(navigation): a place in a dungeon cell stands on the floor under it - #222
Open
davidc-smith wants to merge 1 commit into
Open
davidc-smith wants to merge 1 commit into
davidc-smith wants to merge 1 commit into
Conversation
A place walk or preview inside a dungeon kept the height it was given. A dungeon map gives a cell by the middle of its bounds, which in a tall room is metres above the floor, and the router only arrives within 1.2 m of a goal's height, so such a place came back NoRoute. In 0x5B48 no cell routed at all, and in 0x5948 only the low ones did. RuntimeNavigationGoalSource.TryLocatePlace now stands a place in an interior cell on the cell's own floor nearest at or below it (up to 0.5 m above), or, where the cell has no floor there, as in the upper half of a tall room authored as a cell on top of a cell, on the nearest floor of any cell below it. Preview and walk both locate places through it, so they agree. Outdoor places, places with no height, and object goals are unchanged. Against the installed dat, from one start: 0x5948 routes 313 of 327 cell middles (39 before); 0x5B48 routes 265 of 712 (9 before), the rest lying in wings its cells alone do not join. Claude-Session: https://claude.ai/code/session_01Qxrqqq5UccBfoNgzr2T84o
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A walk or preview to a place inside a dungeon kept the height it was given. A dungeon map gives a cell by the middle of its bounds (
PluginDungeonCell.Center), which in a tall room is metres above the floor. The router only arrives within 1.2 m of a goal's height (GoalHeightTolerance), so such a place came backNoRoute. Even a 3 m room's middle is 1.5 m up. A plugin exploring dungeon 0x5B48 cell by cell gotNoRoutefor every one of its ~700 cells; in 0x5948 only some routed. Walks to creatures were unaffected, since a creature already stands on the floor.RuntimeNavigationGoalSource.TryLocatePlacenow stands a place in an interior cell on the floor under it:Both the preview (
PreviewPathAsync(position, …)) and the walk (GoTo(position, …)/WalkToPlace) locate places throughTryLocatePlace, so they agree. Outdoor places, places given with a NaN height, and object goals are unchanged.CellSurface.SampleLevelZAtOrBelowis a new lookup that only considers level faces at or below the point, so a ceiling over the point is never picked;SampleFloorZreturns whichever face it meets first.No plugin contract change: the abstractions only gain XML doc notes that a cell's
Centercan be passed as it is.docs/navigation.mdis updated to match.Tests:
DungeonPlaceFloorTests(made-up dungeon with a 3 m room, a 5 m room, and a 10 m room built as a floorless cell over a floored one):NoRoutetoday;With the fix stubbed out, 5 of the 10 fail.
CellSurfaceTests: the new lookup takes the floor under a point, not the ceiling over it.DungeonPlaceFloorInstalledDatTests(InstalledDat lane, Diagnostic): routes to the middle of every cell of 0x5948 and 0x5B48 from one start, as given and stood on the floor. Results:The rest of 0x5B48 lies in wings its cells alone don't connect.
It has also been tested live in a client against both dungeons.
Original behavior
Not a change to how the client behaves in the world. It only affects where the client's own navigation layer puts a place goal before planning a route to it.
Checklist
dotnet build AcDream.slnx -c Releaseis greenhttps://claude.ai/code/session_01CJ7QWFYQz9G3sBYnBWWDzU