ROOM (File Format): Difference between revisions
no edit summary
>Aruki No edit summary |
>Aruki No edit summary |
||
Line 1: | Line 1: | ||
The '''ROOM format''' is used to store object layout data in Tropical Freeze. | The '''ROOM format''' is used to store object layout data in Tropical Freeze. | ||
{{research| | {{research|moderate|Still a lot of unknown values and a lot of things that aren't known about how objects interact with each other.}} | ||
__TOC__ | __TOC__ | ||
Line 7: | Line 7: | ||
== Format == | == Format == | ||
=== | {| class="wikitable" | ||
! Type | |||
! Count | |||
! Name | |||
! Notes | |||
|- | |||
| [[Form Descriptor (Tropical Freeze)|Form Descriptor]] | |||
| 1 | |||
| '''ROOM Form Descriptor''' | |||
| Data type is <code>ROOM</code> | |||
|- | |||
| [[#Header|Header]] | |||
| 1 | |||
| '''Header''' | |||
| | |||
|- | |||
| [[#Layer|Layer]] | |||
| Varying | |||
| '''Layers''' | |||
| Each layer is under its own form. Unsure if the format has a layer count anywhere. | |||
|} | |||
=== Header === | |||
{| class="wikitable" | {| class="wikitable" | ||
! Type | ! Type | ||
! | ! Count | ||
! | ! Name | ||
! Notes | |||
|- | |||
| [[Form Descriptor (Tropical Freeze)|Form Descriptor]] | |||
| 1 | |||
| '''Header Descriptor''' | |||
| Data type is <code>HEAD</code> | |||
|- | |||
| [[#Room Header|Room Header]] | |||
| 1 | |||
| '''Room Header''' | |||
| | |||
|- | |||
| [[#Performance Groups|Performance Groups]] | |||
| 1 | |||
| '''Performance Groups''' | |||
| | |||
|- | |||
| [[#Generated Object Map|Generated Object Map]] | |||
| 1 | |||
| '''Generated Object Map''' | |||
| | |||
|- | |||
| [[#Load Unit|Load Unit]] | |||
| Varies | |||
| '''Load Units''' | |||
| Unsure whether there's a count of these | |||
|} | |||
==== Room Header ==== | |||
{| class="wikitable" | |||
! Type | |||
! Count | |||
! Name | |||
! Notes | |||
|- | |- | ||
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | | [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | ||
| | | 1 | ||
| ''' | | '''Room Header Descriptor''' | ||
| Data type is <code>RMHD</code> | |||
|- | |- | ||
| u16 | | u16 | ||
| | | 1 | ||
| {{unknown|'''Unknown''' | | {{unknown|'''Unknown'''}} | ||
| Always 3? | |||
|} | |} | ||
=== | ==== Performance Groups ==== | ||
{| class="wikitable" | {| class="wikitable" | ||
! Type | ! Type | ||
! | ! Count | ||
! | ! Name | ||
! Notes | |||
|- | |- | ||
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | | [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | ||
| | | 1 | ||
| ''' | | '''Performance Groups Descriptor''' | ||
| Data type is <code>PGRP</code> | |||
|- | |- | ||
| u16 | | u16 | ||
| | | 1 | ||
| '''Count''' | | '''Performance Group Count''' | ||
| | |||
|- | |||
| [[#Performance Group|Performance Group]] | |||
| ''Performance Group Count'' | |||
| '''Performance Groups''' | |||
| | |||
|} | |} | ||
===== Performance Group ===== | |||
{| class="wikitable" | {| class="wikitable" | ||
! Type | ! Type | ||
! | ! Count | ||
! | ! Name | ||
! Notes | |||
|- | |- | ||
| u32 | | u32 | ||
| | | 1 | ||
| '''Name | | '''Name Length''' | ||
| | |||
|- | |- | ||
| | | char | ||
| | | ''Name Length'' | ||
| '''Name''' | | '''Performance Group Name''' | ||
| Not zero-terminated | |||
|- | |- | ||
| | | GUID | ||
| | | 1 | ||
| ''' | | '''PerformanceGroupController Instance GUID''' | ||
| | |||
|- | |- | ||
| | | bool | ||
| 1 | | 1 | ||
| {{unknown|'''Unknown'''}} | | {{unknown|'''Unknown'''}} | ||
| | |||
|- | |- | ||
| u16 | | u16 | ||
| | | 1 | ||
| ''' | | '''Layer Count''' | ||
| | |||
|- | |- | ||
| | | GUID | ||
| | | ''Layer Count'' | ||
| ''' | | '''Layer GUIDs''' | ||
| | |||
|} | |} | ||
=== | ==== Generated Object Map ==== | ||
{| class="wikitable" | {| class="wikitable" | ||
! Type | ! Type | ||
! | ! Count | ||
! | ! Name | ||
! Notes | |||
|- | |- | ||
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | | [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | ||
| | | 1 | ||
| ''' | | '''Generated Object Map Descriptor''' | ||
| Data type is <code>LGEN</code> | |||
|- | |- | ||
| u16 | | u16 | ||
| | | 1 | ||
| '''Count''' | | '''Count''' | ||
| | |||
|- | |||
| [[#Generated Object|Generated Object]] | |||
| ''Count'' | |||
| '''Generated Object Array''' | |||
| | |||
|} | |||
===== Generated Object ===== | |||
{| class="wikitable" | |||
! Type | |||
! Count | |||
! Name | |||
! Notes | |||
|- | |||
| GUID | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| | |||
|- | |||
| GUID | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| | |||
|} | |||
==== Load Unit ==== | |||
{| class="wikitable" | |||
! Type | |||
! Count | |||
! Name | |||
! Notes | |||
|- | |||
| [[Form Descriptor (Tropical Freeze)|Form Descriptor]] | |||
| 1 | |||
| '''Load Unit Descriptor''' | |||
| Data type is <code>LUNT</code> | |||
|- | |||
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | |||
| 1 | |||
| '''Load Unit Header Descriptor''' | |||
| Data type is <code>LUHD</code> | |||
|- | |||
| u32 | |||
| 1 | |||
| '''Name Length''' | |||
| | |||
|- | |||
| char | |||
| ''Name Length'' | |||
| '''Load Unit Name''' | |||
| For some reason these seem to generally have really short names (sometimes a single character). | |||
|- | |||
| GUID | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| Probably the GUID for this load unit | |||
|- | |||
| u16 | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| | |||
|- | |||
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | |||
| 1 | |||
| '''Load Unit Resources Descriptor''' | |||
| Data type is <code>LRES</code> | |||
|- | |||
| u32 | |||
| 1 | |||
| '''Resource Count''' | |||
| | |||
|- | |||
| GUID | |||
| ''Resource Count'' | |||
| '''Load Unit Resources Array''' | |||
| Likely a list of all resources that are used by this load unit. | |||
|- | |||
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | |||
| 1 | |||
| '''Load Unit Layers Descriptor''' | |||
| Data type is <code>LLYR</code> | |||
|- | |||
| u32 | |||
| 1 | |||
| '''Layer Count''' | |||
| | |||
|- | |||
| GUID | |||
| ''Layer Count'' | |||
| '''Load Unit Layers Array''' | |||
| Likely a list of all layers that are part of this load unit. (Note that it seems layers can be included in multiple load units.) | |||
|} | |} | ||
==== Layer ==== | |||
{| class="wikitable" | {| class="wikitable" | ||
! Type | ! Type | ||
! | ! Count | ||
! | ! Name | ||
! Notes | |||
|- | |- | ||
| | | [[Form Descriptor (Tropical Freeze)|Form Descriptor]] | ||
| | | 1 | ||
| ''' | | '''Layer Form Descriptor''' | ||
| Data type is <code>LAYR</code> | |||
|- | |- | ||
| | | [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | ||
| | | 1 | ||
| '''ID''' | | '''Layer Header Descriptor''' | ||
| Data type is <code>LHED</code> | |||
|- | |||
| u32 | |||
| 1 | |||
| '''Name Length''' | |||
| | |||
|- | |||
| char | |||
| ''Name Length'' | |||
| '''Layer Name''' | |||
| | |||
|- | |||
| GUID | |||
| 1 | |||
| '''Layer ID''' | |||
| | |||
|- | |||
| u8 | |||
| 21 | |||
| {{unknown|'''Unknown Data'''}} | |||
| This section is usually entirely 0s so not sure what the structure of it is. | |||
|- | |||
| [[Form Descriptor (Tropical Freeze)|Form Descriptor]] | |||
| 1 | |||
| {{unknown|'''Unknown Descriptor'''}} | |||
| Data type is <code>GSRP</code>. Often has a size of 0. | |||
|- | |||
| [[Form Descriptor (Tropical Freeze)|Form Descriptor]] | |||
| 1 | |||
| '''Script Descriptor''' | |||
| Data type is <code>SRIP</code> | |||
|- | |||
| [[#Game Object Component|Game Object Component]] | |||
| Varies | |||
| '''Components''' | |||
| Unsure if there is a layer component count. | |||
|} | |} | ||
=== | ===== Game Object Component ===== | ||
{| class="wikitable" | {| class="wikitable" | ||
! Type | ! Type | ||
! | ! Count | ||
! | ! Name | ||
! Notes | |||
|- | |- | ||
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | | [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | ||
| | | 1 | ||
| ''' | | '''Component Descriptor''' | ||
| Data type is <code>COMP</code> | |||
|- | |- | ||
| u32 | | u32 | ||
| | | 1 | ||
| ''' | | '''[[#Component Types|Component Type]]''' | ||
| This appears to be a hash of the component name. | |||
|- | |- | ||
| | | GUID | ||
| | | 1 | ||
| '''Instance ID''' | | '''Instance ID''' | ||
| | |||
|- | |- | ||
| u32 | | u32 | ||
| | | 1 | ||
| ''' | | '''Name Length''' | ||
| | |||
|- | |- | ||
| | | char | ||
| | | ''Name Length'' | ||
| '''Instance | | '''Instance Name''' | ||
| | |||
|} | |||
The remaining data seems to have two structures; one that's used by most objects and one that's specific to GameObject components. | |||
'''Regular structure:''' | |||
{| class="wikitable" | |||
! Type | |||
! Count | |||
! Name | |||
! Notes | |||
|- | |- | ||
| u16 | | u16 | ||
| | | 1 | ||
| '''Connection | | '''Connection Count''' | ||
| | |||
|- | |||
| [[#Connection|Connection]] | |||
| ''Connection Count'' | |||
| '''Connection Array''' | |||
| These establish links to other components to allow them to interact | |||
|- | |||
| u32 | |||
| 1 | |||
| '''Property Count''' | |||
| | |||
|- | |||
| [[#Property|Property]] | |||
| ''Property Count'' | |||
| '''Object Properties''' | |||
| | |||
|} | |||
'''GameObject structure:''' | |||
{| class="wikitable" | |||
! Type | |||
! Count | |||
! Name | |||
! Notes | |||
|- | |||
| u32 | |||
| 1 | |||
| '''Sub-Component Count''' | |||
| | |||
|- | |||
| [[#Sub-Component|Sub-Component]] | |||
| ''Sub-Component Count'' | |||
| '''Sub-Component Array''' | |||
| Seems to describe other script components that are children of this one. | |||
|- | |||
| bool | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| This is likely the Active flag that appears on every object in the previous games. | |||
|- | |||
| vector3 | |||
| 1 | |||
| '''Position''' | |||
| | |||
|- | |||
| vector3 | |||
| 1 | |||
| '''Rotation''' | |||
| Euler XYZ angles in degrees (presumably in ZYX order like the previous games). | |||
|- | |||
| vector3 | |||
| 1 | |||
| '''Scale''' | |||
| | |||
|} | |} | ||
====== Connection ====== | |||
{| class="wikitable" | {| class="wikitable" | ||
! Type | ! Type | ||
! | ! Count | ||
! | ! Name | ||
! Notes | |||
|- | |- | ||
| char | |||
| char | |||
| 4 | | 4 | ||
| ''' | | '''Event''' | ||
| This is the event that causes the connection to trigger. (These are what were called States in the previous games.) | |||
|- | |- | ||
| char | |||
| char | |||
| 4 | | 4 | ||
| ''' | | '''Action''' | ||
| Action that the connected object should execute when the connection triggers. (These are what were called Messages in the previous games.) | |||
|- | |- | ||
| | | GUID | ||
| | | 1 | ||
| '''Target Instance ID''' | | '''Target Instance ID''' | ||
| Instance ID of the target object that | |||
|- | |- | ||
| u32 | | u32 | ||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| | |||
|} | |||
====== Property ====== | |||
{| class="wikitable" | |||
! Type | |||
! Count | |||
! Name | |||
! Notes | |||
|- | |||
| u32 | |||
| 1 | |||
| '''Property ID''' | |||
| 32-bit hash of the property name. | |||
|- | |||
| u16 | |||
| 1 | |||
| '''Property Size''' | |||
| | |||
|- | |||
| {{unknown|}} | |||
| {{unknown|}} | |||
| '''Property Data''' | |||
| Varies depending on the type of the property (which is hardcoded depending on the property ID). | |||
|} | |||
====== Sub-Component ====== | |||
This structure is used to define sub-components that are attached to GameObject components. | |||
{| class="wikitable" | |||
! Type | |||
! Count | |||
! Name | |||
! Notes | |||
|- | |||
| char | |||
| 4 | | 4 | ||
| '''Type''' | |||
| Usually <code>COMP</code>, but sometimes other things like <code>IL00</code>. Not sure what it means. | |||
|- | |||
| GUID | |||
| 1 | |||
| '''Component ID''' | |||
| | |||
|- | |||
| bool | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | | {{unknown|'''Unknown'''}} | ||
| Might be an Active/Enabled flag. | |||
|} | |} | ||
== Component Types == | |||
{| class="wikitable" | {| class="wikitable" |