MREA (Metroid Prime 3): Difference between revisions

>Aruki
>Aruki
 
(11 intermediate revisions by the same user not shown)
Line 3: Line 3:
The '''MREA format''', which defines areas/levels, received another large layout overhaul in Metroid Prime 3. The level geometry data received the biggest update, with a new material format, lot of things being moved around, and a few entirely new sections being introduced. This article covers Metroid Prime 3, the MP3 E3 prototype, and Donkey Kong Country Returns.
The '''MREA format''', which defines areas/levels, received another large layout overhaul in Metroid Prime 3. The level geometry data received the biggest update, with a new material format, lot of things being moved around, and a few entirely new sections being introduced. This article covers Metroid Prime 3, the MP3 E3 prototype, and Donkey Kong Country Returns.


{{research|moderate|There are a few sections we know nothing about.}}
{{research|moderate|Research needed on the area octree and visibility tree sections to verify structure and check for version differences. Also the purpose of the LLTE section is unknown.}}


__TOC__
__TOC__
Line 147: Line 147:
|}
|}


<code>WOBJ</code> can be listed multiple times, but its section index is always 0 (pointing to the materials section). Every other section number always appears in every MREA file once (none are optional). Here are all possible section numbers and what they are, in the order that they appear in the file:
<code>WOBJ</code> can be listed multiple times, but its section index is always 0 (pointing to the materials section). Every other section number always appears in every MREA file once (none are optional). Here are all possible section numbers and what they are, in the order that they appear in the file: (note this is both the order the section numbers are listed in as well as the order that the sections themselves appear in the file)


