Shadow the Hedgehog (game)/Technical information/Object layout format
From Sonic Retro
| This article needs cleanup.|
This article needs to be edited to conform to a higher standard of article quality.
|Shadow the Hedgehog technical information|
|Stage ID list|
|Object layout format|
|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:
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
The layout file is composed of 3 sections: the header, the array of object entries and the array of misc. data.
Header (0xC bytes)
|0x00||char||"sky2" in ASCII|
|0x08||int||Total length of misc. section in bytes|
Object Entry (0x2C bytes)
|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||Unknown, usually the same as the previous 4 bytes|
|0x24||int||Lenght of misc. data in bytes|
- 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.
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.
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).
|Shadow the Hedgehog|