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.

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

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