Actions

Shadow the Hedgehog (game)/Technical information/Object layout format

From Sonic Retro

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.

SCHG: Shadow the Hedgehog
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
Cheat codes
Credits
Comparisons


Manuals
Promotional material
Magazine articles
Merchandise


Development
Hidden content
Technical information