Shadow the Hedgehog (game)/Technical information/Spline format
From Sonic Retro
This article needs cleanup. This article needs to be edited to conform to a higher standard of article quality. |
Shadow the Hedgehog technical information |
---|
Main Article |
Level Editing |
Stage parameters |
Stage ID list |
Object layout format |
Effect data |
Spline format |
Misc |
Cutscene ID list |
In Shadow the Hedgehog, splines are stored in PATH.PTP files located inside each stage's stgLLLL_dat.one file.
Contents
File format
The layout file is composed of 6 sections: the header, the array of offsets to spline entries, the array of splines, the array of spline names, and two unknown sections.
Section 1 - Header (0x20 bytes)
Offset | Type | Description |
---|---|---|
0x00 | int | Total length of file in bytes |
0x04 | int | Offset to section 5 (relative to end of header) |
0x08 | int | Length of section 5 in bytes |
0x0C | int | Unknown |
0x10 | int | Unknown |
0x14 | int | Unknown |
0x18 | int | Unknown |
0x1C | int | Unknown |
All offsets in the file are relative to this position, 0x20.
Section 2 - Array of Offsets
Offset | Type | Description |
---|---|---|
0x00 | int[] | Array with offsets to splines (relative to end of file header). The length of the array isn't kept anywhere, it ends with a null int. |
- | byte[] | Padding with null bytes until file is aligned to 0x10 |
Section 3 - Array of Spline entries
Spline Header (0x30 bytes)
Offset | Type | Description |
---|---|---|
0x00 | int | Amount of points in spline |
0x04 | float | Total length of spline |
0x08 | int | Offset to start of point data (relative to end of file header) |
0x0C | byte | Byte Setting 1 |
0x0D | byte | Byte Setting 2 |
0x0E | byte | Byte Setting 3 |
0x0F | byte | Byte Setting 4 |
0x10 | float[3] | Maximum X, Y and Z values |
0x1C | int | Int Setting |
0x20 | float[3] | Minimum X, Y and Z values |
0x2C | int | Offset to spline name (relative to end of file header) |
Spline Point (0x20 bytes)
Offset | Type | Description |
---|---|---|
0x00 | float[3] | Position (X, Y, Z) |
0x0C | float[3] | Rotation (X, Y, Z) |
0x18 | float | Distance to next point, last one is 0 |
0x1C | int | Point Settings |
Section 4 - Array of Spline names
Offset | Type | Description |
---|---|---|
0x00 | string[] | Array with spline names, each spline references this by an offset, strings are 0 terminated, no padding is done for alignment until the last one |
- | byte[] | Padding until file is 4-byte aligned |
Section 5 - Unknown
I have no idea what this section does.
Offset | Type | Description |
---|---|---|
0x00 | byte[] | Array with one byte for each spline in the file. The first one is 0x40 and the rest are 0x41. |
- | byte[][] | Either two or three bytes for each spline in the file. If the first byte is less than 0x80, there are two bytes. If the first byte is 0x80 or above, there are three bytes. The last of the two or three bytes is always 0x49. |
- | byte[] | Padding until file is 4-byte aligned |
- | byte[8] | 8 null bytes. They do not count towards the total section size specified in the header. |
Section 6 - File Name
Offset | Type | Description |
---|---|---|
0x00 | string | A path to a file name, possibly the file which contained spline data before compilation. Probably ignored by the game. Zero-terminated. |
- | byte[]? | The length of the previous string including the zero terminator is always a multiple of 0x04, so I wouldn't know if there would be more bytes to align the file to 0x04 after that as they aren't needed. |
References
Shadow the Hedgehog | |
---|---|
Main page Manuals |
show;hide
Level Bosses: End Bosses: Last Story: Books:
Music: Songs: "I Am... All of Me" | "E.G.G.M.A.N. Doc. Robeatnix Mix" | "Almost Dead" | "Waking Up" | "Chosen One" | "All Hail Shadow" | "Never Turn Back" |