Bounds and collision
Collision is stored as phBound trees in YBN files and embedded in some drawables and fragments. Static map YBN
vertices are already in world space; embedded bounds inherit the placed asset’s transform. Observed
The structural bound census reads all 14,692 YBN copies in every archive, including nested composite children, with no refused files. The proven header, geometry, composite and triangle fields below describe that entire YBN corpus; they do not establish the undecoded BVH structure or every runtime collision filter. Proven · all YBN entries
| Kind | Shape | Confidence |
|---|---|---|
| 0 | Sphere | Sourced · CodeWalker |
| 1 | Capsule | Sourced · CodeWalker |
| 3 | Box | Sourced · CodeWalker |
| 4 | Geometry | Sourced · CodeWalker |
| 8 | Geometry with BVH | Sourced · CodeWalker |
| 10 | Composite | Sourced · CodeWalker |
| 12 | Disc | Sourced · CodeWalker |
| 13 | Cylinder | Sourced · CodeWalker |
| 15 | Cloth | Sourced · CodeWalker |
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 16 | bytes | resource base | Sourced | |
| 0x10 | 1 | u8 | bound kind | Proven | |
| 0x11 | 3 | bytes | unknown | Unknown | |
| 0x14 | 4 | f32 | sphere radius | Proven | |
| 0x18 | 8 | bytes | unknown | Unknown | |
| 0x20 | 12 | vec3 | box maximum | Proven | |
| 0x2C | 4 | f32 | margin | Proven | |
| 0x30 | 12 | vec3 | box minimum | Proven | |
| 0x3C | 4 | bytes | unknown | Unknown | |
| 0x40 | 12 | vec3 | box centre | Proven | |
| 0x4C | 4 | bytes | primitive material bytes | Proven | first byte is material index |
| 0x50 | 12 | vec3 | sphere centre | Proven | |
| 0x5C | 16 | bytes | unknown | Unknown | |
| 0x6C | 4 | f32 | volume | Proven |
Geometry and composites
Section titled “Geometry and composites”Begins with the 112-byte common header described above.
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 112 | BoundHeader | common header | Proven | |
| 0x70 | 8 | bytes | undescribed fields | Unknown | |
| 0x78 | 8 | pointer | shrunk vertices | Sourced | |
| 0x80 | 4 | bytes | unknown | Unknown | |
| 0x84 | 4 | u32 | shrunk vertex count | Sourced | |
| 0x88 | 8 | pointer | polygons | Proven | |
| 0x90 | 12 | vec3 | coordinate quantum | Proven | |
| 0x9C | 4 | bytes | unknown | Unknown | |
| 0xA0 | 12 | vec3 | coordinate centre | Proven | |
| 0xAC | 4 | bytes | unknown | Unknown | |
| 0xB0 | 8 | pointer | quantized vertices | Proven | |
| 0xB8 | 8 | pointer | vertex colours | Proven | |
| 0xC0 | 16 | bytes | undescribed fields | Unknown | |
| 0xD0 | 4 | u32 | vertex count | Proven | |
| 0xD4 | 4 | u32 | polygon count | Proven | |
| 0xD8 | 24 | bytes | undescribed fields | Unknown | |
| 0xF0 | 8 | pointer | materials | Proven | |
| 0xF8 | 32 | bytes | undescribed fields | Unknown | |
| 0x118 | 8 | pointer | polygon material indices | Proven | |
| 0x120 | 1 | u8 | material count | Proven | |
| 0x121 | 15 | bytes | undescribed tail | Unknown |
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 112 | BoundHeader | common header | Proven | |
| 0x70 | 8 | pointer | child bound pointers | Proven | |
| 0x78 | 8 | pointer | child transforms | Proven | |
| 0x80 | 8 | bytes | undescribed fields | Unknown | |
| 0x88 | 8 | pointer | child bounding boxes | Sourced | |
| 0x90 | 8 | pointer | child flags | Proven | |
| 0x98 | 8 | pointer | second child flags | Proven | |
| 0xA0 | 2 | u16 | child count | Proven | |
| 0xA2 | 2 | u16 | second child count | Sourced | the count fivefury and FiveM's GetNumChildBounds read |
| 0xA4 | 12 | bytes | undescribed tail | Unknown |
Geometry vertices are signed 16-bit coordinate triples decoded component-wise as integer * quantum + centre.
Polygon records include triangles, spheres, capsules, boxes and cylinders. Triangle indices carry flags in their
high bits, alongside signed neighboring-polygon indices (-1 means absent) and area. Proven
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 4 | u32 | area and polygon kind | Proven | low 3 bits select kind 0; clearing them gives the float area bits |
| 0x4 | 6 | u16[3] | vertex indices and flags | Proven | bit 15 is a flag; low 15 bits index vertices |
| 0xA | 6 | i16[3] | edge neighbors | Proven | -1 means absent |
Sphere, capsule and cylinder vertex words use all 16 bits as indices, unlike triangle words. Removing bit 15 from every polygon kind changes legitimate large vertex indices. Sourced · CodeWalker
Geometry materials are two-word records. The low byte of the first word identifies the material type; the records
also carry procedural ID, room, ped density, flags and colour index. Each polygon has a byte index into the material
array. Names come from the ordered entries of materials.dat. Sourced · CodeWalker
Composites own child pointers, child bounding boxes, two sets of per-child flags and 64-byte transforms. A transform
stores four columns of vec3-plus-word data, with translation in the fourth column. Proven
fivefury and FiveM’s GetNumChildBounds take a composite’s child count from 0xA2 rather than 0xA0; whether the
two words ever differ in the game’s files is not checked. Sourced · fivefury
The existence of a BVH pointer does not establish its node layout here; geometry can be decoded independently of the acceleration structure. Unknown
Collision detail and map state
Section titled “Collision detail and map state”YBN names prefixed with hi@ or ma@ distinguish finer collision copies associated with weapons and vehicles from
plain map bounds used for walking or rolling. Sourced · CodeWalker
Drawn geometry and collision can describe one object differently. At the Vespucci skatepark (vb_34_skate), two
round rails are drawn as pairs of crossed flat strips with the alpha-tested railing_whiterail_basic_a material,
while their collision models round bars of radius 0.10 m; a third rail (rsn_os_skatemetal) is drawn as a real
tube. Observed
Static collision streams by bound boxes. A YBN can be live only in Story or only in Online, so collision ownership must retain the same map-state distinction as placements. A file in one state is not globally active simply because its bounds intersect a region. Observed
Embedded collision
Section titled “Embedded collision”The inspected drawable layout has an embedded-bound pointer at gtaDrawable + 0xC8. Fragments reach the first
physics-LOD bound through fragType + 0xF0, then LOD-group +0x10, then physics-LOD +0xE8. Observed
The live Story drawable census finds embedded bounds in 13,133 YDRs and in the first physics LOD of 40,658 YFTs, but
none in YDD entries or the fragment main drawable’s own bound field (FragDrawable + 0xF0). This is a corpus result,
not a structural prohibition on future resources. Observed · live Story drawables
Entity flag value 4 is named “disable embedded collisions” by CodeWalker. Sourced · CodeWalker
The shape and material representation is broader than the decoded BVH and runtime filtering semantics documented here. The remaining flag bits and BVH structure need separate evidence. Unknown