Actions

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

From Sonic Retro

(17 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
{{SCHG ShTH}}
 
This is the '''[[Sonic Community Hacking Guide]] for ''[[Shadow the Hedgehog (game)|Shadow the Hedgehog]]'''''.  
 
This is the '''[[Sonic Community Hacking Guide]] for ''[[Shadow the Hedgehog (game)|Shadow the Hedgehog]]'''''.  
  
==File Formats==  
+
== File Formats ==  
 +
* '''.ONE:''' the .one files are packages used to hold the textures and individual models.  The header lists the one version compressor format, which is "One Ver 0.60" All the .one files all packages that keep textures and models packaged within them.
 +
* '''.BSP:''' Inside the multiple .ONE files in the stg0xxx directories are .PRS files, which contain .BSP files; these contain the level geometry. It seems that the level geometry is stored in numerous .ONE files for each level, except for the test levels.
 +
* '''.GNCP:''' These files store scripts for menus/HUD elements. The exact extension is different depending on the console version; .GNCP for GameCube, .XNCP for Xbox, .SNCP for PS2. Some *NCP's contain embedded .RWTEX format textures that it loads instead of from a .TXD.
 +
* '''.TXD:''' The usual texture pack. They are a different format from Sonic Heroes. All of the textures are kept in this pack.
 +
* '''.FOG:''' I'm actually not sure on what these are. I'm assuming create a fog. A .FOG file is usually in each of the stage folders and don't have much in them. Only 1 line has something on it, but even then it's not even full.
 +
* '''AudioData .BIN:''' These keep sound effects for what they may correspond to, such as stage objects or boss battles.
 +
* '''.PAC:''' Xbox version SFX / voice packs (Thanks to Neo Chaotikal)
 +
* '''.INF:''' Text files that contain boot and [[SCHG:Shadow_the_Hedgehog/Stage_Parameters|stage parameters]].
 +
* '''.SFD:''' CG scenes/cutscenes.
 +
* '''.AFS:''' Packages to store something, in this case it's voices for the characters.
 +
* '''.ADX:''' Sound such as music or cutscene tracks.
 +
* '''.DFF:''' RenderWare model.
 +
* '''.BON:''' Model bones file.
 +
* '''.BDT:''' Stage visibility file.
 +
* '''.UVA:''' UV animation file.
 +
* '''.CCL:''' Object collision file.
 +
* '''.FNT:''' Subtitle script data.
 +
* '''.MET:''' Subtitle character spacing data.
 +
* '''.BIN:''' Binary files. Files containing "light" in their name  are lighting-data for models on the stage; near-identical to the *light.bin files used in Sonic Heroes.
  
.ONEs
+
== Directories ==
 +
* '''character:''' Where character .ONE files are kept.
 +
* '''common:''' This directory holds generic misc. data such as Weapon Resources and Len Flares.
 +
* '''csdFiles:''' Where any menu elements are kept, such as HUDs, Loading Screens, 2P Results.
 +
* '''discError:''' Where disc error .TXDs are kept. Exclusive to Xbox version.
 +
* '''enemy:''' Where enemies' and boss' .ONES are kept.
 +
* '''event:''' Where events, such as cutscene actions are kept. Seems to use .ONEs and .SCRs file formats.
 +
* '''fonts:''' Where text/fonts are kept.
 +
* '''palsel:''' Where PAL region's hertz screen data is kept. Not present in Xbox version.
 +
* '''sound:''' Where Audio Data and Sound Effects are kept.
 +
* '''stafroll:''' Where the .SRD and the .TXD file that make up the credits/staff roll are kept.
 +
* '''stg0xxx (stg0005 to stg0911):''' These are where the files that make up the stages in SHTH are kept. Usually contain .TXD files, .ONE files (which contain .PRS files, which contain .BSP and .TXD files) and .DAT files which in the stage's case make up camera data, however, some have .FOG files.
 +
* '''Root Directory:''' where music and other voices are kept. Also where CG cutscenes are kept. Also, there is a stg_cmn_gdt.one file that contains variety of common stage object models.
  
Info: the .one files are packages used to hold the textures and individual models. The header lists the one version compressor format, which is "One Ver 0.60" All the .one files all packages that keep textures and models packaged within them.  
+
== Software ==
 +
* '''[[HeroesONE]]''' can be used to edit .ONE files from Shadow the Hedgehog.
 +
* The setid.bin file can be edited using '''[[Shadow SET ID Table Editor]]'''.
 +
* '''[[Heroes Power Plant]]''' has support for stage model, collision, visibility and object layout files.
  
.XNCPs
+
== Object Layout Data ==
 +
Object layouts are contained in various little endian .DAT files located inside each level's folder. They have the following layout:
  
Info: As far as I know, .XNCP files are used to create actions or animations.
+
\\ HEADER (0xC bytes)
 +
 +
char[4] \\ file magic "sky2" in ascii
 +
int32 \\ amount of objects
 +
int32 \\ total lenght of misc. section in bytes
 +
 +
\\ OBJECT ENTRY (0x2C bytes)
 +
 +
float32[3] \\ X, Y, Z position
 +
float32[3] \\ X, Y, Z rotation (degrees)
 +
uint8 \\ usually 01
 +
uint8 \\ 0x10 for CMN, 0x20 for NRM, 0x40 for HRD, 0x80 for DS1
 +
uint8 \\ usually 00, but 0x40 for DS1
 +
uint8 \\ usually 80
 +
uint8 \\ usually 01
 +
uint8 \\ 0x10 for CMN, 0x20 for NRM, 0x40 for HRD, 0x80 for DS1
 +
uint8 \\ usually 00, but 0x40 for DS1
 +
uint8 \\ usually 00
 +
uint8 \\ object type
 +
uint8 \\ object list
 +
uint8 \\ link ID
 +
uint8 \\ render distance
 +
uint32 \\ lenght of misc. entry
 +
uint32 \\ null
  
.TXDs
+
\\ X, Y and Z positions: location of the object in the world
 
+
\\ X, Y and Z rotations: angle of the object in the world
Info: The usual texture pack. They are a different format from Sonic Heroes. All of the textures are kept in this pack.
+
\\ 8 bytes have unknown function
 
+
\\ object type: this byte sets which object from the list will be loaded
.FOGs
+
\\ object list: this byte sets which list the object will be chosen from
 
+
\\ link ID: this is used to link two or more objects together
Info: I'm actually not sure on what these are. I'm assuming create a fog. A .FOG file is usually in each of the stage folders and don't have much in them. Only 1 line has something on it, but even then it's not even full.
+
\\ render distance: this multiplier sets from which distance the object starts being rendered
 
+
\\ lenght of misc. entry: amount of bytes of this object's misc. entry.
AudioData .BINs
+
 
+
\\ after that, there is an amount of bytes set in the header with the misc. settings for each object. They are loaded in the same order the objects are laid out in the file.
Info: These keep sound effects for what they may correspond to, such as stages or boss battles.
 
 
 
.PACs
 
  
Info: SFX / voice packs (Thanks to Neo Chaotikal)
 
  
.SFDs
+
//  File: .BON File (Shadow The Hedgehog External Bone Structure file for Animations, Export from DFF Model)
 +
//      Authors: Sewer56lol
  
Info: CG scenes/cutscenes.
+
// struct FILE {
 +
//    struct HEADER
 +
    {
 +
        char Activator[4];
 +
        uint Null;
 +
        ushort  Unknown;
 +
        ushort  Entries;
 +
        float  RootOfBone;
 +
        char CharacterNameID[32];
 +
    } header;
  
.AFSs
+
//    struct RECORD {
 +
        uint BoneTag; // Properties in 3DS
 +
        uint UnknownRootID; // SomeID
 +
        short  UnknownValue; // Some Value
 +
        byte IDOfSplit;
 +
        byte UnknownID;
 +
        int NullZero;
 +
        float  OffsetParentBoneX;
 +
        float  OffsetParentBoneY;
 +
        float  OffsetParentBoneZ;
 +
        int Null;  // Always Null
 +
        float  UnknownReferenceFloatX;  // Seems to reference something else
 +
        float  UnknownReferenceFloatY;  // Seems to reference something else
 +
        float  UnknownReferenceFloatZ;  // Seems to reference something else
 +
        int NullTwo;    // Always Null
 +
        float  UnknownFloatX2; // Almost always 1
 +
        float  UnknownFloatY2; // Almost always 1
 +
        float  UnknownFloatZ2; // Almost always 1
 +
        int NullThree;  // Always Null
 +
        char UnknownTwo[16];
 +
        char BoneName[32];
 +
    } record[ header.Entries ];
  
