Difference between revisions of "Pikmin 2 cutscene file"
(Added entry types based on JStudio::fvb::TFactory::create function) |
|||
(13 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | Cutscenes in Pikmin 2 are controlled by a file called <code>demo.stb</code>. This file can be found in each of the cutscene archives in <code>/user/Mukki/<name of cutscene>/demo.szs</code>. | + | {{DISPLAYTITLE:''Pikmin 2'' cutscene file}} |
+ | Cutscenes in ''Pikmin 2'' are controlled by a file called <code>demo.stb</code>. This file can be found in each of the cutscene archives in <code>/user/Mukki/<name of cutscene>/demo.szs</code>. Cutscenes have predetermined number of frames. | ||
This page describes the format of the file. The page is work in progress. | This page describes the format of the file. The page is work in progress. | ||
Line 16: | Line 17: | ||
|0x4 | |0x4 | ||
|uint16 | |uint16 | ||
− | |Byte order mark? Always 0xFEFF | + | |Byte order mark? Always <code>0xFEFF</code> |
+ | |- | ||
+ | |0x6 | ||
+ | |uint16 | ||
+ | |Unknown. Always 0x0003? | ||
|- | |- | ||
|0x8 | |0x8 | ||
Line 28: | Line 33: | ||
|0x10 | |0x10 | ||
|char[8] | |char[8] | ||
− | |String that spells "jstudio" | + | |String that spells "jstudio", terminated by a null byte |
|- | |- | ||
|0x18 | |0x18 | ||
Line 36: | Line 41: | ||
|0x1E | |0x1E | ||
|int16 | |int16 | ||
− | |Unknown. Always | + | |Unknown. Always <code>0x04</code>? |
|} | |} | ||
Line 43: | Line 48: | ||
= JFVB = | = JFVB = | ||
JFVB is one of the possible objects that can appear in the stb file. The size of the JFVB data is usually big because it's like its own section inside the file. | JFVB is one of the possible objects that can appear in the stb file. The size of the JFVB data is usually big because it's like its own section inside the file. | ||
− | For the purpose of the object count, JFVB counts as one object | + | For the purpose of the object count, JFVB counts as one object. |
{| class="wikitable" | {| class="wikitable" | ||
|+JFWB object | |+JFWB object | ||
Line 77: | Line 82: | ||
|0x4 | |0x4 | ||
|uint16 | |uint16 | ||
− | |Byte order mark? Always 0xFEFF | + | |Byte order mark? Always <code>0xFEFF</code> |
|- | |- | ||
|0x6 | |0x6 | ||
|uint16 | |uint16 | ||
− | |Unknown, always | + | |Unknown, always <code>0x0100</code>? |
|- | |- | ||
|0x8 | |0x8 | ||
Line 89: | Line 94: | ||
|0xC | |0xC | ||
|uint32 | |uint32 | ||
− | |Amount of entries in FVB data | + | |Amount of entries in FVB data entry list |
|- | |- | ||
|0x10 | |0x10 | ||
− | |FVB data entry | + | |FVB data entry list |
|See table below for more info | |See table below for more info | ||
|} | |} | ||
Line 105: | Line 110: | ||
|0x0 | |0x0 | ||
|uint32 | |uint32 | ||
− | | | + | |Entry size starting from 0x0 to end |
|- | |- | ||
|0x4 | |0x4 | ||
|uint16 | |uint16 | ||
− | | | + | |Entry type? |
|- | |- | ||
|0x6 | |0x6 | ||
|uint16 | |uint16 | ||
− | | | + | |Offset to data? Always 0 |
+ | |- | ||
+ | |0x8 | ||
+ | |Subentry list | ||
+ | |The list of subentries is terminated by a null entry (4 null bytes). | ||
+ | |} | ||
+ | |||
+ | FVB entry types: 1 (composite), 2 (constant), 3 (transition), 4 (list), 5 (list parameter), 6 (hermite). Only 2 and 6 are known to be used by ''Pikmin 2''. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+Subentry | ||
+ | |- | ||
+ | !Offset | ||
+ | !Type | ||
+ | !Description | ||
+ | |- | ||
+ | |0x0 | ||
+ | |uint16 | ||
+ | |Total subentry size, starting from offset <code>0x04</code> to end | ||
+ | |- | ||
+ | |0x2 | ||
+ | |uint16 | ||
+ | |Subentry type | ||
+ | |- | ||
+ | |0x4 | ||
+ | |Subentry data | ||
+ | |Exact data layout depends on subentry type and the type of the entry the subentry is located in | ||
+ | |} | ||
+ | |||
+ | Known subentry types: | ||
+ | * <code>0x00</code>: terminates the list of subentries | ||
+ | * <code>0x01</code>: If entry type is 2, one float follows. If entry type is 6, a 4 bytes integer and many floats follow. The integer is broken up like this: the first 4 bits are the width of the following float table, the remaining bits are the height. Multiply width with height to get the amount of floats that follow. Table is likely used for interpolation, possibly related to hermite interpolation. | ||
+ | * <code>0x12</code>: Only known to be used in entry type 6. This subentry contains two floats which specify a value range. It appears before a <code>0x01</code> subentry. | ||
+ | |||
+ | = JMSG = | ||
+ | This object handles the querying of messages from the BMG database and responsible for the calling message boxes onscreen. There are two segments to the JMSG objects, first is an array of message box objects, and then a control section with additional parameters. For the sake of object count, each JMSG counts as an object while the controls are independantly just one object. | ||
+ | {| class="wikitable" | ||
+ | |+JMSG object | ||
+ | |- | ||
+ | !Offset | ||
+ | !Type | ||
+ | !Description | ||
+ | |- | ||
+ | |0x0 | ||
+ | |uint32 | ||
+ | |Size of section in bytes | ||
+ | |- | ||
+ | |0x4 | ||
+ | |char[4] | ||
+ | |String that spells "JMSG" | ||
|- | |- | ||
|0x8 | |0x8 | ||
+ | |uint32 | ||
+ | |If this is the first message box this is set to <code>0x0000000B</code>, else <code>0x0000000C</code> | ||
+ | |- | ||
+ | |0xC | ||
+ | |10 bytes | ||
+ | |A string in Shift-JIS Romaji, "メッセージ", or "Message" in English | ||
+ | |- | ||
+ | |0x16 | ||
+ | |uint16 | ||
+ | |{{unsure|Unknown identifer?}} | ||
+ | |- | ||
+ | |0x18 | ||
+ | |uint16 | ||
+ | |An identifer? Value is always <code>0x0200</code> | ||
+ | |- | ||
+ | |0x1A | ||
+ | |uint16 | ||
+ | |Value represents what frame to pause the cutscene and display the message box onscreen | ||
+ | |- | ||
+ | |0x1C | ||
+ | |8 Bytes | ||
+ | |Value doesn't appear to change, always <code>0x8000000800040859</code> | ||
+ | |- | ||
+ | |0x24 | ||
+ | |uint32 | ||
+ | |ID of message | ||
+ | |- | ||
+ | |0x28 | ||
+ | |uint16 | ||
+ | |Same as value from 0x14. Always <code>0x0200</code> | ||
+ | |- | ||
+ | |0x2A | ||
+ | |uint16 | ||
+ | |Always <code>0x0001</code> | ||
+ | |- | ||
+ | |0x2C | ||
+ | |uint16 | ||
+ | |Padding of <code>0x00</code>'s, end of section | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+JMSG controls section | ||
+ | |- | ||
+ | !Offset | ||
+ | !Type | ||
+ | !Description | ||
+ | |- | ||
+ | |0x0 | ||
+ | |uint32 | ||
+ | |Size of section in bytes | ||
+ | |- | ||
+ | |0x4 | ||
+ | |uint32 | ||
+ | |Padding of <code>0xFF</code>'s | ||
+ | |- | ||
+ | |0x8 | ||
+ | |uint32 | ||
+ | |Unknown, set to <code>0x0000000D</code> | ||
+ | |- | ||
+ | |0xC | ||
+ | |12 bytes | ||
+ | |A string in Shift-JIS Romaji, "コントロール", or "Control" in English | ||
+ | |- | ||
+ | |0x18 | ||
+ | |uint32 | ||
+ | |Padding of <code>0x00</code>'s | ||
+ | |- | ||
+ | |0x1C | ||
+ | |12 Bytes | ||
+ | |Start of control values for the JMSG object | ||
+ | |- | ||
+ | |0x28* | ||
+ | |uint32 | ||
+ | |Padding of <code>0x00</code>'s, end of section | ||
+ | |} | ||
+ | |||
+ | ∗ Ending offset differs depending on the amount of JMSG objects there are since each object gets its own 12 bytes of control values. | ||
+ | |||
+ | = JCMR = | ||
+ | Object that deals with the camera movement. | ||
+ | {| class="wikitable" | ||
+ | |+JCMR object | ||
+ | |- | ||
+ | !Offset | ||
+ | !Type | ||
+ | !Description | ||
+ | |- | ||
+ | |0x0 | ||
+ | |uint32 | ||
+ | |Size of section in bytes | ||
+ | |- | ||
+ | |0x4 | ||
+ | |char[4] | ||
+ | |String that spells "JACT" | ||
+ | |- | ||
+ | |0x8 | ||
+ | |uint32 | ||
+ | |Length of object name. | ||
+ | |- | ||
+ | |0xC | ||
+ | |char[length] | ||
+ | |Object name | ||
+ | |- | ||
+ | |0xC+length rounded up to multiple of 4 | ||
+ | |JCMR data entries | ||
+ | |See below | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+JCMR data entry | ||
+ | |- | ||
+ | !Offset | ||
+ | !Type | ||
+ | !Description | ||
+ | |- | ||
+ | |0x0 | ||
+ | |uint32 | ||
+ | |If equal to 0, terminates list of data entries and no further JCMR data follows. Otherwise equal to 0x8000003C | ||
+ | |- | ||
+ | |0x4 | ||
+ | |0x40 bytes of data | ||
+ | |Only exists if previous value was 0x8000003C, purpose unknown | ||
+ | |} | ||
+ | |||
+ | = JACT = | ||
+ | {| class="wikitable" | ||
+ | |+JACT object | ||
+ | |- | ||
+ | !Offset | ||
+ | !Type | ||
+ | !Description | ||
+ | |- | ||
+ | |0x0 | ||
+ | |uint32 | ||
+ | |Size of section in bytes | ||
+ | |- | ||
+ | |0x4 | ||
+ | |char[4] | ||
+ | |String that spells "JACT" | ||
+ | |- | ||
+ | |0x8 | ||
+ | |uint32 | ||
+ | |Length of object name. | ||
+ | |- | ||
+ | |0xC | ||
+ | |char[length] | ||
+ | |Object name | ||
+ | |- | ||
+ | |0xC+length rounded up to multiple of 4 | ||
+ | |JACT data | ||
|unknown | |unknown | ||
− | |||
|} | |} | ||
+ | The first character in the name of a JACT object has a meaning: "+" means special actor, "@" means particle actor, "*" means creature. | ||
+ | |||
+ | = JSND = | ||
+ | |||
+ | still being looked into atm but is suspected to be for music | ||
+ | |||
+ | = JCNT = | ||
+ | |||
+ | have no idea but i suspect that it either does nothing or is for the frames in a cutscene- Cube 2024 | ||
− | + | [[Category:Pikmin 2]] | |
+ | [[Category:File formats]] |
Latest revision as of 20:30, 9 March 2024
Cutscenes in Pikmin 2 are controlled by a file called demo.stb
. This file can be found in each of the cutscene archives in /user/Mukki/<name of cutscene>/demo.szs
. Cutscenes have predetermined number of frames.
This page describes the format of the file. The page is work in progress.
Offset | Type | Description |
---|---|---|
0x0 | char[4] | String that spells "STB", terminated by a null byte |
0x4 | uint16 | Byte order mark? Always 0xFEFF
|
0x6 | uint16 | Unknown. Always 0x0003? |
0x8 | uint32 | Total file size |
0xC | uint32 | Amount of objects |
0x10 | char[8] | String that spells "jstudio", terminated by a null byte |
0x18 | uint8[6] | Likely 6 bytes of padding |
0x1E | int16 | Unknown. Always 0x04 ?
|
After the STB header follows object data. The following info explains that object data:
JFVB[edit]
JFVB is one of the possible objects that can appear in the stb file. The size of the JFVB data is usually big because it's like its own section inside the file. For the purpose of the object count, JFVB counts as one object.
Offset | Type | Description |
---|---|---|
0x0 | uint32 | JFVB total data size (starting with 0x0 to end) |
0x4 | char[4] | String that spells "JFVB" |
0x8 | FVB data | See table below for more info |
Offset | Type | Description |
---|---|---|
0x0 | char[4] | String that spells "FVB", terminated by a null byte |
0x4 | uint16 | Byte order mark? Always 0xFEFF
|
0x6 | uint16 | Unknown, always 0x0100 ?
|
0x8 | uint32 | FVB data size (starting with "FVB" string to end) |
0xC | uint32 | Amount of entries in FVB data entry list |
0x10 | FVB data entry list | See table below for more info |
Offset | Type | Description |
---|---|---|
0x0 | uint32 | Entry size starting from 0x0 to end |
0x4 | uint16 | Entry type? |
0x6 | uint16 | Offset to data? Always 0 |
0x8 | Subentry list | The list of subentries is terminated by a null entry (4 null bytes). |
FVB entry types: 1 (composite), 2 (constant), 3 (transition), 4 (list), 5 (list parameter), 6 (hermite). Only 2 and 6 are known to be used by Pikmin 2.
Offset | Type | Description |
---|---|---|
0x0 | uint16 | Total subentry size, starting from offset 0x04 to end
|
0x2 | uint16 | Subentry type |
0x4 | Subentry data | Exact data layout depends on subentry type and the type of the entry the subentry is located in |
Known subentry types:
0x00
: terminates the list of subentries0x01
: If entry type is 2, one float follows. If entry type is 6, a 4 bytes integer and many floats follow. The integer is broken up like this: the first 4 bits are the width of the following float table, the remaining bits are the height. Multiply width with height to get the amount of floats that follow. Table is likely used for interpolation, possibly related to hermite interpolation.0x12
: Only known to be used in entry type 6. This subentry contains two floats which specify a value range. It appears before a0x01
subentry.
JMSG[edit]
This object handles the querying of messages from the BMG database and responsible for the calling message boxes onscreen. There are two segments to the JMSG objects, first is an array of message box objects, and then a control section with additional parameters. For the sake of object count, each JMSG counts as an object while the controls are independantly just one object.
Offset | Type | Description |
---|---|---|
0x0 | uint32 | Size of section in bytes |
0x4 | char[4] | String that spells "JMSG" |
0x8 | uint32 | If this is the first message box this is set to 0x0000000B , else 0x0000000C
|
0xC | 10 bytes | A string in Shift-JIS Romaji, "メッセージ", or "Message" in English |
0x16 | uint16 | Unknown identifer?[unsure] |
0x18 | uint16 | An identifer? Value is always 0x0200
|
0x1A | uint16 | Value represents what frame to pause the cutscene and display the message box onscreen |
0x1C | 8 Bytes | Value doesn't appear to change, always 0x8000000800040859
|
0x24 | uint32 | ID of message |
0x28 | uint16 | Same as value from 0x14. Always 0x0200
|
0x2A | uint16 | Always 0x0001
|
0x2C | uint16 | Padding of 0x00 's, end of section
|
Offset | Type | Description |
---|---|---|
0x0 | uint32 | Size of section in bytes |
0x4 | uint32 | Padding of 0xFF 's
|
0x8 | uint32 | Unknown, set to 0x0000000D
|
0xC | 12 bytes | A string in Shift-JIS Romaji, "コントロール", or "Control" in English |
0x18 | uint32 | Padding of 0x00 's
|
0x1C | 12 Bytes | Start of control values for the JMSG object |
0x28* | uint32 | Padding of 0x00 's, end of section
|
∗ Ending offset differs depending on the amount of JMSG objects there are since each object gets its own 12 bytes of control values.
JCMR[edit]
Object that deals with the camera movement.
Offset | Type | Description |
---|---|---|
0x0 | uint32 | Size of section in bytes |
0x4 | char[4] | String that spells "JACT" |
0x8 | uint32 | Length of object name. |
0xC | char[length] | Object name |
0xC+length rounded up to multiple of 4 | JCMR data entries | See below |
Offset | Type | Description |
---|---|---|
0x0 | uint32 | If equal to 0, terminates list of data entries and no further JCMR data follows. Otherwise equal to 0x8000003C |
0x4 | 0x40 bytes of data | Only exists if previous value was 0x8000003C, purpose unknown |
JACT[edit]
Offset | Type | Description |
---|---|---|
0x0 | uint32 | Size of section in bytes |
0x4 | char[4] | String that spells "JACT" |
0x8 | uint32 | Length of object name. |
0xC | char[length] | Object name |
0xC+length rounded up to multiple of 4 | JACT data | unknown |
The first character in the name of a JACT object has a meaning: "+" means special actor, "@" means particle actor, "*" means creature.
JSND[edit]
still being looked into atm but is suspected to be for music
JCNT[edit]
have no idea but i suspect that it either does nothing or is for the frames in a cutscene- Cube 2024