MREA (Metroid Prime 2): Difference between revisions

Jump to navigation Jump to search
>Aruki
>Aruki
Line 188: Line 188:


The actual data contained in these blocks is padded to 32 bytes, but their padding is located at the beginning of the block rather than the end, so it's required to account for the padding before you start decompressing. Thee data is compressed using segmented LZO1X-999; the "segmented" part means there's multiple segments of data that are compressed/decompressed separately. Each segment starts with a 16-bit size value. The size value is signed; a negative value indicates the segment is not compressed (this is done when compressing a segment doesn't reduce its size). Each segment is 0x4000 bytes large when decompressed (except the last one).
The actual data contained in these blocks is padded to 32 bytes, but their padding is located at the beginning of the block rather than the end, so it's required to account for the padding before you start decompressing. Thee data is compressed using segmented LZO1X-999; the "segmented" part means there's multiple segments of data that are compressed/decompressed separately. Each segment starts with a 16-bit size value. The size value is signed; a negative value indicates the segment is not compressed (this is done when compressing a segment doesn't reduce its size). Each segment is 0x4000 bytes large when decompressed (except the last one).
=== Data Sections ===
==== World Geometry ====
''See [[MREA (Metroid Prime)#World Geometry]], [[Materials (Metroid Prime)]] and [[Geometry (Metroid Prime)]]''
Largely [[MREA (Metroid Prime)#World Geometry|the same as Prime 1]]. There are two new sections to watch out for on each world model (described on the [[Geometry (Metroid Prime)]] page). There's two sections that are now grouped under the same section number as world geometry.
The first is the [[MREA (Metroid Prime)#Area Octree|area octree]] section, which is back from Prime 1 but no longer has its own section number.
The second section is an array of a structure that provides the bounding box for every surface group. The first entry in the array has the combined bounding box for all of the world geometry in the entire area, then each surface group is listed in order.
{| class="wikitable"
! Type
! Count
! Name
! Notes
|-
| u32
| 1
| '''Group Bounds Entry Count'''
| Count of elements in the following array.
|-
| [[#Group Bounds|Group Bounds Entry]]
| ''Group Bounds Entry Count''
| '''Group Bounds Entry Array'''
| Array of a struct that provides the bounding box for each surface group in the area.
|}
===== Group Bounds Entry =====
{| class="wikitable"
! Offset
! Type
! Count
! Name
! Notes
|-
| 0x0
| float
| 6
| '''Group Bounding Box'''
| Axis-aligned bounding box of all surfaces contained in the group.
|-
| 0x18
| u16
| 1
| '''World Model Index'''
| Index of the world model that contains this group.
|-
| 0x1A
| u16
| 1
| '''Surface Group Index'''
| Model-relative index of the surface group.
|-
| 0x1C
| u16
| 1
| {{unknown|Unknown}}
| On the first entry, always 1. On other entries, always -1.
|-
| 0x1E
| u16
| 1
| {{unknown|Unknown}}
| On the first entry, always -1. On other entries, always the entry's index position + 1.
|-
| 0x20
| colspan=4 {{unknown|End of bounds entry}}
|}


[[Category:File Formats]]
[[Category:File Formats]]
[[Category:Metroid Prime 2: Echoes]]
[[Category:Metroid Prime 2: Echoes]]
Anonymous user

Navigation menu