Info: Packages to store something, in this case it's voices for the characters.
+
} file;
  
.ADXs
 
  
Info: Sound such as music or voices.
 
  
.MET
+
// Shadow The Hedgehog .BON Struct
  
Info: Fonts.
+
// Sewer56lol
  
==Directories==
+
//0x10 Header: Constant
  
 +
//0x10 Character Name/Identifier (Must change for porting)
  
character
+
//Bone Data | 0x80 Byte Entries till EOF
  
Info: Where character .ONE files are kept.
+
---------
  
common
+
//0x10 X Offset of Parent Bone | Float
  
Info: This directory holds generic misc. data such as Weapon Resources and Len Flares.
+
//0x14 Y Offset of Parent Bone | Float
  
csdFiles
+
//0x18 Z Offset of Parent Bone | Float
  
Info: This is where things to make up the little details of the game, such as HUDs, Loading Screens, 2P Results.
 
 
discError
 
 
Info: Where discerror .TXDs are kept.
 
 
enemy
 
 
Info: Where enemies' and boss' .ONES are kept.
 
 
event
 
 
Info: Where events, such as cutscene actions are kept. Seems to use .ONEs and .SCRs file formats.
 
 
fonts
 
 
Info: Where text/fonts are kept.
 
  
sound
+
//0x60 File Name | End of Entry
  
