TREE (File Format)

Revision as of 22:07, 14 September 2015 by >Aruki

The TREE format is used to set up the pause menu hierarchy in Metroid Prime 2: Echoes. It's found in 95b61279.DUMB in LogBook.pak. The format name comes from the TREE fourCC at the beginning of the file.


This file format is almost completely documented
Unknown properties on SCSL and SCMN.


Format

After the file header, the TREE format embeds a script layer using the scriptable layers format.

Header

Offset Type Name Notes
0x0 char[4] Magic TREE
0x4 u32 Root Node Index Points to a SCND object named RootTreeNode.
0x8 u8 Unknown Value is 1
0x9 u32 Instance Count

Script Objects

The TREE format uses script objects to set up the hierarchy. There are five object types present, each representing a different node type in the hierarchy: a category, a scan, an inventory item description, an options slider, or an options menu. There are a few common parameters to all these object types:

  • They all include EditorProperties, which contains an instance name, an "active" flag, and a position/rotation/scale, even though none of them actually needs it.
  • Every node has a name. In the data, this is represented with a resource ID for a STRG file that the name of one of the strings in that file. The name is used to look up the actual string, which is then displayed ingame in the pause menu.

SCND (Category)

The SCND object represents a category. Categories don't have very many properties; they do most of their work through the connections system instead. Category nodes are able to use their connections to mark other nodes as children. They do this by sending the message Attach (ATCH) to the target child node on state Connect (CONN). The progress bars that appear on the right side of the

Property ID Type Name
0x255A4580 struct EditorProperties
0x46219BAC STRG Name String Table
0x32698BD6 string Name String Name

SCSN (Scan)

SCSN represents a scan node in the logbook. They're initially invisible, but they appear when the player obtains the corresponding scan.

Property ID Type Name
0x255A4580 struct EditorProperties
0x46219BAC STRG Name String Table
0x32698BD6 string Name String Name
0x2DA1EC33 struct ScannableParameters

SCIN (Inventory)

SCIN works basically the same way as SCSN, except it's used to display descriptions of inventory items instead of logbook scans. The main difference is that SCIN nodes have an inventory slot parameter; they're initially hidden, and they appear when the player collects an upgrade in the corresponding slot.

Property ID Type Name
0x255A4580 struct EditorProperties
0x46219BAC STRG Name String Table
0x32698BD6 string Name String Name
0x3D326F90 enum Inventory Slot
0x2DA1EC33 struct ScannableParameters

SCSL (Slider)

SCSL is used to represent a slider for the options menu.

Property ID Type Name
0x255A4580 struct EditorProperties
0x46219BAC STRG Name String Table
0x32698BD6 string Name String Name
0x0261A4E0 u32 Unknown

SCMN (Menu)

SCMN represents a multiple-choice menu for the options menu. It supports up to four menu options, although the game only uses three.

Property ID Type Name
0x255A4580 struct EditorProperties
0x46219BAC STRG Name String Table
0x32698BD6 string Name String Name
0x0261A4E0 u32 Unknown
0xA6A874E9 STRG Menu Options String Table
0x30531924 string Option 1 String Name
0x50BCE632 u32 Unknown
0x01BB03B9 string Option 2 String Name
0x420949DC u32 Unknown
0xA7CC080D string Option 3 String Name
0xFAB52EB9 u32 Unknown
0x626B3683 string Option 4 String Name
0x67621600 u32 Unknown