Repository navigation
Conversation
docs/navmesh.md left the polygon flag bits open and two road/pavement labels from another project unconfirmed. tools/navmesh_nodes.py puts every lane-graph node of levels.rpf on the navmesh polygon under it and counts that polygon's +0x18 and +0x28 bits next to the plan area each bit covers. On one 1.0.2.1 package 63,793 of 63,806 nodes have a polygon within 3 m (median 0.03 m), which confirms vertex = tile minimum + u16 / 65535 * extent; 90.2% of them stand on a polygon with +0x18 bit 13, which covers 12.0% of the area: road surface, as SixNG labels it from a visual check. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… measured The first version called +0x18 bit 13 road surface. The count cannot tell it from bit 8: both lie under about nine in ten lane nodes. The tool now also counts the four combinations of the two bits (both, only one, neither) for nodes and area: 89.6% of the nodes stand on polygons with both bits, which cover 2.5% of the area, and bit 13 alone covers 9.5% with 0.6% of the nodes. The doc reports that, keeps SixNG's label as its visual reading, and leaves which bit means road surface open. docs/related_projects.md gets a SixNG entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested b3e1fae on Windows, CPython 3.14.7, CPU only (no GPU, no game files).
One case, reproduced: an archive whose data offset points past the end of the file is accepted and reported as a successful scan of nothing. import sys, pathlib, struct, subprocess
sys.path.insert(0, "tests")
import test_navmesh_nodes as t
c = t.ArchiveTest()
c.setUp()
try:
pathlib.Path(c.navmeshes).write_bytes(b"9FPR" + struct.pack("<I", 64))
p = subprocess.run([sys.executable, "-I", t.TOOL, c.navmeshes, c.levels], capture_output=True, text=True)
print(p.returncode, p.stderr, p.stdout[:160])
finally:
c.tearDown()Run from the repository root. The 8-byte archive says its data starts at byte 64. Actual: exit 0, empty stderr, and a JSON report with AI-assisted. |
|
The local 1.0.2.1 export reproduced 63,808 lane records and 63,806 finite positions. On 30 node-bearing tiles, all 459 matched nodes had the same flag and cutoff classification using mean vertex height and triangle-interpolated height. Independent projected areas agreed within 0.000001 square metres per flag combination across 390,422 polygons. Please name the mean-vertex-height approximation in the distance description: on a slope it can differ from surface height at the node. Overlapping surfaces count separately in summed plan area. The bounded sample does not verify all archive totals. AI-assisted, CPU only. |
|
Reviewed and tested
Two small non-blocking notes:
AI-assisted. |
…oximations Review on ItsNotRexed#3834: an archive whose data offset pointed past its end was scanned as an empty archive (exit 0). The tool now refuses a data start outside 8..file size with exit 2. --out is compared with the inputs through report_paths.same_report_path, as the other tools do. The docstring and docs/navmesh.md now say that a polygon's height is the mean of its vertex heights, and that surfaces above one another (a bridge, stacked tiles of one sector) each add their plan area. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, all three addressed in
|
kacper-serewis
left a comment
There was a problem hiding this comment.
At 2b71db4 the mean-height calculation is described correctly. Please qualify the remaining claim that 3 m absorbs the difference on slopes. In a synthetic 16 m rise over 32 m, a node on the ramp was 7 m from the vertex mean and was excluded. Adding a flat surface at 3 m instead assigned its flags. The bounded retail comparison found no observed disagreement among its 459 matched nodes.
Claim: #3574 (comment) (new ASSET item, no ID assigned yet).
What and why
docs/navmesh.mdlists the navmesh polygon flag bits as open ("Remaining unknowns", item 4). It also says of two road/pavement labels read in another project that "neither meaning is confirmed". The repository already has what is needed to test such a label without looking at a picture: the lane graph inlevels.rpf(tools/world_lights_paths.py) gives every road node a world position, and a navmesh tile gives polygons with positions and flags.tools/navmesh_nodes.pyputs the two together. For each node it finds the polygon of the node's 128 m tile that contains the node in plan view and is closest in height, and counts the bits of that polygon's+0x18and+0x28words. Beside that it sums the plan area of the polygons carrying each bit over the same tiles, and for the two+0x18bits that most nodes stand on (8 and 13) it counts the four combinations. The output is counts only.Measured (my own 1.0.2.1 copy, all of
navmeshes.rpfandlevels.rpf)tile minimum + u16 / 65535 * tile extent, which the doc did not state.+0x180x2000)+0x180x100)+0x180x1000)+0x180x80000, the doc's water candidate)+0x180x8000000)+0x280x20000)+0x280x40000)No other bit has more than 5% of the nodes (the next is
+0x18bit 3 at 4.7%). Bits 8 and 13 in combination:+0x18bits 8 and 13What this shows:
+0x18bit 27,+0x28bit 17) are not under most lane nodes.It does not show which bit, or which combination, means road surface. The doc records the counts and leaves that open.
Where the lead came from
holdmysocks/SixNG,
crates/sixng-core/src/navmesh.rsat commit0619601(GPL-3.0), labels polygon+0x18bit0x2000"road surface, checked visually" and states the same vertex formula. I measured both with this repository's own readers; no code, table or comment is taken from it. The vertex formula is confirmed. The label is consistent with the count (road surface could be wider than the driven lanes) but not settled by it.docs/related_projects.mdgets a SixNG entry saying exactly that.Change
tools/navmesh_nodes.py(new, standard library,python -I).tile_geometry, the point-in-polygon and area helpers,pair_key,tally_tile/summarizeandcross_check.navmesh_nodes.py <navmeshes.rpf> <levels.rpf> [--out] [--jobs] [--max-dz].navmesh_decode(stream walk, split arrays) andworld_lights_paths(node positions); neither is changed.tests/test_navmesh_nodes.py(new, 14 tests): synthetic tiles from the builder intests/test_navmesh_decode.pywith vertices and flags filled in, and a synthetic lane graph fromtests/test_world_lights_paths.py.docs/navmesh.md: a section "Polygon flags under the lane graph" with both tables and the method. The 6stars sentence and unknowns item 4 are updated, and the tool and its test are added to "Tools".docs/related_projects.md: SixNG entry (link, licence, the two facts with file and commit, what was re-measured).Tests
No game files, no GPU (CPU only, Windows 11, Python 3.13.7):
python -I tests/test_navmesh_nodes.py: 14 pass. These are new tests of a new tool, so there is nothing for them to fail against onmain, where the module does not exist. They cover:--max-dz0 and 10, and an empty node list;--jobs 0, negative or NaN--max-dz,--outon an input or a folder, a file that is not an archive. Each gives exit code 2 without a traceback and leaves the inputs unchanged.python -I tests/test_navmesh_decode.py,tests/test_world_lights_paths.py, the fourtests/test_docs_*.pyandtests/test_text_write_line_endings.py.python -m compileall -q make_game.py tools tests: clean.--jobs 6, about 35 minutes), run from a byte-identical copy of the committed file. I ran the package twice: first with the tool as in the first commit, then with the same tool plus the combination counter. The combination table comes from the second run, and every number the first run produced was identical in the second.Overlap
Not ASSET-281 (
+0xB8records) or ASSET-287 (grid keys). Trial merges with open PRs that touchdocs/navmesh.md:docs/navmesh.md. Whichever lands second needs a small rebase of that file.navmesh_decode.pywithout touching the helpers this tool calls (walk,classify,wants_more,is_complete,split_array).AI-assisted (Claude Code). No game data: synthetic bytes in the tests, counts and field layouts in the docs.
🤖 Generated with Claude Code