Actions

SCHG

Difference between revisions of "Sonic Heroes/Object Editing"

From Sonic Retro

Line 45: Line 45:
  
 
{{red|00 00 00 00}} {{green|00 00 00 00}} {{blue|00 00 00 00}} {{orange|00 00 00 00}} {{olive|00 00 00 00}} {{magenta|00 00 00 00}} <br />
 
{{red|00 00 00 00}} {{green|00 00 00 00}} {{blue|00 00 00 00}} {{orange|00 00 00 00}} {{olive|00 00 00 00}} {{magenta|00 00 00 00}} <br />
{{red|00 00}} {{green|00}} {{blue|00}} {{cyan|00 00 00 00}} {{grey|00 00 00 00 00 00 00 00}} {{yellow|00}} {{cyan|00}} {{red|00 00}} {{grey|00 00 00 00}}
+
{{red|00 00}} {{green|00}} {{blue|00}} {{cyan|00 00 00 00}} {{grey|00 00 00 00 00 00 00 00}} {{yellow|00}} {{cyan|00}} {{grey|00}} {{red|00}} {{grey|00 00 00 00}}
  
 
{| class="prettytable"
 
{| class="prettytable"
Line 102: Line 102:
 
| {{cyan|Object type}}
 
| {{cyan|Object type}}
 
|-
 
|-
| {{red|0x2A}}
+
| {{grey|0x2A}}
| {{red|Word}}
+
| {{grey|Byte}}
| {{red|Usually 00 02<br />Unknown effect}}
+
| {{grey|Unknown}}
 +
|-
 +
| {{red|0x2B}}
 +
| {{red|Byte}}
 +
| {{red|Render distance multiplier}}
 
|-
 
|-
 
| {{grey|0x2C}}
 
| {{grey|0x2C}}
 
| {{grey|Long}}
 
| {{grey|Long}}
| {{grey|ID used for organization. Actually null}}
+
| {{grey|ID used for matching with second section}}
 
|}
 
|}
  
Line 116: Line 120:
  
 
== Object Lists ==
 
== Object Lists ==
Which list will be used is set in the byte at offset 0x28. The actual object is set in the byte at offset 0x29. Placing an object from another level in the same zone (such as an object from Seaside Hill in Ocean Palace) might work, but objects from different acts will crash the game. Which objects which are available for use in each level is probably set elsewhere.
+
Which list will be used is set in the byte at offset 0x28. The actual object is set in the byte at offset 0x29. Placing an object from another level in the same zone (such as an object from Seaside Hill in Ocean Palace) might work, but objects from different acts will crash the game. Which objects which are available for use in each level is probably set elsewhere.<br />
 +
Note: These lists were based on tests that weren't very well done and might be incorrect or incomplete. "Crash" means the game crashes, blank means not tested
  
 
=== Global List (00)===
 
=== Global List (00)===
 
*00 - Nothing
 
*00 - Nothing
 
*01 - Spring
 
*01 - Spring
*02 - Triple Spring
+
*02 - Triplet Spring
 
*03 - Ring
 
*03 - Ring
 
*04 - Hint Ring
 
*04 - Hint Ring
*...
+
*05 - Formation Change Gate
*0B - Goal Ring
+
*06 -
 +
*07 - Crash
 +
*08 - Crash
 +
*09 - Crash
 +
*0A - Crash
 +
*0B - Dash Pad
 +
*0C - Dash Hoop
 +
*0D - Rainbow Hoops
 +
*0E - Checkpoint
 +
*0F - Dash Ramp
 +
*10 - Cannon
 +
*11 - Crash
 +
*12 -
 +
*13 -
 +
*14 -
 +
*15 -
 +
*16 -
 +
*17 -
 +
*18 - Item Box
 +
*19 - Item Balloon
 +
*1A -
 +
*1B - Goal Ring
 +
*1C -
 +
*1D -
 +
*1E -
 +
*1F -
 +
*20 -
 +
*21 -
 +
*22 -
 +
*23 -
 +
*24 - Cage (no key)
 +
*25 - Formation Sign
 +
*26 - Switch
 +
*27 -
 +
*28 -
 +
*29 -
 +
*2A -
 +
*2B -
 +
*2C -
 +
*2D -
 +
*2E - Crash (but is used)
 +
*2F -
 +
*30 -
 +
