Apex Legends BVHLeafData
#111
Replies: 5 comments 11 replies
-
Some notes stolen from @r-ex Only ever seen up to leaf type 0-7. or well, child type 0-7 Child Types0 - BVH4 node Only difference between 4-5 and 6-7 is that:
The decision to use packed/unpacked is based on the physical size of the model (i.e., how big it appears in the world) |
Beta Was this translation helpful? Give feedback.
-
more stolen from @r-ex we recently got pretty decent coverage on BVH nodes/leaf data in respawn-mdl templates for RMDL collision data purple data at the top is packed vertices, dark yellow is the first 4 bytes of leaf type 5 (packed triangles) |
Beta Was this translation helpful? Give feedback.
-
Found a way to show how many of each >>> import bsp_tool, os, fnmatch
>>> r5s3md = "E:/Mod/ApexLegends/season3/3dec19/maps"
>>> maps = {m[:-4]: bsp_tool.load_bsp(os.path.join(r5s3md, m))
... for m in fnmatch.filter(os.listdir(r5s3md), "*.bsp")}
>>> children = lambda n: (n.index.child0.child0_type, n.index.child0.child1_type,
... n.index.child1.child2_type, n.index.child1.child3_type)
>>> lc = [c.value for n in maps["mp_lobby"].BVH_NODES for c in children(n)]
>>> {print(f"{x:02X} {lc.count(x):>5}") for x in sorted(set(lc))}
00 11951
01 41
02 3
04 1 |
Beta Was this translation helpful? Give feedback.
-
Screengrab of Extreme SIMD we got the number of leaf types from |
Beta Was this translation helpful? Give feedback.
-
remapped >>> import bsp_tool
>>> bsp = bsp_tool.load_bsp("E:/Mod/ApexLegends/season17/20jun23/maps/mp_lobby.bsp")
>>> {c.index for n in bsp.external.BVH_NODES for c in n.children if c.type.value == 8}
{0} |
Beta Was this translation helpful? Give feedback.
-
Apex Legends throws out the
CM_*
&TRICOLL_*
physics systemsTheir replacement lives in
BVH_NODES
&BVH_LEAF_DATA
rmdl
uses the same system asbsp
, though they tend to use different parts of the formatBVH
The
BVH_*
system appears to be the final evolution of Earl's physics engine1BVH4
stands for Bounding Volume Hierarchy w/ 4 children per-nodeEarl's Extreme SIMD talk seems to align best w/ Apex Legends, but Elements are present across all ~3 Engines
(TF:O has broken physics & Apex is still evolving, but 1 Engine per game makes sense to me)
BVH Lumps
A
BVHNode
can index intoBVHLeafData
, when it's type is givenEach type enum selects a handler function and feeds it some context + the pointer into
BVHLeafData
BVHLeafData
ends up being a combination of different data types all squished togetherSo far we have identified a few types, but not necessarily how they function, or how to replicate them.
Footnotes
GDC on Youtube: Extreme SIMD: Optimized Collision Detection in Titanfall ↩
Beta Was this translation helpful? Give feedback.
All reactions