SCAN (Metroid Prime 2): Difference between revisions

From Retro Modding Wiki
Jump to navigation Jump to search
>Aruki
mNo edit summary
>Aruki
No edit summary
Line 1: Line 1:
''This article is for the SCAN format from Metroid Prime 2 and 3. For other revisions of this format, see [[SCAN (File Format)]].''
''This article is for the SCAN format from Metroid Prime 2 and 3. For other revisions of this format, see [[SCAN (File Format)]].''


The '''.SCAN file format''' describes SCAN POI data and has references to several resources. This variation of the format is completely different than its [[SCAN (Metroid Prime)|Metroid Prime]] counterpart.
The '''SCAN file format''' describes scannable objects. The format's been updated since Prime 1; the data is now embedded into a script object, using the [[Scriptable Layers (Metroid Prime 2)|scriptable layers]] format. There was also some additional data added to the format to set up the model that displays in the logbook.


{{research|3|Crack SNFO}}
{{research|minor|There's a couple remaining unknown parameters.}}


__TOC__
__TOC__


== Header ==
== Format ==
The header is rather simple and consists of the following:
 
{|class="wikitable"
The SCAN format sets up a small script layer that contains a single [[#ScannableObjectInfo|ScannableObjectInfo]] instance.
!Offset
 
!Size
=== Header ===
!Description
 
{| class="wikitable"
! Offset
! Size
! Description
|-
| 0x0
| 4
| '''Magic'''; always <code>SCAN</code>
|-
| 0x4
| 4
| {{unknown|Unknown; always 2}}
|-
| 0x8
| 1
| {{unknown|Unknown}}
|-
| 0x9
| 4
| '''Instance count'''; always 1
|}
 
=== ScannableObjectInfo ===
 
This section of the file embeds a ScannableObjectInfo script object.
 
{| class="wikitable"
! Offset
! Size
! Description
|-
| 0x0
| 4
| '''Object type'''; always <code>SNFO</code>
|-
| 0x4
| 2
| '''Instance size'''
|-
| 0x6
| 4
| '''Instance ID'''; always 0
|-
| 0xA
| 2
| '''Connection count'''; always 0
|-
| 0xC
| 4
| '''Base property ID'''; always 0xFFFFFFFF
|-
| 0x10
| 2
| '''Base property size'''
|-
| 0x12
| 2
| '''Property count'''; 0x14 for Prime 2, 0x16 for Prime 3
|}
 
==== Properties (Echoes) ====
 
These are all the properties a ScannableObjectInfo instance contains:
 
{| class="wikitable"
! ID
! Type
! Name
|-
| 0x2F5B6423
| [[STRG (Metroid Prime)|STRG]]
| Scan Text
|-
| 0xC308A322
| long
| Scan Speed (0 for fast, 1 for slow)
|-
| 0x7B714814
| bool
| Is Important? (0 for blue, 1 for red)
|-
| 0x1733B1EC
| bool
| Use Logbook Model After Scan?
|-
| 0x53336141
| [[CMDL (Metroid Prime)|CMDL]]
| {{unknown|Unknown}}
|-
| 0x3DE0BA64
| float
| Logbook Default X Rotation
|-
| 0x2ADD6628
| float
| Logbook Default Z Rotation
|-
| 0xD0C15066
| float
| Logbook Scale
|-
| 0xB7ADC418
| [[CMDL (Metroid Prime)|CMDL]]
| Logbook Model
|-
| 0x15694EE1
| [[AnimationParameters]]
| Logbook AnimSet
|-
| 0x58F9FE99
| [[AnimationParameters]]
| {{unknown|Unknown}}
|-
| 0x1C5B4A3A
| [[#Attachment|Attachment]]
| Attachment 1
|-
| 0x8728A0EE
| [[#Attachment|Attachment]]
| Attachment 2
|-
| 0xF1CD99D3
| [[#Attachment|Attachment]]
| Attachment 3
|-
| 0x6ABE7307
| [[#Attachment|Attachment]]
| Attachment 4
|-
|-
|0x0
| 0x1C07EBA9
|4
| [[#Attachment|Attachment]]
|'''Magic''' FourCC
| Attachment 5
|-
|-
|0x4
| 0x8774017D
|4
| [[#Attachment|Attachment]]
|'''Version''' Always 2, no matter what game
| Attachment 6
|-
|-
|0x8
| 0xF1913840
|1
| [[#Attachment|Attachment]]
|{{unknown|Boolean?}}
| Attachment 7
|-
|-
|0x9
| 0x6AE2D294
|4
| [[#Attachment|Attachment]]
|{{unknown|Unknown}}
| Attachment 8
|-
| 0x1CE2091C
| [[#Attachment|Attachment]]
| Attachment 9
|}
|}


== SNFO Chunk ==
==== Attachment ====
The SNFO header is simply a FourCC and the total length in bytes. Due to the fact that there is nothing in the header to determine which version of SCAN we're working with, we have to rely on the size of the SNFO chunk. If it's less than 0x0251 bytes, it's Metroid Prime 2. Otherwise it's Metroid Prime 3.
 
This struct is used to embed a resource that can be attached to the model in the logbook. The mesh can be either a [[CMDL (Metroid Prime)|model]] or an [[ANCS (File Format)|animset]].
 
{| class="wikitable"
! ID
! Type
! Name
|-
| 0x1F7921BC
| [[CMDL (Metroid Prime)|CMDL]]
| Attachment Model
|-
| 0xCDD202D1
| [[AnimationParameters]]
| Attachment AnimSet
|-
| 0x3EA2BED8
| string
| Target Bone Name
|}


Other than that, SNFO is entirely unknown.
=== Dependencies ===


== Dependency List ==
After the ScannableObjectInfo instance, there's a list of the scan's dependencies present. The list follows the same format as the [[DGRP (File Format)|DGRP]] format.
The dependency list follows the same format as [[DGRP (File Format)|DGRP]]


[[Category:File Formats]]
[[Category:File Formats]]
[[Category:Metroid Prime 2: Echoes]]
[[Category:Metroid Prime 2: Echoes]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Major research needed]]

Revision as of 16:33, 22 July 2015

This article is for the SCAN format from Metroid Prime 2 and 3. For other revisions of this format, see SCAN (File Format).

The SCAN file format describes scannable objects. The format's been updated since Prime 1; the data is now embedded into a script object, using the scriptable layers format. There was also some additional data added to the format to set up the model that displays in the logbook.


This file format is almost completely documented
There's a couple remaining unknown parameters.


Format

The SCAN format sets up a small script layer that contains a single ScannableObjectInfo instance.

Header

Offset Size Description
0x0 4 Magic; always SCAN
0x4 4 Unknown; always 2
0x8 1 Unknown
0x9 4 Instance count; always 1

ScannableObjectInfo

This section of the file embeds a ScannableObjectInfo script object.

Offset Size Description
0x0 4 Object type; always SNFO
0x4 2 Instance size
0x6 4 Instance ID; always 0
0xA 2 Connection count; always 0
0xC 4 Base property ID; always 0xFFFFFFFF
0x10 2 Base property size
0x12 2 Property count; 0x14 for Prime 2, 0x16 for Prime 3

Properties (Echoes)

These are all the properties a ScannableObjectInfo instance contains:

ID Type Name
0x2F5B6423 STRG Scan Text
0xC308A322 long Scan Speed (0 for fast, 1 for slow)
0x7B714814 bool Is Important? (0 for blue, 1 for red)
0x1733B1EC bool Use Logbook Model After Scan?
0x53336141 CMDL Unknown
0x3DE0BA64 float Logbook Default X Rotation
0x2ADD6628 float Logbook Default Z Rotation
0xD0C15066 float Logbook Scale
0xB7ADC418 CMDL Logbook Model
0x15694EE1 AnimationParameters Logbook AnimSet
0x58F9FE99 AnimationParameters Unknown
0x1C5B4A3A Attachment Attachment 1
0x8728A0EE Attachment Attachment 2
0xF1CD99D3 Attachment Attachment 3
0x6ABE7307 Attachment Attachment 4
0x1C07EBA9 Attachment Attachment 5
0x8774017D Attachment Attachment 6
0xF1913840 Attachment Attachment 7
0x6AE2D294 Attachment Attachment 8
0x1CE2091C Attachment Attachment 9

Attachment

This struct is used to embed a resource that can be attached to the model in the logbook. The mesh can be either a model or an animset.

ID Type Name
0x1F7921BC CMDL Attachment Model
0xCDD202D1 AnimationParameters Attachment AnimSet
0x3EA2BED8 string Target Bone Name

Dependencies

After the ScannableObjectInfo instance, there's a list of the scan's dependencies present. The list follows the same format as the DGRP format.