In Shadow the Hedgehog, splines are stored in PATH.PTP files located inside each stage's stgLLLL_dat.one file.
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.
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 array with spline headers? (sometimes it's a bit different)
|
0x0C
|
int
|
Unknown
|
0x10
|
int
|
Unknown
|
0x14
|
int
|
Unknown
|
0x18
|
int
|
Unknown
|
0x1C
|
int
|
Unknown
|
All offsets in the file are relative to this point, 0x20.
Section 2 - Array of Offsets
Offset |
Type |
Description
|
0x00
|
int[]
|
Array with offsets to splines (relative to end of header). Not sure where count is kept, maybe the game just reads it until it finds a 0 since there are a few at the end
|
Section 3 - Array of Spline Entries
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 header)
|
0x0C
|
byte
|
Unknown
|
0x0D
|
byte
|
Unknown
|
0x0E
|
byte
|
Unknown
|
0x0F
|
byte
|
Unknown
|
0x10
|
float[3]
|
Maximum X, Y and Z values in points
|
0x1C
|
int
|
Unknown
|
0x20
|
float[3]
|
Minimum X, Y and Z values in points
|
0x2C
|
int
|
Offset to spline name (relative to end of header)
|
Spline Point (0x20 bytes)
Offset |
Type |
Description
|
0x00
|
float[3]
|
Position (X, Y, Z)
|
0x0C
|
float
|
Distance to previous point, first one is 0
|
0x10
|
float[3]
|
Rotation (X, Y, Z)
|
0x1C
|
int
|
Unknown
|
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
|
-
|
byte[]
|
Padding until file is 4-byte aligned
|
Section 5 - Unknown
I have no idea what this section does
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.
|