Jump to content

OBD:AKVA: Difference between revisions

2,215 bytes added ,  31 December 2009
no edit summary
m (I can only assume this was meant to be a Y ^^)
No edit summary
Line 50: Line 50:
;General
;General
:BNVs are volumes that have a [[OBD:AKVA/0x24|pathfinding grid]] assigned to them. The grid itself is in the RAW, while its overall parameters are in the DAT.
:BNVs are volumes that have a [[OBD:AKVA/0x24|pathfinding grid]] assigned to them. The grid itself is in the RAW, while its overall parameters are in the DAT.
:The usual volume is a right prism (or an oblique prism if the foor is sloped) but there are a few BNVs that are a bit more complex. There's not limit to the number of faces a volume can have but it's probably better to keep this number low.
;0x00 - [[OBD:AKBP|AKBP]] tree
;0x00 - [[OBD:AKBP|AKBP]] tree
:This binary space partition (BSP) tree is used to check if a point is inside the BNV. A list of BNVs that can potentially contain a point is found using the environment octree (2nd [[OBD:IDXA_AKOT_2|IDXA]] of the [[OBD:AKOT|AKOT]] + [[OBD:OTLF|OTLF]]).
:This binary space partition (BSP) tree is used to check if a point is inside the BNV. A list of BNVs that can potentially contain a point is found using the environment octree (2nd [[OBD:IDXA_AKOT_2|IDXA]] of the [[OBD:AKOT|AKOT]] + [[OBD:OTLF|OTLF]]). It should be noted that the BSP tree includes not only the "walls" of the BNV but the floor and ceilings too.
 
 
;0x08 - [[OBD:AKBA|AKBA]] range
;0x08 - [[OBD:AKBA|AKBA]] range
:The "sides" of a BNV define the quads by which an AI can transit to adjacent BNVs.
:The "sides" of a BNV define the quads (invisible "ghost" quads, see [[AGQG]] flags and [[AKAA]]) by which an AI can transit to adjacent BNVs. These quads are used to create "connections" between the pathfinding graph's nodes. It appears that such a connection is one way only so if 2 BNVs are adjacent then each should have a transition quad that connects it to the other.
 
 
;0x10 - Children and siblings
;0x10 - Children and siblings
:Those occur when smaller BNVs are completely included into larger ones.
:Those occur when smaller BNVs are completely included into larger ones.
:The bigger BNV only links to its first child. If there are several children, the sibling link is used to define the series.
:The bigger BNV only links to its first child. If there are several children, the sibling link is used to define the series.
::Examples: lobby in {{C3}} (level3), big hall under main power line in {{C8}} (level10).
::Examples: lobby in {{C3}} (level3), big hall under main power line in {{C8}} (level10).
:It's unclear if children BNVs are really needed. They usually occur when the parent BNV is very tall (see level3 lobby) but due to the way the pathfinding grids work such tall BNVs might be useless (see below).
;0x1C - Pathfinding grid
;0x1C - Pathfinding grid
:The pathfinding grid can be seen as the projection onto the floor of (almost) all quads that intersect the BNV. This raises an interesting problem: if a polygon is high enough that a character can walk under it then it might still get projected onto the grid and result in a blocked tile. This can be seen in a couple of places in level 19 where some "furniture" has been placed on the walls and the grids under it contain blocked tiles (see the Muro fight scene for example). This does't happen always (for example the ceilings are never projected) and it's not known what rules have been used. Something along these lines seems reasonable:
::- quads that are above some height x (unknown, larger than max character's height, less than the BNV height) are projected
::- "furniture" quads are always projected (that would explain why the furniture in level 19 got projected even if it is placed higher than many ceilings)
::- "grid ignore" (see [[AGQG]] flags) quads are not projected. There are a lot of light lamps in level 9 that are placed very low and they're not projected onto the grid.
::- "danger" quads are projected but result in "danger" tiles instead of "blocked" tiles
::- quads that use "no collision" or "no character collision" are obviously not projected
:Given this it seems that there's no reason to make BNVs that are much taller than the characters.
:BNV 165 in level4 (far side of tarmac, behind the fence) has a non-zero X-Z grid size but no RAW data.
:BNV 165 in level4 (far side of tarmac, behind the fence) has a non-zero X-Z grid size but no RAW data.
::Notably, that one BNV also has the 16 flag set at 0x5C (see below).
::Notably, that one BNV also has the 16 flag set at 0x5C (see below).
:The grid's alignment on the "floor" of the BNV's AABB is defined by the x and z offsets in tiles (at 0x48 and 0x4A).
:The grid's alignment on the "floor" of the BNV's AABB is defined by the x and z offsets in tiles (at 0x48 and 0x4A).
;0x5C - Floor and ceiling
;0x5C - Floor and ceiling
::(typical environment requiring this feature is compact staircases)
:These value define 2 planes used as the "floor" and the "ceiling" of the BNV. It is unclear why these planes are needed as this information is already included in the BSP tree. The engine uses these values if the "sloped" bit is set to 1 (they're ignored otherwise) so they need to be correct.
:The sloped floor and ceiling are used to apply a final cut to the volume defined by the [[OBD:AKBP|AKBP]] tree
:''The 3 power lines in level10 have all 5 floats equal to zero even though the "sloped" bit is set. This is very likely an error as those BNVs are obviously not sloped. Due to the way computations are done BNV detection in those areas still works.
::(the walls of which are typically vertical (possibly not axis-aligned) and horizontal)
:When the "sloped" bit isn't set, all 5 floats are always zero (and are probably ignored anyway).
:''The 3 power lines in level10 have all 5 floats equal to zero even though the "sloped" bit is set
::''(possibly a design error: interestingly, BNV detection and pathfinding work fine for those 3).




{{OBD_File_Footer | type=AKVA | prev=AKOT | next=BINA | name=BNV Node Array | family=Level}}
{{OBD_File_Footer | type=AKVA | prev=AKOT | next=BINA | name=BNV Node Array | family=Level}}
708

edits