Fragment physics: 64-bit collision layer masks with names (SIX-206) #267
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!267
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/267/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-25 12:55 UTC · original
holdmysocks:six-frag-layers→master· +227 −27 · 4 files · 3 commits · merged 2026-11-25 13:37 UTCCollision layer masks in the
physicsblock, read in full and named (SIX-206). This is stacked on #265: until #265 lands, the diff includes its commit.What changes
type_flagsandinclude_flagsare now 16-digit hex.physicsversion goes from 1 to 2.type_layersandinclude_layersfor children, andarchetype_type_layersandarchetype_include_layersfor the archetype. An all-ones mask gives["all"]. A bit without a name giveslayer_<bit>.drdrawables: the bound children ofdrdrawables now carry their masks too, from the 16-byte records at composite +0x88.mapboundflagstallies the map collision's child masks with their material ids.surfnamesprints surface id → material name from extracted common files.How the names were checked
Bits 0–31 follow GTA V's collision layer order. I checked them against the masks of every map collision composite in levels: 22 distinct type/include pairs, with the materials of each. Each checked layer sits on the surfaces and collides with the layers its name implies:
map_weaponaloneprojectile,test_weapon,test_cameraonlytest_weaponmap_coveralonetest_aionlymap_vehiclealonevehicle_not_bvh,test_vehicle_wheelonlymap_stairsped,animaland the test layers onlymap_rivermap_deep_surfacefoliageFoliage is also found only on vegetation fragments. Bits not checked this way are placed by the same order only, and the source marks them so. On all 40,705 level fragments, the archetype's type mask equals the OR of its children's masks plus bit 0.
Not named
Bits 32 and up are layers the older engine did not have. Patterns seen:
test_cameraonlyexplosionandtest_weaponMost include masks have layer 37. Map collision uses 34, 35, 41, 43 and 47.
The rare group flag bits do not line up with any layer of their children.
Tests: sixng-core tests pass, merged with current master.