Actions

SCHG

Sonic Heroes/Object Porting

From Sonic Retro

Revision as of 15:50, 24 March 2020 by Black Squirrel (talk | contribs) (Text replacement - "{{SCHGuides}}" to "==References== <references /> {{SCHGuides}}")
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


This tutorial will teach you how to port SET objects between different levels.

1. Editing the SET ID table

The SET ID table is the table that defines in which level each object will be loaded. It is located in setidtbl.bin file, in the dvdroot folder. It can be edited using Heroes SET ID Table Editor.

The file is in little endian and is composed of a list of all the objects in the game, each in a 0x14 entry. The entries have the following layout:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Offset Type Description
0x00 Binary (long) Availability in levels 0 to 31
0x04 Binary (long) Availability in levels 32 to 63
0x08 Binary (long) Availability in levels 64 to 95
0x0C - Null
0x12 Byte List
0x13 Byte Object

For example:

  • 0000 0000 0000 0000 0000 0000 0000 0010 (binary) in the first long would make the object available only in level 01 (Seaside Hill).
  • 0000 0000 1000 0000 0000 0000 0010 0010 would make the object available also in level 05 (Casino Park) and level 23 (Egg Albatross).
  • 0000 0000 0000 0000 0000 1000 0000 0000 in the second long (offset 0x04) would make the object available in level 43 (Bonus Stage 4).

Notes:

  • This is the only step needed for porting objects from the global list, as their models and textures are always loaded.
  • Note that the file can also be edited in big endian, but that gets more complicated as you have to edit the binaries per byte instead of per long.

2. Adding the model

Just adding the object to the SET ID table is not enough to make the object load, as its model will not be loaded unless you insert it in the s*obj.one file of the level.

  • First, you must use HeroesONE to extract the model and animation file(s) of the object from the source s*obj.one file.
  • If you don't know (or can't tell from the file names) which files are for the object you want to port, you can use a DFF importer/viewer to see them in a model editor, or you can just add every file from the source ONE to the destination one. This last method will allow you to use every object from the source level, but will create a larger file and is unnecessary if you're not going to use all the objects.
  • Add the extracted files to the destination s*obj.one using HeroesONE. You can also remove objects from the file at this point. Do not do this unless you are sure of what you're doing (note that some files from the s*obj.one file might not be SET objects)
  • Save and place the new ONE file in the dvdroot folder.

3. Adding the textures

The next step is to add the object textures to the TXD archive. Just extract the object's textures from the source level's TXD file and add them to the destination TXD file, making sure they keep the same names. It is recommended to use Magic.TXD to do this, as it can open every Sonic Heroes TXD file and easily add, remove extract and replace textures with transparency and mipmaps. If you're in doubt on which textures the object will use, you can add all of the source level's textures to the destination TXD file. This should not decrease game performance but will increase loading times and result in an extra large TXD file full of textures that will never be loaded.

Note that the game will probably not crash if the textures are missing; they will just display incorrectly. This is good because it will allow you to see if you did something wrong with the textures. Missing models will make the game crash though.

It is possible to create custom models for objects, as they use RenderWare .DFF files. They are the same ones used by characters.

References


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