{| class="wikitable"
{| class="wikitable"
Line 176: Line 176:
|-
|-
| <code>DEPS</code>
| <code>DEPS</code>
| Dependencies
| [[#Dependencies|Dependencies]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>SOBJ</code>
| <code>SOBJ</code>
| Script Layers
| [[#Script Layers|Script Layers]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>SGEN</code>
| <code>SGEN</code>
| Generated Script Objects
| [[#Generated Script Objects|Generated Script Objects]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>COLI</code>
| <code>COLI</code>
| Collision
| [[#Collision|Collision]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>LITE</code>
| <code>LITE</code>
| Lights
| [[#Lights|Lights]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>LLTE</code>
| <code>LLTE</code>
| {{unknown|Unknown}}
| {{unknown|[[#Unknown Section (LLTE)|Unknown]]}}
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>PVS!</code>
| <code>PVS!</code>
| Visibility Tree
| [[#Visibility Tree|Visibility Tree]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>RSOS</code>
| <code>RSOS</code>
| RSO Module List
| [[#RSO Module List|RSO Module List]]
| {{check}}
| {{check}}
| {{check}}
| {{check}}
|-
|-
| <code>PFL2</code>
| <code>PFL2</code>
| Path
| [[#Path|Path]]
| {{check}}
| {{check}}
| {{nocheck}}
| {{nocheck}}
|-
|-
| <code>APTL</code>
| <code>APTL</code>
| Portal Area
| [[#Portal Area|Portal Area]]
| {{check}}
| {{check}}
| {{nocheck}}
| {{nocheck}}
|-
|-
| <code>EGMC</code>
| <code>EGMC</code>
| Static Geometry Map
| [[#Static Geometry Map|Static Geometry Map]]
| {{check}}
| {{check}}
| {{nocheck}}
| {{nocheck}}
Line 252: Line 252:


=== GPU Data ===
=== GPU Data ===
''See [[Geometry (Metroid Prime)]] or [[Geometry (Donkey Kong Country Returns)]]''
This section contains the GPU buffer data used to render world geometry. This is generally the same as in previous games, with the following sequence of sections repeated once per world model:
This section contains the GPU buffer data used to render world geometry. This is generally the same as in previous games, with the following sequence of sections repeated once per world model:


Line 257: Line 259:
* '''Normals''': Always floats; world geometry normals are never packed into shorts.
* '''Normals''': Always floats; world geometry normals are never packed into shorts.
* '''Colors''': Contains 32-bit RGBA8 colors. This section is not used in any official assets and is always zeroed out.
* '''Colors''': Contains 32-bit RGBA8 colors. This section is not used in any official assets and is always zeroed out.
* '''Float UV Coordinates''': In Metroid Prime 3, these are used exclusively, even for lightmaps.
* '''Float UV Coordinates''': In Metroid Prime 3, this is the only UV coordinates section, so it's used for everything.
* '''Short UV Coordinates''': Only appears in Donkey Kong Country Returns; can be used for anything, not only lightmaps as in previous games.
* '''Short UV Coordinates''': Only appears in Donkey Kong Country Returns; can be used for anything, not only lightmaps as in previous games.
* '''Surfaces''': One section per surface.
* '''Surfaces''': One section per surface. For details on the structure of these sections check [[Geometry (Metroid Prime)#Surface|Geometry (Metroid Prime)]] page for MP3 and the [[Geometry (Donkey Kong Country Returns)#Surface|Geometry (Donkey Kong Country Returns)]] page for DKCR.
 
=== Dependencies ===
 
{{research|minor|How does this section work with SCGN?}}
 
This section is basically a list of all resources that this area depends on, not unlike a [[DGRP (File Format)|DGRP]] file. After the initial dependency list, there's a second array which provides a list of offsets into the dependency list. These offsets are used to indicate which dependencies are needed for individual script layers, with the last offset pointing to resources that are used by the area itself as a whole (world geometry textures and the [[#Path|PATH]]/[[#Portal Area|PTLA]]/[[#Static Geometry Map|EGMC]] assets).
 
[[STRM (File Format)|STRM]] assets are not included in this list.
 
{| class="wikitable"
! Type
! Count
! Name
! Notes
|-
| u32
| 1
| '''Dependency Count'''
| Count of dependencies in the next array.
|-
| [[#Dependency|Dependency]]
| ''Dependency Count''
| '''Dependency List'''
| List of resources used by this area.
|-
| u32
| 1
| '''Offset Count'''
| Count of offsets in the next array. Should be equal to the script layer count + 1.
|-
| u32
| ''Offset Count''
| '''Dependency List Offsets'''
| Each element is an offset into the dependency list to indicate where the dependencies for individual script layers begins. There's one offset per script layer, then the last offset points to resources used by the area itself outside of script layers.
|-
| colspan=5 {{unknown|End of dependencies section}}
|}
 
==== Dependency ====
 
{| class="wikitable"
! Offset
! Type
! Count
! Name
|-
| 0x0
| Asset ID
| 1
| '''Dependency Asset ID'''
|-
| 0x8
| char
| 4
| '''Dependency Asset Type'''
|-
| 0xC
| colspan=3 {{unknown|End of dependency}}
|}
 
=== Script Layers ===
 
{{todo|This section is known, needs documentation written}}
 
=== Generated Script Objects ===
 
{{todo|Almost identical to script layers but there are some slight differences in the header}}
 
This section is an extra [[#Script Layers|script layer]] that contains generated objects (anything spawned by a Generator).
 
=== Collision ===
 
''Main article: [[Area Collision (File Format)]]''
 
=== Lights ===
''See [[Lights (Metroid Prime)]]
 
=== Unknown Section (LLTE) ===
 
This section always contains just a single 32-bit 1. It doesn't appear to do anything, so the purpose of this section is unknown.
 
=== Visibility Tree ===
 
{{research|major|This section is largely unknown}}
 
=== RSO Module List ===
 
This section is a list of RSO modules used by script objects in the area. Like the dependencies section, there's also a list of offsets to indicate which RSOs are used by each script layer.
 
{| class="wikitable"
! Type
! Count
! Name
! Notes
|-
| u32
| 1
| '''RSO Count'''
| Count of RSO modules listed in the next array.
|-
| string
| ''RSO Count''
| '''RSO Module List'''
| This is a series of zero-terminated strings. Each string is the filename of a .rso file.
|-
| u32
| 1
| '''Offset Count'''
| Count of offsets in the next array. Should be equal to the script layer count * 2.
|-
| u32
| ''Offset Count''
| '''RSO Module List Offsets'''
| Each element is an offset into the RSO module list to indicate which modules are required by each script layer. For some reason there are two offsets per script layer.
|-
| colspan=4 {{unknown|End of RSOs section}}
|}
 
=== Path ===
 
This section only contains a single [[PATH (File Format)|PATH]] asset ID.
 
{| class="wikitable"
! Type
! Count
! Name
|-
| Asset ID
| 1
| '''Area PATH Resource'''
|-
| colspan=3 {{unknown|End of section}}
|}
 
=== Portal Area ===
 
This section only contains a single [[PTLA (File Format)|PTLA]] asset ID.
 
{| class="wikitable"
! Type
! Count
! Name
|-
| Asset ID
| 1
| '''Area PTLA Resource'''
|-
| colspan=3 {{unknown|End of section}}
|}
 
=== Static Geometry Map ===
 
This section only contains a single [[EGMC (File Format)|EGMC]] asset ID.
 
{| class="wikitable"
! Type
! Count
! Name
|-
| Asset ID
| 1
| '''Area EGMC Resource'''
|-
| colspan=3 {{unknown|End of section}}
|}


[[Category:File Formats]]
[[Category:File Formats]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Donkey Kong Country Returns]]
[[Category:Donkey Kong Country Returns]]
Anonymous user