Actions

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

From Sonic Retro

m (Text replacement - "{{SCHGuides}}" to "==References== <references /> {{SCHGuides}}")
m (Black Squirrel moved page Shadow the Hedgehog/Technical information/Object layout format to Shadow the Hedgehog (game)/Technical information/Object layout format without leaving a redirect: Text replacement - "Shadow the Hedgehog/Technical" to...)
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{back}}[[Category:Technical information]]
 +
{{cleanup}}
 
{{SCHG ShTH}}
 
{{SCHG ShTH}}
  
 
In Shadow the Hedgehog, level object layouts are stored in little endian .dat files located under each stage's folder.<br />
 
In Shadow the Hedgehog, level object layouts are stored in little endian .dat files located under each stage's folder.<br />
  
== File Name Layout ==
+
==File Name layout==
 
The file names are in the following format:
 
The file names are in the following format:
  
Line 13: Line 15:
 
* NRM - Object only loaded in normal mode
 
* NRM - Object only loaded in normal mode
  
== File Format ==
+
==File format==
 
The layout file is composed of 3 sections: the header, the array of object entries and the array of misc. data.
 
The layout file is composed of 3 sections: the header, the array of object entries and the array of misc. data.
  
=== Header (0xC bytes) ===
+
===Header (0xC bytes)===
 
{| class="prettytable" style="width:auto;"
 
{| class="prettytable" style="width:auto;"
 
!Offset||Type||Description
 
!Offset||Type||Description
Line 33: Line 35:
 
|}
 
|}
  
=== Object Entry (0x2C bytes) ===
+
===Object Entry (0x2C bytes)===
 
{| class="prettytable" style="width:auto;"
 
{| class="prettytable" style="width:auto;"
 
!Offset||Type||Description
 
!Offset||Type||Description
Line 115: Line 117:
 
*Lenght of misc. data: amount of bytes of this object's misc. entry.
 
*Lenght of misc. data: amount of bytes of this object's misc. entry.
  
=== Misc. Data ===
+
===Misc. data===
 
Each object has a variable amount of bytes in their misc. data, but each value is always a 4 byte integer or a float. The misc. data length is set in each object's main entry and all entries are read in the same order of the objects. All objects must have their exact misc. data properly set to load, and although the amount of bytes is usually the same for objects of the same type, some objects have a variable amount depending on other settings.
 
Each object has a variable amount of bytes in their misc. data, but each value is always a 4 byte integer or a float. The misc. data length is set in each object's main entry and all entries are read in the same order of the objects. All objects must have their exact misc. data properly set to load, and although the amount of bytes is usually the same for objects of the same type, some objects have a variable amount depending on other settings.
  
== Object Lists ==
+
==Object lists==
 
The ''setid.bin'' file contains a list of all objects, along with flags setting in which level each one is available (more information in [[SCHG:Sonic_Heroes/Object Porting|this page]]).
 
The ''setid.bin'' file contains a list of all objects, along with flags setting in which level each one is available (more information in [[SCHG:Sonic_Heroes/Object Porting|this page]]).
  
Line 124: Line 126:
 
<references />
 
<references />
  
{{SCHGuides}}
+
{{ShadowOmni}}

Revision as of 15:19, 3 April 2020

Back to: Shadow the Hedgehog (game)/Technical information.
Sonicretro-round.svg This article needs cleanup.

This article needs to be edited to conform to a higher standard of article quality.
After the article has been cleaned up, you may remove this message. See How to Edit a Page for help.

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, level object layouts are stored in little endian .dat files located under each stage's folder.

File Name layout

The file names are in the following format:

stgLLLL_NNN.bin
LLLL is the level number (such as 0100 for Westopolis, see Stage ID List) and NNN is an identifier for the file type:

  • CMN - Common objects, always loaded
  • DS1 - Decoration objects, always loaded
  • HRD - Objects only loaded for Expert Mode
  • NRM - Object only loaded in normal mode

File format

The layout file is composed of 3 sections: the header, the array of object entries and the array of misc. data.

Header (0xC bytes)

Offset Type Description
0x00 char[4] "sky2" in ASCII
0x04 int Object Count
0x08 int Total length of misc. section in bytes

Object Entry (0x2C bytes)

Offset Type Description
0x00 float X Position
0x04 float Y Position
0x08 float Z Position
0x0C float X Rotation (degrees)
0x10 float Y Rotation (degrees)
0x14 float Y Rotation (degrees)
0x18 byte Unknown, usually 01
0x19 byte Unknown, usually 0x10 for CMN, 0x20 for NRM, 0x40 for HRD, 0x80 for DS1
0x1A byte Unknown, usually 00, but 0x40 for DS1
0x1B byte Unknown, usually 80
0x1C byte[4] Unknown, usually the same as the previous 4 bytes
0x20 byte Object type
0x21 byte Object list
0x22 byte Link ID
0x23 byte Render distance
0x24 int Lenght of misc. data in bytes
0x28 int 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, in degrees.
  • 8 bytes have unknown function.
  • Object list: this byte sets which list the object will be chosen from.
  • Object type: this byte sets which object from the list will be loaded.
  • Link ID: this is used to link two or more objects together, such as switches, doors and triggers, warps.
  • Render distance: this multiplier sets from which distance the object starts being rendered.
  • Lenght of misc. data: amount of bytes of this object's misc. entry.

Misc. data

Each object has a variable amount of bytes in their misc. data, but each value is always a 4 byte integer or a float. The misc. data length is set in each object's main entry and all entries are read in the same order of the objects. All objects must have their exact misc. data properly set to load, and although the amount of bytes is usually the same for objects of the same type, some objects have a variable amount depending on other settings.

Object lists

The setid.bin file contains a list of all objects, along with flags setting in which level each one is available (more information in this page).

References


Shadow the Hedgehog
Shadow title.png

Main page
Comparisons
Maps
Cheat codes
Credits


Manuals
Promotional material
Magazine articles
Reception
Merchandise


Development
Hidden content
Bugs
Technical information