Sonic Heroes/Object Editing
From Sonic Retro
SCHG: Sonic Heroes |
---|
Main Article |
Mechanic Editing |
DOL Editing |
Model Editing |
Collision Format Model Format |
Level Editing |
Camera Editing |
Particle Editing |
Particle Editing |
Sound Editing |
Music List |
SCHG How-Tos |
Custom Object Material Effect Tutorial |
In the PC version of the game, level object layouts are stored in big endian .bin files located in the /dvdroot folder.
Contents
File Name Layout
The file names are stored in the following format:
sLL_NN.bin
LL is the level number and NN is the player number.
Note: Some files start with stg instead of s
Players
- DB - Decoration for all teams
- PB - Objects for all teams
- P1 - Team Sonic
- P2 - Team Dark
- P3 - Team Rose
- P4 - Team Chaotix
- P5 - Super Hard
DB files contain mostly decoration and objects that don't interact with the players, such as grass patches and the giant decoration casino chips. PB files contain normal stage objects. Both files are loaded for all teams. The object lists are the same, so there's no restriction for which objects can be placed in any of the files. There doesn't seem to be any difference in the way each of the files are loaded, so they are most likely separate for organization.
All special stage and multiplayer levels have only the DB and PB files. The team battles and Last story bosses also only have DB and PB.
Because of the player files, DB and PB files for each level, objects might reference each other from different files (verify)
Levels
- 01 - Seaside Hill
- 02 - Ocean Palace
- 03 - Grand Metropolis
- 04 - Power Plant
- 05 - Casino Park
- 06 - BINGO Highway
- 07 - Rail Canyon
- 08 - Bullet Station
- 09 - Frog Forest
- 10 - Lost Jungle
- 11 - Hang Castle
- 12 - Mystic Mansion
- 13 - Egg Fleet
- 14 - Final Fortress
- 29 - Sea Gate
- 50 - Rail Canyon (Team Chaotix)
Boss:
- 20 – Egg Hawk
- 21 - Team Battle 1
- 22 - Robot Carnival
- 23 - Egg Albatross
- 24 - Team Battle 2
- 25 - Robot Storm
- 26 - Egg Emperor
- 27 - Metal Madness
- 28 - Metal Overlord
Bonus Stages:
- 40 - Bonus Stage 1
- 41 - Bonus Stage 2
- 42 - Bonus Stage 3
- 43 - Bonus Stage 4
- 44 - Bonus Stage 5
- 45 - Bonus Stage 6
- 46 - Bonus Stage 7
Emerald Challenges:
- 80 - Emerald Challenge 1
- 81 - Emerald Challenge 2
- 82 - Emerald Challenge 3
- 83 - Emerald Challenge 4
- 84 - Emerald Challenge 5
- 85 - Emerald Challenge 6
- 86 - Emerald Challenge 7
Action Race (Multiplayer):
- 60 - Seaside Hill
- 61 - Grand Metropolis
- 62 - BINGO Highway
Battle (Multiplayer):
- 63 - City Top
- 64 - Casino Ring
- 65 - Turtle Shell
Special Stage (Multiplayer):
- 87 - Special Stage 1
- 88 - Special Stage 2
- 89 - Special Stage 3
Ring Race (Multiplayer):
- 66 - Egg Treat
- 67 - Pinball Match
- 68 - Hot Elevator
Boblsed Race (Multiplayer):
- 31 - Seaside Course
- 32 - City Course
- 33 - Casino Course
Quick Race (Multiplayer):
- 69 - Road Rock
- 70 - Mad Express
- 71 - Terror Hall
Expert Race (Multiplayer):
- 72 - Rail Canyon
- 73 - Frog Forest
- 74 - Egg Fleet
Object File Layout
The files are always 0x21000 bytes long and seem to have no header. The object list seems to be able to start at the beginning of the file, but usually starts much later, leaving a huge empty space before the list. This is most likely for one single level to load the list from multiple files.
The files are made up by two sections: one starting at the beginning, with 0x30 entries, and one starting at offset 0x18024, with 0x24 entries. Each object is defined by one array from the main section and one from the misc. section.
Main Section Entries
This array starts at the beginning of the .bin file, but retail files usually have an empty space before it. The ID (offset 0x2C) is set with regards to this space. Each entry is 0x30. This section contains most basic info for the objects.
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Float | X Position |
0x04 | Float | Y Position |
0x08 | Float | Z Position |
0x0C | Long | X Rotation |
0x10 | Long | Y Rotation |
0x14 | Long | Z Rotation |
0x18 | Word | Usually 00 02 Unknown; related to parenting to a moving object? |
0x1A | Byte | 0x00 for PB 0x20 for Sonic 0x40 for Dark 0x60 for Rose 0x80 for Chaotix 0xA0 for Super Hard Seems to be ignored as objects will be loaded regardless of this |
0x1B | Byte | Usually 09 Unknown; related to parenting to a moving object? |
0x1C | Long | Usually 00 00 00 00 Unknown effect |
0x20 | Double | Usually repeats the previous double Unknown effect |
0x28 | Byte | Object list |
0x29 | Byte | Object type |
0x2A | Byte | Link ID* |
0x2B | Byte | Render distance multiplier* |
0x2C | Long | Object ID* |
Notes:
- Link ID is used for all kinds of event activators (switches, triggers and defeating enemies)
- Render distance multiplier sets from which distance the object starts being rendered
- Object ID is used for matching with the Misc. Section; I don't know if these can be numbered out of order or if this number is even used at all (it might find the matching entry just from the order it appears in the file)
Misc. Section Entries
This array starts at offset 0x18024 in the .bin file and has 0x24 entries, one for each entry in the first section. It sets more object specific settings, such as spring strength or item box content.
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Word | Always 01 00 |
0x02 | Word | ID used for matching with first section |
The rest varies from object to object, but they're usually separated into 8 longs or floats. They're explained in the Object Specific Settings section.
Object Lists
In the main section entry, which list will be used is set in the byte at offset 0x28. The actual object from the list is set in the byte at offset 0x29.
The objects which are available for placement in each level are not defined by the list themselves; for example, although the Pulley is in the global list, placing it in Seaside Hill will crash the game. But the switch can be placed there even though it originally wasn't. And some objects from list 01, which would be the Seaside Hill list, can be placed in Ocean Palace and even in some other levels. Which objects are available for use in each level is probably set in the EXE or some other file.
Note: These lists were based on tests that weren't very well done and might be incorrect or incomplete. Blank entries mean I haven't seen the object in a file or tested it and "Verify" means the object is used somewhere in the game, I just haven't looked into it yet
List 00
- 00 - Nothing
- 01 - Spring
- 02 - Triple Spring
- 03 - Ring
- 04 - Hint Ring
- 05 - Switch
- 06 -
- 07 - Target Switch
- 08 - Wall Push Switch
- 09 -
- 0A -
- 0B - Dash Panel
- 0C - Dash Ring
- 0D - Rainbow Hoops
- 0E - Checkpoint
- 0F - Dash Ramp
- 10 - Cannon
- 11 -
- 12 -
- 13 -
- 14 -
- 15 - Spike Ball
- 16 -
- 17 -
- 18 - Item Box
- 19 - Item Balloon
- 1A -
- 1B - Goal Ring
- 1C -
- 1D - Pulley
- 1E -
- 1F -
- 20 -
- 21 - Metal Box
- 22 -
- 23 -
- 24 - Special Stage Key Box
- 25 - Formation Sign
- 26 - Formation Change Gate
- 27 -
- 28 -
- 29 - Pole
- 2A -
- 2B -
- 2C -
- 2D -
- 2E - Fan
- 2F -
- 30 -
- 31 - Cage (Opened by Switch)
- 50 - Invisible push collision object
- 59 - (Verify)
- 80 - (Verify)
List 01
- 08 - (Verify)
- 80 - Grass Patch
- 81 - Pole thingy with flag
List 05
- 86 - Giant Casino Chip
- 87 - Roulette
List 15
- 00 - Egg Flapper
- 10 - Egg Pawn
- 20 - Klagen
- 30 - Falco
- 40 - Egg Hammer
- 70 - Cameron
- 90 - Rhino Liner
- C0 - Egg Bishop
- D0 - E-2000
Object Specific Settings
There is a lot of debug text data in the EXE which explains the misc. settings for most of the game's objects. It was probably used to aid the developers when building the level layouts, and can help us understand what each of them does too. If you search for "OBJECT" as text in the EXE in a hex editor you will find it
These settings are defined in the Misc. Section Entries:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
List | Object | 0x04 | 0x08 | 0x0C | 0x10 | 0x14 | 0x18 | 0x1C | 0x20 | Notes |
---|---|---|---|---|---|---|---|---|---|---|
00 | 01 - Spring | Strength (float) | Control time (first word) | |||||||
00 | 02 - Triple Spring | Strenght (float) | Scale | Control time (first word) Item (second word) |
||||||
00 | 03 - Ring | Related to placing in lines/circles Will check debug data for info later |
Lenght of line (float) | |||||||
00 | 04 - Hint Ring | Line to play (first word) | Has setting to disappear with a switch | |||||||
00 | 05 - Switch | Has many settings | ||||||||
00 | 07 - Target Switch | First byte sets item type Third byte sets link ID |
||||||||
00 | 0B - Dash Panel | Speed (float) | Control time (first word) | |||||||
00 | 0C - Dash Ring | Speed (float) | Control time (first word) | |||||||
00 | 0D - Rainbow Hoops | Has similar settings to the dash ring, plus settings for ring position and distance | ||||||||
00 | 0E - Checkpoint | Has settings for elevation, pitch, strength and control time for each formation | ||||||||
00 | 10 - Cannon | Has settings for priority ID | ||||||||
00 | 18 - Item Box | First byte sets item type | ||||||||
00 | 19 - Item Balloon | First byte sets item type | Scale (float) | |||||||
00 | 25 - Formation Sign | Formation (byte) | ||||||||
00 | 26 - Formation Change Gate | Formation (byte) | Width offset (float) | Height offset (float) | ||||||
00 | 2E - Fan | Has settings for: fan scale, height for Triangle Dive, height for others, start on/off, wind scale, whether the fan itself is rendered | ||||||||
00 | 31 - Cage (opened by switch) | Formation (byte) | Width (float) | Width multiplier (float) (verify) | Has settings for scale and direction | |||||
05 | 86 - Giant Casino Chip | Scale (float) | Type (long) | Speed (long) |
Item Type List
- 00 - Nothing
- 01 - 5 Rings
- 02 - 10 Rings
- 03 - 20 Rings
- 04 - Barrier
- 05 - 1UP
- 06 - Speed Shoes
- 07 - Team Blast
- 08 - Invincible
- 09 - Speed Level Up
- 0A - Fly Level Up
- 0B - Power Level Up
- 0C - Refill Flight Gauge