Actions

SCHG

Difference between revisions of "Sonic Heroes/Object Porting"

From Sonic Retro

(Created page with "{{SCHG SH}} 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 wh...")
 
(1. Editing the SET ID table)
Line 4: Line 4:
  
 
== 1. Editing the SET ID table ==
 
== 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.<br />The file is composed of a list of all the objects in the game, each in a 0x14 entry. The first 0x0C bytes of each entry set from which stage each object can be loaded; the next long and word are null and the last two bytes of each entry set the object list and type.<br />Since I do not know yet how the stage entries are interpreted, I reccomend copying the entry from an object which you know is loaded in that specific stage and pasting it there. Since the ring (object 00 03) is loaded in every level, copying the values from it will make the object available for use in any level.<br />
+
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.<br />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:
This is the only step needed for porting objects from the global list, as their models and textures are always loaded.
+
 
 +
{{red|00 00 00 00}} {{green|00 00 00 00}} {{blue|00 00 00 00}} {{grey|00 00 00 00 00 00}} {{cyan|00}} {{yellow|00}}
 +
 
 +
{| class="prettytable"
 +
!Offset||Type||Description
 +
|-
 +
| {{red|0x00}}
 +
| {{red|Binary (long)}}
 +
| {{red|Availability in levels 0 to 31}}
 +
|-
 +
| {{green|0x04}}
 +
| {{green|Binary (long)}}
 +
| {{green|Availability in levels 32 to 63}}
 +
|-
 +
| {{blue|0x08}}
 +
| {{blue|Binary (long)}}
 +
| {{blue|Availability in levels 64 to 95}}
 +
|-
 +
| {{grey|0x0C}}
 +
| {{grey|-}}
 +
| {{grey|Null}}
 +
|-
 +
| {{cyan|0x12}}
 +
| {{cyan|Byte}}
 +
| {{cyan|List}}
 +
|-
 +
| {{yellow|0x13}}
 +
| {{yellow|Byte}}
 +
| {{yellow|Object}}
 +
|}
 +
 
 +
For example:<br />
 +
*0000 0000 0000 0000 0000 0000 0000 0010 (binary) in the first long would make the object available only in level 01 (Seaside Hill).<br />
 +
*0000 0000 1000 0000 0000 0000 0010 0010 would make the object available also in level 05 (Casino Park) and level 23 (Egg Albatross).<br />
 +
*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).<br />
 +
 
 +
Notes:<br />
 +
*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.
 +
*The fourth long can probably also be used, but since there are no levels past 89, it's not needed.
  
 
== 2. Adding the model ==
 
== 2. Adding the model ==

Revision as of 00:19, 16 April 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


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.
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.
  • The fourth long can probably also be used, but since there are no levels past 89, it's not needed.

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 the Sonic Heroes ONE Unpacker or HeroesONE to extract the compressed PRS model (or models, as some objects use more than one file) of the object from the source level s*obj.one file.
  • If you don't know (or can't tell from the file names) which PRS files are for the object you want to port, you can either decompress them, convert them to OBJ and view them in a model editor (takes more work) or you can just pack the new ONE with every file from the source ONE (easier). 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.
  • Pack the s*obj.one file of the destination level with the extra PRS file(s) included using Sonic Heroes ONE Packer or HeroesONE. If you're using the ONE Packer, you will have to add the name of the PRS files to the ONE in a hex editor before packing, otherwise it will be ignored. You can also remove objects from the file at this point. Do not do this unless you are sure the model will not be loaded in the level (note that some models from the s*obj.one file might not be SET objects)
  • 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.

  • Extract the object's textures from the source level's TXD file and add them to the destination level's TXD file.
  • You might need to rebuild the entire archive, depending on which editor you are using and which level texture file you're trying to edit.
  • 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.

If you want to use TXD Workshop, it will open and edit some of the game's TXD files, but not all of them. For it to open, for example, Seaside Hill's TXD, you will have to use ViceTXD or another editor to extract all the images from the file and rebuild the entire archive from scratch using TXDBuilder. Don't forget to set the archive version to GTA VC in TXD Workshop, or else the game will crash!

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