Actions

Difference between revisions of "Shadow the Hedgehog (game)/Technical information/Spline format"

From Sonic Retro

m (Spline Point (0x20 bytes) =)
(Spline Point (0x20 bytes))
Line 115: Line 115:
 
|-
 
|-
 
| 0x0C
 
| 0x0C
| float
 
| Distance to previous point, first one is 0
 
|-
 
| 0x10
 
 
| float[3]
 
| float[3]
 
| Rotation (X, Y, Z)
 
| Rotation (X, Y, Z)
 +
|-
 +
| 0x18
 +
| float
 +
| Distance to next point, last one is 0
 
|-
 
|-
 
| 0x1C
 
| 0x1C

Revision as of 00:56, 7 June 2019

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.

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 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

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 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[3] Rotation (X, Y, Z)
0x18 float Distance to next point, last one is 0
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.
Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information