OBD:OTLF: Difference between revisions

From OniGalore
Jump to navigation Jump to search
No edit summary
No edit summary
Line 33: Line 33:
| COLSPAN=3 | <FONT SIZE=2 COLOR="#FFFFFF">Below follows the first package.</FONT>
| COLSPAN=3 | <FONT SIZE=2 COLOR="#FFFFFF">Below follows the first package.</FONT>
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC8C8" | 00 00
| BGCOLOR="#FFC8C8" | 00 00 00 00
| 0
| 0, 0
| ALIGN=LEFT | unknown
| ALIGN=LEFT | Bits 0-11 (12 bits) contain the number of gunk quads that intersect this leaf, bits 12-31 (20 bits) contain the index of the gunk quad list. See details below.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC8C8" | 00 00
| 0
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFFFC8" | FF FF
| BGCOLOR="#FFFFC8" | FF FF FF FF
| 65535
| -1
| ALIGN=LEFT | unknown
| ALIGN=LEFT | negative x neighbour
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFFFC8" | FF FF
| BGCOLOR="#C8FFC8" | 01 00 00 80
| 65535
| 1, high bit
| ALIGN=LEFT | unknown
| ALIGN=LEFT | positive x neighbour
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFC8" | 01 00
| BGCOLOR="#C8FFFF" | FF FF FF FF
| 1
| -1
| ALIGN=LEFT | unknown
| ALIGN=LEFT | negative y neighbour
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFC8" | 00 80
| BGCOLOR="#FFC8FF" | 02 00 00 80
| 32768
| 2, high bit
| ALIGN=LEFT | unknown
| ALIGN=LEFT | positive y neighbour
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | FF FF
| BGCOLOR="#FFC800" | FF FF FF FF
| 65535
| -1
| ALIGN=LEFT | unknown
| ALIGN=LEFT | negative z neighbour
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C8FFFF" | FF FF
| BGCOLOR="#C800C8" | 04 00 00 80
| 65535
| 4, high bit
| ALIGN=LEFT | unknown
| ALIGN=LEFT | positive z neighbour
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC8FF" | 02 00
| BGCOLOR="#C87C64" | 7F FE FC 39
| 2
| 7, 127, 127, 127
| ALIGN=LEFT | unknown
| ALIGN=LEFT | Bits 0-8 (9 bits) contain the index of max x, bits 9-17 (9 bits) contain the index of max y, bits 18-26 (9 bits) contain the index of max z and bits 27-31 (5 bits) contain the index of the size of this leaf. See details below.
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC8FF" | 00 80
| BGCOLOR="#B0C3D4" | 00 00 00 00
| 32768
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC800" | FF FF
| 65535
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#FFC800" | FF FF
| 65535
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C800C8" | 04 00
| 4
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C800C8" | 00 80
| 32768
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C87C64" | 7F FE
| 65151
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#C87C64" | FC 39
| 14844
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#B0C3D4" | 00 00
| 0
| ALIGN=LEFT | unknown
|- ALIGN=CENTER VALIGN=TOP BGCOLOR="#FFEEDD"
| BGCOLOR="#B0C3D4" | 00 00
| 0
| 0
| ALIGN=LEFT | unknown
| ALIGN=LEFT | Bits 0-7 (8 bits) count of something, bits 8-31 (24 bits) index of something. See details below.
|}
|}


 
;Intersected gunk quads
:An octtree leaf (OTLF) stores its size and position and the gunk quads that intersect it. The first field contains an index/count pair that is used to access the first IDXA field that is stored in the [[OBD:AKOT|AKOT]] that owns this leaf. This IDXA contains the gunk quad numbers that intersect the leaf.
:The last field also contains an index/count pair and that one is used to access the second IDXA field of AKOT but what this IDXA contains is currently unknown.
;Position and size
:The position (of leaf's positive corner) is stored as three 9 bit fields. These values are not the x, y and z coordinates themselfs but they are indexes into a constant table. This constant table has 512 entries starting with -4080.0 and going up to 4096.0 in 16 units increments. The size of leaf is stored in a 5 bit field and it is and index into another constant table. This table has 9 entries starting with 16.0 and going up to 4096.0 (each entry is double the previous one). All this leads to the facts that the maximum environment size is (8192.0, 8192.0, 8192.0), the minimum coordinate is (-4096.0, -4096.0, -4096.0) and the maximum coordinate is (4096.0, 4096.0, 4096.0). The minimum leaf size is 16.0 and the maximum leaf size is 4096.0 (this means that there will always be at least 8 leafs because the size of the environment is double).
;Neighbours
:A leaf can have 6 neighbours (one for each face). If a face does not have a neighbour (it's on an environment border) then the coresponding field is -1. If a neighbour field value has its high bit set then the value (without the high bit) is the index of another octtree leaf (this is the case when when the neighbour leaf is equal to or larger than the leaf). If the high bit is not set then the value is an index into a quadtree node array (the [[OBD:QTNA|QTNA]] field of [[OBD:AKOT|AKOT]]) (this is the case when there is more than one leaf neighbour for a face).
;Example
:The above leaf does not intersect any quads, has its maximum corner at (-2048.0, -2048.0, -2048.0), a size of 2048.0, no neighbours for all negative faces (its right in the negative corner of the environment) and positive faces have leafs as neighbours (no quadtree nodes here).
<HR>
<HR>
<CENTER>[[OBD:OTIT|<==]] <B>OTLF File</B> [[OBD:PLEA|==>]]</CENTER>
<CENTER>[[OBD:OTIT|<==]] <B>OTLF File</B> [[OBD:PLEA|==>]]</CENTER>

Revision as of 18:52, 13 March 2007

Main Page >> Oni Binary Data >> File Types >> OTLF File


<== OTLF File ==>
Oct Tree Leaf Node Array - Level File


otlf_a.gif


Hex Translation Meaning
01 45 02 00 581 00581-.OTLF
01 00 00 06 3 level 3
AD DE dead not used
03 49 00 00 18691 18691 packages follow (one package is edged in black)
Below follows the first package.
00 00 00 00 0, 0 Bits 0-11 (12 bits) contain the number of gunk quads that intersect this leaf, bits 12-31 (20 bits) contain the index of the gunk quad list. See details below.
FF FF FF FF -1 negative x neighbour
01 00 00 80 1, high bit positive x neighbour
FF FF FF FF -1 negative y neighbour
02 00 00 80 2, high bit positive y neighbour
FF FF FF FF -1 negative z neighbour
04 00 00 80 4, high bit positive z neighbour
7F FE FC 39 7, 127, 127, 127 Bits 0-8 (9 bits) contain the index of max x, bits 9-17 (9 bits) contain the index of max y, bits 18-26 (9 bits) contain the index of max z and bits 27-31 (5 bits) contain the index of the size of this leaf. See details below.
00 00 00 00 0 Bits 0-7 (8 bits) count of something, bits 8-31 (24 bits) index of something. See details below.
Intersected gunk quads
An octtree leaf (OTLF) stores its size and position and the gunk quads that intersect it. The first field contains an index/count pair that is used to access the first IDXA field that is stored in the AKOT that owns this leaf. This IDXA contains the gunk quad numbers that intersect the leaf.
The last field also contains an index/count pair and that one is used to access the second IDXA field of AKOT but what this IDXA contains is currently unknown.
Position and size
The position (of leaf's positive corner) is stored as three 9 bit fields. These values are not the x, y and z coordinates themselfs but they are indexes into a constant table. This constant table has 512 entries starting with -4080.0 and going up to 4096.0 in 16 units increments. The size of leaf is stored in a 5 bit field and it is and index into another constant table. This table has 9 entries starting with 16.0 and going up to 4096.0 (each entry is double the previous one). All this leads to the facts that the maximum environment size is (8192.0, 8192.0, 8192.0), the minimum coordinate is (-4096.0, -4096.0, -4096.0) and the maximum coordinate is (4096.0, 4096.0, 4096.0). The minimum leaf size is 16.0 and the maximum leaf size is 4096.0 (this means that there will always be at least 8 leafs because the size of the environment is double).
Neighbours
A leaf can have 6 neighbours (one for each face). If a face does not have a neighbour (it's on an environment border) then the coresponding field is -1. If a neighbour field value has its high bit set then the value (without the high bit) is the index of another octtree leaf (this is the case when when the neighbour leaf is equal to or larger than the leaf). If the high bit is not set then the value is an index into a quadtree node array (the QTNA field of AKOT) (this is the case when there is more than one leaf neighbour for a face).
Example
The above leaf does not intersect any quads, has its maximum corner at (-2048.0, -2048.0, -2048.0), a size of 2048.0, no neighbours for all negative faces (its right in the negative corner of the environment) and positive faces have leafs as neighbours (no quadtree nodes here).

<== OTLF File ==>


Main Page >> Oni Binary Data >> File Types >> OTLF File