Info: Where Audio Data and Sound Effects are kept.
+
//Knuckles Reference:
  
stafroll
+
//kn_root = Root Bone
  
Info: Where the .SRD and the .TXD file that make up the credits/staff roll are kept.
+
//kn_j_l2toge1 = Left Spines
  
stg0xxx (stg0005 to stg0911)
+
//kn_j_head = Head
  
Info: These are where the files that make up the stages in SHTH are kept. Usually contain .TXD files, .ONE files and .DAT files which in the stage's case make up camera data, however, some have .FOG files.
+
//kn_j_m1oge1 = Middle Spines
  
Root Directory
+
//kn_j_r2toge1 = Right Spines
  
Info: where music and other voices are kept. Also where CG cutscenes are kept.
 
  
==Contributors==
+
== Contributors ==
*[[Zeck]] - File formats and Directories.
+
*[[Zeck]] - File formats and directories.
 +
*[[igorseabra4]] - Object layout data.
 +
*[[LimblessVector]] - Misc. file format and directory info.
  
 
{{SCHGuides}}
 
{{SCHGuides}}
 
[[Category:Sonic Community Hacking Guide]]
 
[[Category:Sonic Community Hacking Guide]]

Revision as of 17:21, 3 September 2018

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

This is the Sonic Community Hacking Guide for Shadow the Hedgehog.

File Formats

  • .ONE: the .one files are packages used to hold the textures and individual models. The header lists the one version compressor format, which is "One Ver 0.60" All the .one files all packages that keep textures and models packaged within them.
  • .BSP: Inside the multiple .ONE files in the stg0xxx directories are .PRS files, which contain .BSP files; these contain the level geometry. It seems that the level geometry is stored in numerous .ONE files for each level, except for the test levels.
  • .GNCP: These files store scripts for menus/HUD elements. The exact extension is different depending on the console version; .GNCP for GameCube, .XNCP for Xbox, .SNCP for PS2. Some *NCP's contain embedded .RWTEX format textures that it loads instead of from a .TXD.
  • .TXD: The usual texture pack. They are a different format from Sonic Heroes. All of the textures are kept in this pack.
  • .FOG: I'm actually not sure on what these are. I'm assuming create a fog. A .FOG file is usually in each of the stage folders and don't have much in them. Only 1 line has something on it, but even then it's not even full.
  • AudioData .BIN: These keep sound effects for what they may correspond to, such as stage objects or boss battles.
  • .PAC: Xbox version SFX / voice packs (Thanks to Neo Chaotikal)
  • .INF: Text files that contain boot and stage parameters.
  • .SFD: CG scenes/cutscenes.
  • .AFS: Packages to store something, in this case it's voices for the characters.
  • .ADX: Sound such as music or cutscene tracks.
  • .DFF: RenderWare model.
  • .BON: Model bones file.
  • .BDT: Stage visibility file.
  • .UVA: UV animation file.
  • .CCL: Object collision file.
  • .FNT: Subtitle script data.
  • .MET: Subtitle character spacing data.
  • .BIN: Binary files. Files containing "light" in their name are lighting-data for models on the stage; near-identical to the *light.bin files used in Sonic Heroes.

