Sonic Heroes/Object Porting
From Sonic Retro
|SCHG: Sonic Heroes|
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
|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|
- 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).
- 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.