MLVL (File Format): Difference between revisions

→‎Area Dependencies: Updates this section with the results of my research into recreating MP2's dependencies as accurately as possible. I've overwritten the previous note about ANCS per-character dependencies - I'm assuming that it works the same way in MP1, but I haven't confirmed that. I have confirmed the behavior for MP2.
>Aruki
No edit summary
(→‎Area Dependencies: Updates this section with the results of my research into recreating MP2's dependencies as accurately as possible. I've overwritten the previous note about ANCS per-character dependencies - I'm assuming that it works the same way in MP1, but I haven't confirmed that. I have confirmed the behavior for MP2.)
 
(11 intermediate revisions by 3 users not shown)
Line 273: Line 273:
| u32
| u32
| 1
| 1
| '''Layer State ID Count'''
| '''Layer GUID Count'''
| Count of layer state IDs in the next array.
| Count of layer GUIDs in the next array.
| {{nocheck}}
| {{nocheck}}
| {{nocheck}}
| {{nocheck}}
Line 280: Line 280:
| {{check}}
| {{check}}
|-
|-
| [[Saved State ID]]
| [[GUID]]
| ''Layer State ID Count''
| ''Layer GUID Count''
| '''Layer State ID Array'''
| '''Layer GUID Array'''
| Array of saved state IDs for each layer. These IDs are responsible for storing the layer's active state in the save file and are referenced by ScriptLayerController objects.
| Array of GUIDs for each layer. These GUIDs are responsible for storing the layer's ''Active'' state in the save file and are referenced by ScriptLayerController objects.
| {{nocheck}}
| {{nocheck}}
| {{nocheck}}
| {{nocheck}}
Line 362: Line 362:
| Script message sent to the receiver object.
| Script message sent to the receiver object.
|-
|-
| 0x10
| 0xA
| bool
| bool
| '''Active'''
| '''Active'''
| Whether this Memory Relay object is active by default; almost always 0.
| Whether this Memory Relay object is active by default; almost always 0.
|-
|-
| 0x11
| 0xB
| colspan=3 {{unknown|End of Memory Relay connection}}
| colspan=3 {{unknown|End of Memory Relay connection}}
|}
|}
Line 397: Line 397:
| 12
| 12
| '''Area Transform'''
| '''Area Transform'''
| Area's transform matrix. Most area data is pre-transformed, but there are a few things that need to be transformed by this array.
| Area's transform matrix. Most area data is pre-transformed, but there are a few things that need to be transformed by this matrix.
| {{check}}
| {{check}}
| {{check}}
| {{check}}
Line 460: Line 460:
| 1
| 1
| '''Dock Count'''
| '''Dock Count'''
| Count of Dock instances in this area. Should be equal to the attached area count.
| Count of Dock instances in this area.
| {{check}}
| {{check}}
| {{check}}
| {{check}}
Line 496: Line 496:
| 1
| 1
| '''Internal Area Name'''
| '''Internal Area Name'''
| Internal name of this area. Does not appear ingame.
| Internal name of this area. This name will be used ingame on the map screen if no ''Area Name ID'' is specified, prefixed with "!!".
| {{nocheck}}
| {{nocheck}}
| {{check}}
| {{check}}
Line 509: Line 509:
This is a data chunk appearing in the area definition in Metroid Prime 1 and 2 that lists all assets needed to load the area. It's extremely important that this list be optimized and complete, as all assets listed here will be perpetually kept in memory as long as the area itself is in memory; the list also specifies the order that assets are loaded in, so '''it must be grouped by load order to roughly match the [[PAK (File Format)|PAK]] file for optimized load times'''. Assets that are missing will still be dynamically loaded after the area itself is loaded, but this will cause the game to freeze up until the load is finished. There are a few exceptions that are excluded from this list in the original game files (and should be excluded in custom MLVLs as well to avoid out-of-memory crashes):
This is a data chunk appearing in the area definition in Metroid Prime 1 and 2 that lists all assets needed to load the area. It's extremely important that this list be optimized and complete, as all assets listed here will be perpetually kept in memory as long as the area itself is in memory; the list also specifies the order that assets are loaded in, so '''it must be grouped by load order to roughly match the [[PAK (File Format)|PAK]] file for optimized load times'''. Assets that are missing will still be dynamically loaded after the area itself is loaded, but this will cause the game to freeze up until the load is finished. There are a few exceptions that are excluded from this list in the original game files (and should be excluded in custom MLVLs as well to avoid out-of-memory crashes):


* [[SCAN (File Format)|SCAN]] files and their dependencies are not included in the list. These are loaded dynamically after the area itself is finished loading.
* Some [[AGSC (File Format)|AGSC]] files are not included in MP2. The game has specific DGRP files which include the "global" sound effects for that type of world. Any files inside that DGRP are excluded from the list. These are:
* [[ANCS (File Format)|ANCS]] per-character dependencies for PlayerActor script instances are not included; this allows the game to avoid keeping assets in memory for suits that the player doesn't have. The exception is the Empty Suit character (character index 5), which is a low-memory-overhead character that allows for the list to include all common assets that are stored in the file per-character (such as particle effects).
** Single-player worlds: ''AudioGrp/audio_groups_single_player_DGRP.DGRP''
** Multiplayer worlds: ''AudioGrp/audio_groups_multi_player_DGRP.DGRP''
** Frontend: ''AudioGrp/audio_groups_front_end_DGRP.DGRP''
* [[SCAN (File Format)|SCAN]] files and their dependencies are not included in the list in MP1. These are loaded dynamically after the area itself is finished loading, presumably so that scan dependencies are not kept in memory when the scan isn't actually in use. In MP2, SCANs are actually included in the list but their dependencies aren't. Make sure to update the dependency list inside the SCAN file if you change them - the game may crash when scanning otherwise.
* Script instances with an AnimationParameters property only include the dependencies from their [[ANCS (File Format)|ANCS]] which are used by their character index. This includes:
** Any dependencies in the CharacterSet for that character
** Any [[ANIM (Metroid Prime)|ANIM]]s (and [[EVNT (File Format)|EVNT]]s, for MP1) used by that character's animations
** Any valid [[AGSC (File Format)|AGSC]] dependencies in any animation events used by that character, '''including''' events with a character index of -1.
** Any [[Particle Script|Particle Script]] dependencies in any animation events used by that character, '''not including''' events with a character index of -1.
** Any dependencies of '''all''' [[Meta-Transition|Meta-Transition]]s in the ANCS. '''This includes transitions not used by that character!'''
* The skybox model and its dependencies are not included.
* The skybox model and its dependencies are not included.


Line 522: Line 531:
! Name
! Name
! Notes
! Notes
|-
| u32
| 1
| {{unknown|Unknown}}
| Always 0?
|-
|-
| u32
| u32
Line 541: Line 555:
| ''Dependency Offset Count''
| ''Dependency Offset Count''
| '''Dependency Offset Array'''
| '''Dependency Offset Array'''
| Array of offsets into the dependency array. There is one offset per script layer, with the offset referring to the index of that layer's first dependency. There is a final extra offset that points to area dependencies that are not layer-specific.
| Array of offsets into the dependency array. There is one offset per script layer, with the offset referring to the index of that layer's first dependency. There is a final extra offset that points to area dependencies that are not layer-specific. These include dependencies of the world geometry, as well as the PATH, PTLA, and EGMC dependencies from their respective sections. Note that the area name STRG is not included (at least in MP2).
|}
|}


Line 558: Line 572:
|-
|-
| 0x4
| 0x4
| char
| {{FourCC}}
| 4
| 1
| '''Dependency Asset Type'''
| '''Dependency Asset Type'''
|}
|}
Line 604: Line 618:
| '''Area Index'''
| '''Area Index'''
| Index of the area this dock is in.
| Index of the area this dock is in.
|
|-
|-
| 0x4
| 0x4
| u32
| u16
| '''Dock Index'''
| '''Dock Index'''
| Index of this dock within its area.
| Index of this dock within its area.
|-
| 0x6
| u16
| '''Load other'''
| TODO
|}
|}


11

edits