Repository navigation
Conversation
Geometry's Add methods now return a SourceID, Remove and Replace take a source's triangles and off-mesh links back out and rebuild the spatial index around the remaining geometry, TilesAffected lists the tiles whose padded BakeTile bounds a source overlaps, and NavTileRebaker bakes the marked tiles on workers within a per-call budget and installs them in MarkDirty order. BakeTile no longer sizes its candidate tables by the level's triangle count, and BenchmarkBakeTileIndexed holds one 32 m tile in a million-triangle level to the same budget as the tile alone. Fixes #1719
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.
Summary
navbake3d.Geometrynow names the geometry eachAddcall added: everyAddmethod returns aSourceID,Removetakes a source's triangles and off-mesh links back out and rebuilds the XZ index around them so the rest of the level bakes exactly as before,Replaceswaps one source for the geometry a build callback adds, andTilesAffectedreports the sorted tiles whose paddedBakeTilebounds a source overlaps using the same erosion border the bake uses, so a triangle just outside a tile still marks both tiles.NavTileRebakerqueues those tiles, bakes them from the geometry's triangle stores on worker goroutines (or insideUpdatewhenWorkersis 0), installs each result into apathfind3d.TiledNavMeshwithReplaceTileon the update goroutine inMarkDirtyorder whatever order the workers finish in, and stops at a per-call timeBudget.BakeTilealso stopped sizing its candidate tables by the level's triangle count, and the newBenchmarkBakeTileIndexedmeasures the same 32 m tile alone and in a million-triangle level: on the build machine the million case now runs within the noise of the tile alone (0.83 ms against 0.94 ms) instead of the whole-level walk's tens of milliseconds, and both entries are in the benchmark gate.Fixes #1719
Verification
gofmt -l .produces no outputgo tool nsgo check ./pkg/pathfind3d/navbake3d/...,go tool nsgo check ./internal/gamecli/...andgo tool nsgo check ./pkg/editor/...pass on the build machinego tool nsgo test ./pkg/pathfind3d/navbake3d ./internal/gamecli ./pkg/editorpasses: 1562 passed, 0 failed, 2 skippedgo tool game bench -baseline benchmarks/baseline.yaml ./pkg/sprite ./pkg/tilemap ./pkg/bullets ./pkg/rts ./pkg/pathfind3d/navbake3d ./pkg/physicspasses, including the newBenchmarkBakeTileIndexed/aloneand/millionentriesgo run ./tools/changelog checkpassesbun run verify-notespassesdocs/en/navbake3d.mdanddocs/zh/navbake3d.mdupdatedgo tool nsgo test ./...from the repository root and the cross-targetcheckmatrix were not run; verification was scoped to the affected packages per the repository's agent workflow.Screenshots
None: this PR changes no visible UI.
pkg/editor/navmesh3d.goonly updates theAddSceneFilecall to the new two-value signature.Acceptance for every editor PR
Not applicable: the editor change is a one-line call-site update in
Editor.BakeNavMesh3Dwith no UI, theme, focus, shortcut or overlay changes.