Names: natural-ground surface names recovered by hash #99

Manually merged
github merged 1 commit from gh-pr/99/head into gh-pr/99/base 2026-11-26 20:09:46 +00:00
Owner

@⁠Snorps37 on GitHub · 2026-11-24 01:38 UTC · original
Snorps37:surface-terrain-names → master · +64 −4 · 2 files · 1 commits · merged 2026-11-24 02:27 UTC

sixng annotate now names 31 more collision surface ids in levels.rpf: the natural-ground materials (TERRAIN_*) from the first block of the material XML, which is not read. Named ids go from 226 to 257 of 398, and named triangles from 63 % to 84 %.

How the names were found:

  • The readable ground categories share their suffixes: DEFORM_, SUBMERGED_, TRACK_, STUNT_ and VEG_ all have MUD_SOFT, SAND_WET, GRASS_LONG and so on. That gives 76 suffixes.
  • I tried those suffixes under about 50 likely prefixes and checked each surface id against the 172 unnamed ids.
  • TERRAIN_ gives an unnamed id for 31 of the 76. A random prefix would give about 0.4 (172 of 32,749 ids), and the next best prefix gave 2.
  • The 31 ids appear in the bounds next to other unnamed ids and to DEFORM_, ROAD_ and TRACK_ surfaces, as ground should.
  • The largest are TERRAIN_SAND_WET (18.6 M triangles), TERRAIN_GRASS_LUSH, TERRAIN_SAND_COMPACT, TERRAIN_GRASS_SHORT and TERRAIN_SAND_LOOSE.

Change:

  • New RECOVERED_SURFACE_NAMES in gamenames.rs. surface_names_from adds these names after the names read from the XML, so a name read from the XML always wins.
  • The doc comments, the names_note text and the README row now describe the recovered names.

Not included: single hits from larger word lists, for example DEFAULT on 317b, a GTA V name. Those lists give many chance matches, so one hit is not enough.

Tested:

  • New unit test recovered_surface_names. It checks four ids seen in levels.rpf (for example TERRAIN_SAND_WET → 2ea2), that the 31 ids are distinct, and that a name read from the XML still wins. It uses no game data.
  • cargo test --release: 145 + 12 passed, 0 failed.
  • sixng annotate levels on the full collision export: surface_ids_named 257 of 398, triangles_named 0.835.
**@⁠Snorps37** on GitHub · 2026-11-24 01:38 UTC · [original](https://github.com/holdmysocks/SixNG/pull/99) `Snorps37:surface-terrain-names` → `master` · +64 −4 · 2 files · 1 commits · merged 2026-11-24 02:27 UTC `sixng annotate` now names 31 more collision surface ids in `levels.rpf`: the natural-ground materials (`TERRAIN_*`) from the first block of the material XML, which is not read. Named ids go from 226 to 257 of 398, and named triangles from 63 % to 84 %. **How the names were found:** - The readable ground categories share their suffixes: `DEFORM_`, `SUBMERGED_`, `TRACK_`, `STUNT_` and `VEG_` all have `MUD_SOFT`, `SAND_WET`, `GRASS_LONG` and so on. That gives 76 suffixes. - I tried those suffixes under about 50 likely prefixes and checked each surface id against the 172 unnamed ids. - `TERRAIN_` gives an unnamed id for 31 of the 76. A random prefix would give about 0.4 (172 of 32,749 ids), and the next best prefix gave 2. - The 31 ids appear in the bounds next to other unnamed ids and to `DEFORM_`, `ROAD_` and `TRACK_` surfaces, as ground should. - The largest are `TERRAIN_SAND_WET` (18.6 M triangles), `TERRAIN_GRASS_LUSH`, `TERRAIN_SAND_COMPACT`, `TERRAIN_GRASS_SHORT` and `TERRAIN_SAND_LOOSE`. **Change:** - New `RECOVERED_SURFACE_NAMES` in `gamenames.rs`. `surface_names_from` adds these names after the names read from the XML, so a name read from the XML always wins. - The doc comments, the `names_note` text and the README row now describe the recovered names. **Not included:** single hits from larger word lists, for example `DEFAULT` on `317b`, a GTA V name. Those lists give many chance matches, so one hit is not enough. **Tested:** - New unit test `recovered_surface_names`. It checks four ids seen in `levels.rpf` (for example `TERRAIN_SAND_WET` → `2ea2`), that the 31 ids are distinct, and that a name read from the XML still wins. It uses no game data. - `cargo test --release`: 145 + 12 passed, 0 failed. - `sixng annotate levels` on the full collision export: `surface_ids_named` 257 of 398, `triangles_named` 0.835.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:09:44 +00:00
github manually merged commit 7651b4d8a9 into gh-pr/99/base 2026-11-26 20:09:46 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.