Directories

  • character: Where character .ONE files are kept.
  • common: This directory holds generic misc. data such as Weapon Resources and Len Flares.
  • csdFiles: Where any menu elements are kept, such as HUDs, Loading Screens, 2P Results.
  • discError: Where disc error .TXDs are kept. Exclusive to Xbox version.
  • enemy: Where enemies' and boss' .ONES are kept.
  • event: Where events, such as cutscene actions are kept. Seems to use .ONEs and .SCRs file formats.
  • fonts: Where text/fonts are kept.
  • palsel: Where PAL region's hertz screen data is kept. Not present in Xbox version.
  • sound: Where Audio Data and Sound Effects are kept.
  • stafroll: Where the .SRD and the .TXD file that make up the credits/staff roll are kept.
  • stg0xxx (stg0005 to stg0911): These are where the files that make up the stages in SHTH are kept. Usually contain .TXD files, .ONE files (which contain .PRS files, which contain .BSP and .TXD files) and .DAT files which in the stage's case make up camera data, however, some have .FOG files.
  • Root Directory: where music and other voices are kept. Also where CG cutscenes are kept. Also, there is a stg_cmn_gdt.one file that contains variety of common stage object models.

Software

Object Layout Data

Object layouts are contained in various little endian .DAT files located inside each level's folder. They have the following layout:

\\ HEADER (0xC bytes)

char[4] \\ file magic "sky2" in ascii
int32 \\ amount of objects
int32 \\ total lenght of misc. section in bytes

\\ OBJECT ENTRY (0x2C bytes)

float32[3] \\ X, Y, Z position
float32[3] \\ X, Y, Z rotation (degrees)
uint8 \\ usually 01
uint8 \\ 0x10 for CMN, 0x20 for NRM, 0x40 for HRD, 0x80 for DS1
uint8 \\ usually 00, but 0x40 for DS1
uint8 \\ usually 80
uint8 \\ usually 01
uint8 \\ 0x10 for CMN, 0x20 for NRM, 0x40 for HRD, 0x80 for DS1
uint8 \\ usually 00, but 0x40 for DS1
uint8 \\ usually 00
uint8 \\ object type
uint8 \\ object list
uint8 \\ link ID
uint8 \\ render distance
uint32 \\ lenght of misc. entry
uint32 \\ null
\\ X, Y and Z positions: location of the object in the world
\\ X, Y and Z rotations: angle of the object in the world
\\ 8 bytes have unknown function
\\ object type: this byte sets which object from the list will be loaded
\\ object list: this byte sets which list the object will be chosen from
\\ link ID: this is used to link two or more objects together
\\ render distance: this multiplier sets from which distance the object starts being rendered
\\ lenght of misc. entry: amount of bytes of this object's misc. entry.

\\ after that, there is an amount of bytes set in the header with the misc. settings for each object. They are loaded in the same order the objects are laid out in the file.


// File: .BON File (Shadow The Hedgehog External Bone Structure file for Animations, Export from DFF Model) // Authors: Sewer56lol

// struct FILE { // struct HEADER

   	{
       	char	Activator[4];
       	uint	Null;
       	ushort  Unknown;
       	ushort  Entries;
       	float   RootOfBone;
       	char	CharacterNameID[32];
   	} header;

// struct RECORD {

       	uint	BoneTag; // Properties in 3DS
       	uint	UnknownRootID; // SomeID
       	short   UnknownValue; // Some Value
       	byte	IDOfSplit;
       	byte	UnknownID;
       	int 	NullZero;
       	float   OffsetParentBoneX;
       	float   OffsetParentBoneY;
       	float   OffsetParentBoneZ;
       	int 	Null;   		// Always Null
       	float   UnknownReferenceFloatX;  // Seems to reference something else
       	float   UnknownReferenceFloatY;  // Seems to reference something else
       	float   UnknownReferenceFloatZ;  // Seems to reference something else
       	int 	NullTwo;    	// Always Null
       	float   UnknownFloatX2; // Almost always 1
       	float   UnknownFloatY2; // Almost always 1
       	float   UnknownFloatZ2; // Almost always 1
       	int 	NullThree;  	// Always Null
       	char	UnknownTwo[16];
       	char	BoneName[32];
   	} record[ header.Entries ];

} file;


// Shadow The Hedgehog .BON Struct

// Sewer56lol

//0x10 Header: Constant

//0x10 Character Name/Identifier (Must change for porting)

//Bone Data | 0x80 Byte Entries till EOF


//0x10 X Offset of Parent Bone | Float

//0x14 Y Offset of Parent Bone | Float

//0x18 Z Offset of Parent Bone | Float


//0x60 File Name | End of Entry

//Knuckles Reference:

//kn_root = Root Bone

//kn_j_l2toge1 = Left Spines

//kn_j_head = Head

//kn_j_m1oge1 = Middle Spines

//kn_j_r2toge1 = Right Spines


Contributors

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