Actions

SCHG How-to

Difference between revisions of "Creating Levels in Sonic Heroes"

From Sonic Retro

(Level Models)
Line 5: Line 5:
  
 
== Introduction ==
 
== Introduction ==
First of all, you should come [https://github.com/igorseabra4/HeroesCompiledBinaries here] and download pretty much everything in that page. It has every program this page mentions, except for [[HeroesONE]], [https://www.gtamodding.com/wiki/Magic.TXD Magic.TXD], 3ds Max and HeroesCollisionEditor, all of which you should get as well.
+
First of all, you should come [https://github.com/igorseabra4/HeroesCompiledBinaries here] and download pretty much everything in that page. It has every program this page mentions, except for [[HeroesONE]], [https://www.gtamodding.com/wiki/Magic.TXD Magic.TXD], 3ds Max and HeroesCollisionEditor, all of which you should get as well. Make sure you are using the latest version of each tool.
  
If this is your first time creating a level for this game, it's a good idea to first extract and take a look at the original levels, to see stuff like their size, shape, how they're laid out, what types of textures are in each BSP etc. Use either HeroesBSP2OBJ or [[File:Bsp2objv021sonic.zip]] to rip BSP models, Magic.TXD to rip textures and HeroesCL2OBJ to rip the collision models. You can also play a bit with Heroes Layout Editor and add random objects or teleport around the stage for a bit. Make sure to read the entire tutorial and as much of these wiki pages as you can, so you know what you're doing and you're not just throwing models at a wall to see what renders.
+
In the PC version of Sonic Heroes, level models are multiple .BSP files located inside .ONE archives, which are located in the dvdroot folder. We'll be using HeroesOBJ2BSP (available in the link above) to convert .OBJ model files (with a .MTL material library) exported from 3ds Max (you can try using other model editors, but I can't guarantee it'll work) into .BSPs readable by Heroes. Then we'll use HeroesONE to put the .BSPs inside a .ONE archive and replace one of the original level models. Then, we'll add the textures to the level's .TXD texture archive file with Magic.TXD and edit visibility data in the level's _blk.bin file with [[Heroes Visibility Editor]]. This should be enough for your custom models to be rendered ingame. After that, we'll create a collision model and convert it to a .CL readable by Heroes using HeroesCL2OBJ or HeroesCollisionEditor. We'll also cover editing object layouts and then move on to other stuff.
  
Since the console versions of Sonic Heroes use the same file types for most files and do accept BSPs from the PC version, you can create custom levels for the PC or any of the console versions, as long as you remember to save the TXD in the correct version. There's only start/ending position and spline editors for the PC EXE though.
+
If this is your first time creating a level for this game, it's a good idea to first extract and take a look at the original levels, to see stuff like their size, shape, how they're laid out, what types of textures are in each .BSP etc. Use either HeroesBSP2OBJ or [[File:Bsp2objv021sonic.zip]] to rip the original .BSP models after extracting them from the original .ONE archives, Magic.TXD to rip the textures and HeroesCL2OBJ to rip the collision models. You can also play a bit with [[Heroes Layout Editor]], add a few random objects or teleport around the stage for a bit. Make sure to read the entire tutorial and as much of these wiki pages as you can, so you know what you're doing and you're not just throwing models at a wall to see what renders.
 +
 
 +
Since the console versions of Sonic Heroes use the same file types for most files and do accept .BSPs from the PC version, you can create custom levels for the PC or any of them, as long as you remember to save the .TXD in the correct version (Magic.TXD allows you to choose either PC, GameCube or PlayStation2). There's only start/ending position and spline editors for the PC EXE though.
  
 
== Level Models ==
 
== Level Models ==
Tools you'll need:
+
For more information, see [[SCHG:Sonic Heroes/Model Format|Model Format]].
*[[HeroesONE]]
+
 
*3D Editor (preferably 3ds Max)
+
First of all, you should choose a stage to replace. Choose based on the theme of the stage you plan to make and objects you want to use, as some only work in a few level slots. Also, pinball table/BINGO mode only works on levels which originally had them. The .ONE files for the levels are named s{{red|LL}}.one, where {{red|LL}} is the level number (some start with stg instead of s). For a complete list of level numbers, see the [[SCHG:Sonic_Heroes/Level_List#File Names and Data|File Names and Data]] level list.
*HeroesOBJ2BSP
+
 
*[[Heroes Visibility Editor]]
+
If this is your first time creating a level for this game, first you should open one of the original .ONEs with HeroesONE and take a look at how the .BSPs inside it are named:
  
For more information, see [[SCHG:Sonic Heroes/Model Format|Model Format]].
+
S{{red|LL}}_{{green|MM}}_{{blue|NN}}.BSP (or STG instead of S, accordingly with the .ONE name)
 +
 
 +
{{red|LL}} is the level number, {{green|MM}} is the material setting identifier and {{blue|NN}} is the chunk number.
  
Level models are located in multiple .BSP files located inside ''.ONE'' archives in the dvdroot folder, which are named s{{red|LL}}.one or s{{red|LL}}_h.one or stg{{red|LL}}.one or stg{{red|LL}}_h.one (where {{red|LL}} is the level number). The ''_h'' indicates this is the version of the level with shaders on the models. The game will normally load only the version with shaders if it's present. HeroesONE is used to open and create the archives. The levels from Seaside Hill to Power Plant and from Hang Castle to Final Fortress and all bosses and multiplayer levels associated with them will have their files starting with ''s''. The files for levels from Casino Park to Lost Jungle and all their bosses and multiplayer versions as well as special stages will have their files starting with ''stg''. For a complete list of level numbers, see the [[SCHG:Sonic_Heroes/Level_List#File Names and Data|File Names and Data]] level list.
+
Levels in Sonic Heroes are divided into multiple {{blue|NN}} chunks. Each chunk has a number and can have a large number of BSPs set for it. All files with the same {{blue|NN}} number make up the same chunk. For the game to know which chunk to display at a given time, the camera must be inside boundaries set in the ''*_blk.bin file'', which we'll discuss soon; if the BSP has no number (S{{red|LL}}_{{green|MM}}.BSP) it'll be rendered all the time.
  
The BSP model files are named in the form of S{{red|LL}}_{{green|XX}}_{{blue|NN}}.BSP (or STG, accordingly with the .ONE name). {{red|LL}} is the level number, {{green|XX}} is the material setting identifier and {{blue|NN}} is the chunk number.
+
The files also have different {{green|MM}} material settings. They will set how the model is rendered. For a complete list of what you can use, see [[SCHG:Sonic_Heroes/EXE_Editing#Material_Flags|Material Flags]]. These are some of them:
  
Levels in Sonic Heroes are divided into multiple chunks when it comes to the rendered models. Each chunk has a number and can have a large number of model files set for it. All files with the same {{blue|NN}} number make up the same chunk. For the game to know which chunk to display at a given time, it uses the ''*_blk.bin file''. If the file has no number (S{{red|LL}}_{{green|XX}}.BSP) it'll be rendered all the time. This is used for Lost Jungle and Egg Fleet skyboxes, for example.
+
*ON - Normal
 +
*ONS - Normal, shadow casting
 +
*ONW - Normal, no culling
 +
*ONWS - Normal, no culling, shadow casting
 +
*DN - Skybox
 +
*PN - Normal, alpha testing
 +
*PNS - Normal, alpha testing, shadow casting
 +
*PNW - Normal, alpha testing, no culling
 +
*PNWS - Normal, alpha testing, shadow casting, no culling
 +
*AFN - Alpha material
 +
*AFNS - Alpha material, shadow casting
 +
*K - Additive alpha
 +
*KW - Additive alpha, no culling
  
There are multiple files for each chunk so each one will have different material settings applied to them. For a complete list of material setting identifiers and the difference between each of them, see [[SCHG:Sonic_Heroes/EXE_Editing#Material_Flags|Material Flags]]. For normal level models, you'll mainly be working with the ON and ONS identifiers; the only difference between them is that on top of ONS, shadows will be cast. PN is for textures with alpha tested textures and PNS will cast shadows. AFN will use alpha for transparent textures without z-buffer writing enabled (on AFNS, it'll cast shadows and K and KW will use additive alpha regardless of transparency of textures). DN is for the skybox.
+
Drag an .OBJ file exported from 3ds Max (remember to use Y axis = up) into HeroesOBJ2BSP to convert it into a .BSP file (as of release 5, you can drag multiple files or just double-click the program to convert every .OBJ in the folder). Model must use triangles; there's a maximum of 65535 vertices and triangles. If you have a number just under that, the limit might be reached, because HeroesOBJ2BSP will add new vertices for use with new UV coordinates (.BSPs use per-vertex UVs). Your model should be far smaller than that, though - remember you can use multiple .BSPs, so split your level into chunks! Remember your .OBJ must use dots (.), not commas (,) as floating point separators in case you're from a country which uses that. And don't drag the .MTL into the program, it'll load that automatically.
  
Drag an .OBJ file into HeroesOBJ2BSP to convert it into a BSP file. Name it according to the above explanation (if this is your first test, you should name it S{{red|LL}}_ONS_01.BSP) and place it inside the .ONE archive for your destination level with HeroesONE. You can drag any amount of .OBJ files for batch conversion, or just run it and it'll convert every .OBJ file it can find in the folder. Remember Sonic Heroes uses the Y-up format, not Z-up. Each BSP can have a maximum of 65535 vertices and/or triangles; if your level in total has more than that, that's one of the advantages of splitting into multiple files. This should already be enough for the model to load, as long as the file is named correctly and the camera is located inside the visibility boundaries, which are explained below.
+
It'll spit out a .BSP with the same name of your .OBJ. Name it according to the explanation above (if this is your first test, just name it S{{red|LL}}_ON_01.BSP). Create a new file in HeroesONE and add your .BSPs to it. Save and replace the original file. If your level has a _h file (such as s01_h.ONE), replace that as well.
  
 
=== Visibility ===
 
=== Visibility ===
 
For more information, see [[SCHG:Sonic Heroes/Visibility Editing|Visibility Editing]].
 
For more information, see [[SCHG:Sonic Heroes/Visibility Editing|Visibility Editing]].
  
Each chunk is rendered if the camera is inside the visibility boundaries defined in the ''_blk.bin'' file. We'll use [[Heroes Visibility Editor]] to edit it. The file is named s{{red|LL}}_blk.bin or stg{{red|LL}}_blk.bin the same way the .ONE is. Open the file in the editor and set the minimum and maximum coordinates you want the model to be visible in. For precise values, create a box in 3ds Max and make sure it encompasses the entire chunk (but it doesn't have to; for example, skybox models are located far from the chunk boundaries). Then, export the box to a .OBJ and get the values from there (getting the values straight from 3ds Max is risky as it uses the Z axis for up, unlike Sonic Heroes which uses Y-up). You should test your model now, or wait to do so after adding the textures.
+
Each chunk is rendered if the camera is inside the visibility boundaries defined in the ''_blk.bin'' file. We'll use [[Heroes Visibility Editor]] to edit it. The file is named s{{red|LL}}_blk.bin or stg{{red|LL}}_blk.bin. Open the file in the editor and set the minimum and maximum coordinates you want the model to be visible at; for more precise values, create a box in 3ds Max and make sure it encompasses the entire chunk, or the entire area you want your chunk to be visible in. Then, export the box to a .OBJ, open it in a text editor and get the values from there. You should test your model ingame now, or wait to do so after adding the textures.
  
 
=== Textures ===
 
=== Textures ===
Line 45: Line 61:
 
For more information, see [[SCHG:Sonic Heroes/Collision Format|Collision Format]].
 
For more information, see [[SCHG:Sonic Heroes/Collision Format|Collision Format]].
  
First, you must create a collision model. You should start from your level's original model, but get rid of details such as plants that are not supposed to be touchable. You can also add invisible geometry to your collision model. Replace stairs with ramps. This model has a maximum size of 65535 vertices and/or triangles. Once converted, replace the collision file in the dvdroot/collisions folder.
+
First, you must create a collision model. You should start from your level's original model, but get rid of details such as plants that are not supposed to be touchable. You can also add invisible geometry to your collision model. Replace stairs with ramps. Make sure the model is as simple as possible. This model has a maximum size of 65535 vertices and/or triangles. Export it as .OBJ and convert it to .CL using HeroesOBJ2CL or HeroesCollisionGenerator. Once converted, replace the file in the dvdroot\collisions folder (it's named s{{red|LL}}.cl).
  
Neither of the currently available tools for collision generation are complete at the moment; there's no way to tell them what's a floor or a wall yet, and no way to create pinball and bingo surfaces unless you hex edit the file yourself.
+
Neither of the currently available tools are complete at the moment; there's no way to tell them what's a floor or a wall yet, and no way to create pinball and bingo surfaces unless you hex edit the file yourself. The output can also be also somewhat buggy, specially if your model is very complex.
  
 
=== Using HeroesOBJ2CL ===
 
=== Using HeroesOBJ2CL ===
Once the model's ready, export it as an .obj and drag it into HeroesOBJ2CL. It ask you for a maximum depth level. If this is the first time you generate the file, you should try something between 3-5, as you probably want to test the level right away and don't want the operation to take too long. Lower maximums will take much less time to generate, but the resulting file is unoptimized, meaning the game will take more of your CPU and might slow down more often. If you're releasing your level now, try higher values, or just type 0 for the program to choose one atomatically (it'll try to make each quadtree node about 50 units in side). Models with lots of triangles and a high depth level can take a very long time to get ready (don't expect less than an hour, you should leave it running and go outside or something).
+
Drag your .OBJ into HeroesOBJ2CL. It ask you for a maximum depth level. To test, you should try something between 3-5, as you probably want to try the level right away and don't want the operation to take too long. Choosing lower levels will have the file generated very quickly, but the game will take more of your CPU when running and you might have framerate drops. You should go for higher levels (10 if you can) when releasing as they are more optimized and will run better, but they can take a very long time to get ready (it increases exponentially by depth level, don't expect less than an hour, you should leave it running and go outside or something).
  
 
=== Using HeroesCollisionGenerator ===
 
=== Using HeroesCollisionGenerator ===
HeroesCollisionGenerator is a much faster alternative for OBJ2CL made by sewer56lol. You can get the source [https://github.com/sewer56lol/Heroes-Collision-Generator-II here].
+
HeroesCollisionGenerator is a much faster alternative for OBJ2CL made by sewer56lol. It requires .NET Core 2.0 to run. You can get the source [https://github.com/sewer56lol/Heroes-Collision-Generator-II here].
  
 
''To do''
 
''To do''
Line 61: Line 77:
  
 
== Objects ==
 
== Objects ==
For this, you'll need [[Heroes Layout Editor]] and [[Heroes SET ID Table Editor]]. Object layouts are contained in s**_p**.bin for each level and team. Please read the [[SCHG:Sonic Heroes/Object Editing|Object Editing]] and [[SCHG:Sonic Heroes/Object Porting|Object Porting]] pages for info on this.
+
For this, you'll need [[Heroes Layout Editor]] and [[Heroes SET ID Table Editor]]. Object layouts are contained in s**_p**.bin for each level and team. Once you open a layout file in the editor, it should be pretty straightfoward; just place objects wherever you want. Please read the [[SCHG:Sonic Heroes/Object Editing|Object Editing]] and [[SCHG:Sonic Heroes/Object Porting|Object Porting]] pages for all the info on this.
  
 
== Starting Positions, Ending Positions and Splines ==
 
== Starting Positions, Ending Positions and Splines ==
Line 70: Line 86:
 
For starting and ending positions, the only thing that shouldn't be self-explanatory is the hold time; it's the time you spend running before you gain control of the characters. It only applies to a Running start mode. Get the coordinates from the object layout editor for convenience.
 
For starting and ending positions, the only thing that shouldn't be self-explanatory is the hold time; it's the time you spend running before you gain control of the characters. It only applies to a Running start mode. Get the coordinates from the object layout editor for convenience.
  
Splines are located in Tsonic_win.exe. There are 3 types of splines: autoloops, rails and ball paths. By the way, ball paths are those tubes used in Casino Park and BINGO Highway (it's them in those Power Plant green spheres as well).
+
Splines are located in Tsonic_win.exe. There are 3 types of splines: autoloops, rails and ball paths. Ball paths are those tubes used in Casino Park and BINGO Highway (it's them in those Power Plant green spheres as well).
  
 
HeroesTweaker lets you edit splines for most levels (we have all single player levels, but not all bosses and 2P levels yet; if you find the pointer list to the splines of any level, add its offset and amount of pointers to SplinePointers.ini and to this wiki please). It can edit the spline type for each spline, as well as export and import an OBJ file with them (when importing, make sure the only thing in the OBJ file is the spline). The imported file must have the same amount of vertices as the original one. You can't add or remove splines or vertices. If you wanna add more vertices to a spline, you must hex edit Tsonic_win.exe and do that there (if you wanna add more points to a spline, you'll have to switch some pointers around, but you can import the spline in HeroesTweaker after that).
 
HeroesTweaker lets you edit splines for most levels (we have all single player levels, but not all bosses and 2P levels yet; if you find the pointer list to the splines of any level, add its offset and amount of pointers to SplinePointers.ini and to this wiki please). It can edit the spline type for each spline, as well as export and import an OBJ file with them (when importing, make sure the only thing in the OBJ file is the spline). The imported file must have the same amount of vertices as the original one. You can't add or remove splines or vertices. If you wanna add more vertices to a spline, you must hex edit Tsonic_win.exe and do that there (if you wanna add more points to a spline, you'll have to switch some pointers around, but you can import the spline in HeroesTweaker after that).
Line 81: Line 97:
 
Music is located in looping ADX files in the bgm folder. If the music's not looped, it won't start again after ending.
 
Music is located in looping ADX files in the bgm folder. If the music's not looped, it won't start again after ending.
  
We also have [[SCHG:Sonic Heroes/Indirect Editing|Indirect Editing]] and [[SCHG:Sonic Heroes/Particle Editing|Particle Editing]].
+
We also have [[SCHG:Sonic Heroes/Indirect Editing|Indirect Editing]] and [[SCHG:Sonic Heroes/Particle Editing|Particle Editing]]. In [[SCHG:Sonic Heroes/EXE Editing|EXE Editing]] there's a lot of stuff we don't have programs to edit yet, too.
  
 
There's one thing we do not know anything about yet; those are cameras. For now, just replace the ''_cam.bin'' file with an empty one. Eventually we'll be able to edit them as well.
 
There's one thing we do not know anything about yet; those are cameras. For now, just replace the ''_cam.bin'' file with an empty one. Eventually we'll be able to edit them as well.
  
 
[[Category:SCHG How-tos]]
 
[[Category:SCHG How-tos]]

Revision as of 13:36, 14 July 2017

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

(Original guide by igorseabra4)

This guide will show you how to create a custom level in Sonic Heroes.

Introduction

First of all, you should come here and download pretty much everything in that page. It has every program this page mentions, except for HeroesONE, Magic.TXD, 3ds Max and HeroesCollisionEditor, all of which you should get as well. Make sure you are using the latest version of each tool.

In the PC version of Sonic Heroes, level models are multiple .BSP files located inside .ONE archives, which are located in the dvdroot folder. We'll be using HeroesOBJ2BSP (available in the link above) to convert .OBJ model files (with a .MTL material library) exported from 3ds Max (you can try using other model editors, but I can't guarantee it'll work) into .BSPs readable by Heroes. Then we'll use HeroesONE to put the .BSPs inside a .ONE archive and replace one of the original level models. Then, we'll add the textures to the level's .TXD texture archive file with Magic.TXD and edit visibility data in the level's _blk.bin file with Heroes Visibility Editor. This should be enough for your custom models to be rendered ingame. After that, we'll create a collision model and convert it to a .CL readable by Heroes using HeroesCL2OBJ or HeroesCollisionEditor. We'll also cover editing object layouts and then move on to other stuff.

If this is your first time creating a level for this game, it's a good idea to first extract and take a look at the original levels, to see stuff like their size, shape, how they're laid out, what types of textures are in each .BSP etc. Use either HeroesBSP2OBJ or File:Bsp2objv021sonic.zip to rip the original .BSP models after extracting them from the original .ONE archives, Magic.TXD to rip the textures and HeroesCL2OBJ to rip the collision models. You can also play a bit with Heroes Layout Editor, add a few random objects or teleport around the stage for a bit. Make sure to read the entire tutorial and as much of these wiki pages as you can, so you know what you're doing and you're not just throwing models at a wall to see what renders.

Since the console versions of Sonic Heroes use the same file types for most files and do accept .BSPs from the PC version, you can create custom levels for the PC or any of them, as long as you remember to save the .TXD in the correct version (Magic.TXD allows you to choose either PC, GameCube or PlayStation2). There's only start/ending position and spline editors for the PC EXE though.

Level Models

For more information, see Model Format.

First of all, you should choose a stage to replace. Choose based on the theme of the stage you plan to make and objects you want to use, as some only work in a few level slots. Also, pinball table/BINGO mode only works on levels which originally had them. The .ONE files for the levels are named sLL.one, where LL is the level number (some start with stg instead of s). For a complete list of level numbers, see the File Names and Data level list.

If this is your first time creating a level for this game, first you should open one of the original .ONEs with HeroesONE and take a look at how the .BSPs inside it are named:

SLL_MM_NN.BSP (or STG instead of S, accordingly with the .ONE name)

LL is the level number, MM is the material setting identifier and NN is the chunk number.

Levels in Sonic Heroes are divided into multiple NN chunks. Each chunk has a number and can have a large number of BSPs set for it. All files with the same NN number make up the same chunk. For the game to know which chunk to display at a given time, the camera must be inside boundaries set in the *_blk.bin file, which we'll discuss soon; if the BSP has no number (SLL_MM.BSP) it'll be rendered all the time.

The files also have different MM material settings. They will set how the model is rendered. For a complete list of what you can use, see Material Flags. These are some of them:

  • ON - Normal
  • ONS - Normal, shadow casting
  • ONW - Normal, no culling
  • ONWS - Normal, no culling, shadow casting
  • DN - Skybox
  • PN - Normal, alpha testing
  • PNS - Normal, alpha testing, shadow casting
  • PNW - Normal, alpha testing, no culling
  • PNWS - Normal, alpha testing, shadow casting, no culling
  • AFN - Alpha material
  • AFNS - Alpha material, shadow casting
  • K - Additive alpha
  • KW - Additive alpha, no culling

Drag an .OBJ file exported from 3ds Max (remember to use Y axis = up) into HeroesOBJ2BSP to convert it into a .BSP file (as of release 5, you can drag multiple files or just double-click the program to convert every .OBJ in the folder). Model must use triangles; there's a maximum of 65535 vertices and triangles. If you have a number just under that, the limit might be reached, because HeroesOBJ2BSP will add new vertices for use with new UV coordinates (.BSPs use per-vertex UVs). Your model should be far smaller than that, though - remember you can use multiple .BSPs, so split your level into chunks! Remember your .OBJ must use dots (.), not commas (,) as floating point separators in case you're from a country which uses that. And don't drag the .MTL into the program, it'll load that automatically.

It'll spit out a .BSP with the same name of your .OBJ. Name it according to the explanation above (if this is your first test, just name it SLL_ON_01.BSP). Create a new file in HeroesONE and add your .BSPs to it. Save and replace the original file. If your level has a _h file (such as s01_h.ONE), replace that as well.

Visibility

For more information, see Visibility Editing.

Each chunk is rendered if the camera is inside the visibility boundaries defined in the _blk.bin file. We'll use Heroes Visibility Editor to edit it. The file is named sLL_blk.bin or stgLL_blk.bin. Open the file in the editor and set the minimum and maximum coordinates you want the model to be visible at; for more precise values, create a box in 3ds Max and make sure it encompasses the entire chunk, or the entire area you want your chunk to be visible in. Then, export the box to a .OBJ, open it in a text editor and get the values from there. You should test your model ingame now, or wait to do so after adding the textures.

Textures

We'll be using Magic.TXD for the textures.

HeroesOBJ2BSP will try getting the texture names from the files specified in the .OBJ's referenced .MTL file. If you exported your model with the default 3ds Max settings, it should do this with no problem. If it fails to, it will use the material names (set by usemtl in the .OBJ file) as texture names. It will warn you if it does so.

The TXD files for level textures are located in dvdroot/textures. You'll probably figure out by now the name of your level's. Open it in Magic.TXD. Use Edit->Add or the Insert shortcut key or just drag your images into the list to add them to the file. Save and make sure the version of the TXD is correct (it should be Sonic Heroes PC, or GameCube or PlayStation 2 if you're editing those versions). Don't delete the original textures from the file unless you're sure of what you're doing. Remember this file contains textures for both level and object models. If you extracted the textures from the game already you obviously don't need to add them a second time. You should test your model now and it should render correctly.

Level Collision

For more information, see Collision Format.

First, you must create a collision model. You should start from your level's original model, but get rid of details such as plants that are not supposed to be touchable. You can also add invisible geometry to your collision model. Replace stairs with ramps. Make sure the model is as simple as possible. This model has a maximum size of 65535 vertices and/or triangles. Export it as .OBJ and convert it to .CL using HeroesOBJ2CL or HeroesCollisionGenerator. Once converted, replace the file in the dvdroot\collisions folder (it's named sLL.cl).

Neither of the currently available tools are complete at the moment; there's no way to tell them what's a floor or a wall yet, and no way to create pinball and bingo surfaces unless you hex edit the file yourself. The output can also be also somewhat buggy, specially if your model is very complex.

Using HeroesOBJ2CL

Drag your .OBJ into HeroesOBJ2CL. It ask you for a maximum depth level. To test, you should try something between 3-5, as you probably want to try the level right away and don't want the operation to take too long. Choosing lower levels will have the file generated very quickly, but the game will take more of your CPU when running and you might have framerate drops. You should go for higher levels (10 if you can) when releasing as they are more optimized and will run better, but they can take a very long time to get ready (it increases exponentially by depth level, don't expect less than an hour, you should leave it running and go outside or something).

Using HeroesCollisionGenerator

HeroesCollisionGenerator is a much faster alternative for OBJ2CL made by sewer56lol. It requires .NET Core 2.0 to run. You can get the source here.

To do

Death Zones and Water

To do

Objects

For this, you'll need Heroes Layout Editor and Heroes SET ID Table Editor. Object layouts are contained in s**_p**.bin for each level and team. Once you open a layout file in the editor, it should be pretty straightfoward; just place objects wherever you want. Please read the Object Editing and Object Porting pages for all the info on this.

Starting Positions, Ending Positions and Splines

For more information, see EXE Editing.

You'll need to use HeroesTweaker for all of those. This data is located in Tsonic_win.exe.

For starting and ending positions, the only thing that shouldn't be self-explanatory is the hold time; it's the time you spend running before you gain control of the characters. It only applies to a Running start mode. Get the coordinates from the object layout editor for convenience.

Splines are located in Tsonic_win.exe. There are 3 types of splines: autoloops, rails and ball paths. Ball paths are those tubes used in Casino Park and BINGO Highway (it's them in those Power Plant green spheres as well).

HeroesTweaker lets you edit splines for most levels (we have all single player levels, but not all bosses and 2P levels yet; if you find the pointer list to the splines of any level, add its offset and amount of pointers to SplinePointers.ini and to this wiki please). It can edit the spline type for each spline, as well as export and import an OBJ file with them (when importing, make sure the only thing in the OBJ file is the spline). The imported file must have the same amount of vertices as the original one. You can't add or remove splines or vertices. If you wanna add more vertices to a spline, you must hex edit Tsonic_win.exe and do that there (if you wanna add more points to a spline, you'll have to switch some pointers around, but you can import the spline in HeroesTweaker after that).

Note that if you want a very long rail or autoloop and your level doesn't include that, you can glue the end of a spline to the start of the next and it will act like it's the same one (the original game actually does this all the time).

Other Stuff

Lightning data in s**_light.bin files. We don't know their format yet, but we do know they contain multiple light data entries. They are applied to characters and objects only (it's not environmental lightning). The main entry is applied all the time, and each of the other entries is applied by trigger objects.

Music is located in looping ADX files in the bgm folder. If the music's not looped, it won't start again after ending.

We also have Indirect Editing and Particle Editing. In EXE Editing there's a lot of stuff we don't have programs to edit yet, too.

There's one thing we do not know anything about yet; those are cameras. For now, just replace the _cam.bin file with an empty one. Eventually we'll be able to edit them as well.