*31 - Crash (but is used)
 +
*50 - Invisible push collision object
  
 
=== Seaside Hill List (01)===
 
=== Seaside Hill List (01)===
 +
*Object 08 from this list is used in other zones
 
To do
 
To do
  
 +
=== Enemy List (15)===
 +
*00 - Flapper
 +
*10 - Egg Pawn
 +
*40 -
 +
*D0 -
  
 
{{SCHGuides}}
 
{{SCHGuides}}
 
[[Category:Sonic Community Hacking Guide]]
 
[[Category:Sonic Community Hacking Guide]]

Revision as of 18:51, 5 March 2016

SCHG: Sonic Heroes
Main Article
Mechanic Editing

DOL Editing
EXE Editing
Music Pointers
Object Parameter Data
Relocatable Editing (PC)
File Offsets

Model Editing
Collision Format
Model Format
Level Editing

Camera Editing
Event Editing
ID list
Indirect Editing
Light Editing
Level List
Object Editing
Object Porting
Spline Editing
Texture Animation Editing
Visibility Editing

Particle Editing
Particle Editing
Sound Editing
Music List

Sound Editing
Voices

SCHG How-Tos

Custom Object Material Effect Tutorial
Level Editing Tutorial


In the PC version of the game, level object layouts are stored in big endian .bin files located in the /dvdroot folder.

File Name Layout

The file names are stored in the following format:

sL_PN.bin
L is the level number and N is the player number.
Note: Some files start with stg instead of s

Players

  • P1 - Team Sonic
  • P2 - Team Dark
  • P3 - Team Rose
  • P4 - Team Chaotix
  • P5 - Super Hard
  • PB - All teams (verify)

Levels

This list is used both for the file names and for selecting between the internal object lists (offset 0x28 of first section object entry in the file, explained below).

  • 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

To do: complete list

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 first section and one from the second section.

First 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 effect
0x1A Byte 0x00 for PB
0x20 for Sonic
0x40 for Dark
0x60 for Rose
0x80 for Chaotix
0xA0 for Super Hard
Unknown effect
0x1A Byte Usually 0x09
Unknown effect
0x1c Long Usually 0
Unknown effect
0x20 Double Usually repeats the previous double
Unknown effect
0x28 Byte Object list
0x29 Byte Object type
0x2A Byte Unknown
0x2B Byte Render distance multiplier
0x2C Long ID used for matching with second section

Second 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 information, such as spring strength or item box content.
To do

Object Lists

Which list will be used is set in the byte at offset 0x28. The actual object is set in the byte at offset 0x29. Placing an object from another level in the same zone (such as an object from Seaside Hill in Ocean Palace) might work, but objects from different acts will crash the game. Which objects which are available for use in each level is probably set elsewhere.
Note: These lists were based on tests that weren't very well done and might be incorrect or incomplete. "Crash" means the game crashes, blank means not tested

Global List (00)

  • 00 - Nothing
  • 01 - Spring
  • 02 - Triplet Spring
  • 03 - Ring
  • 04 - Hint Ring
  • 05 - Formation Change Gate
  • 06 -
  • 07 - Crash
  • 08 - Crash
  • 09 - Crash
  • 0A - Crash
  • 0B - Dash Pad
  • 0C - Dash Hoop
  • 0D - Rainbow Hoops
  • 0E - Checkpoint
  • 0F - Dash Ramp
  • 10 - Cannon
  • 11 - Crash
  • 12 -
  • 13 -
  • 14 -
  • 15 -
  • 16 -
  • 17 -
  • 18 - Item Box
  • 19 - Item Balloon
  • 1A -
  • 1B - Goal Ring
  • 1C -
  • 1D -
  • 1E -
  • 1F -
  • 20 -
  • 21 -
  • 22 -
  • 23 -
  • 24 - Cage (no key)
  • 25 - Formation Sign
  • 26 - Switch
  • 27 -
  • 28 -
  • 29 -
  • 2A -
  • 2B -
  • 2C -
  • 2D -
  • 2E - Crash (but is used)
  • 2F -
  • 30 -
  • 31 - Crash (but is used)
  • 50 - Invisible push collision object

Seaside Hill List (01)

  • Object 08 from this list is used in other zones

To do

Enemy List (15)

  • 00 - Flapper
  • 10 - Egg Pawn
  • 40 -
  • D0 -
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