Actions

SCHG How-to

Difference between revisions of "Creating Levels in Sonic Heroes"

From Sonic Retro

m (Setting Up a Mod)
 
(11 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
{{GuideBy|igorseabra4}}
 
{{GuideBy|igorseabra4}}
  
This guide will show you how to create a custom level in Sonic Heroes. We will mainly be using [[Heroes Power Plant]] and creating a [[Heroes Mod Loader]] compatible level mod.
+
'''WARNING''': the text on this page is obsolete. Please check the [https://github.com/igorseabra4/HeroesPowerPlant/wiki Heroes Power Plant wiki] for up-to-date modding information.
  
 
== Introduction ==
 
== Introduction ==
First of all, you should come [[Heroes Power Plant|here]] and download the latest version of Heroes Power Plant (I'll just refer to it as HPP from now on). Get [https://www.gtamodding.com/wiki/Magic.TXD Magic.TXD] as well, as we're gonna need that to edit TXD texture archives. For model editing, we're gonna use 3ds Max, although it's possible to use other model editors as well, 3ds Max is reccomended due to being easy to export different parts of the model to separate files (which we're gonna need to do). [[Heroes Mod Loader]] will be used to load the levels for testing and playing ingame, and [[HeroesONE]] is optional but necessary if you're porting objects between levels.
+
This guide will show you how to create a custom level in Sonic Heroes. We will mainly be using [[Heroes Power Plant]] and creating a [[Reloaded Mod Loader]] compatible level mod.
 +
 
 +
First of all, you should come [[Heroes Power Plant|here]] and download the latest version of Heroes Power Plant (I'll just refer to it as HPP from now on). Get [https://www.gtamodding.com/wiki/Magic.TXD Magic.TXD] as well, as we're gonna need that to edit TXD texture archives. For model editing, we're gonna use 3ds Max, although it's possible to use other model editors as well, 3ds Max is reccomended due to being easy to export different parts of the model to separate files (which we're gonna need to do). [[Reloaded Mod Loader]] will be used to load the levels for testing and playing ingame, and [[HeroesONE]] is optional but necessary if you're porting objects between levels.
  
 
In the PC version of Sonic Heroes, level models are multiple BSP files located inside ONE archives; their visibility data in the level's s*_blk.bin file. Both are located in the dvdroot folder. The collision model is a CL file in the dvdroot/collisions folder. HPP can handle editing of those. Textures are located in a TXD archive, which we'll edit with Magic.TXD.
 
In the PC version of Sonic Heroes, level models are multiple BSP files located inside ONE archives; their visibility data in the level's s*_blk.bin file. Both are located in the dvdroot folder. The collision model is a CL file in the dvdroot/collisions folder. HPP can handle editing of those. Textures are located in a TXD archive, which we'll edit with Magic.TXD.
  
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 etc. HPP can export level models and collision models in OBJ format, but it can't load all BSPs; some of them you'll have to rip with [[File:Bsp2objv021sonic.zip]] (included in the HPP download) after extracting the raw data from the original ONE. Magic.TXD can rip the textures.
+
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 etc. HPP can export level models and collision models in OBJ format. Magic.TXD can rip the textures.
  
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). However, data located in the EXE such as start positions can't be modified in those as there's no mod loader for these versions.
+
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, Xbox or PlayStation2). However, data located in the EXE such as start positions can't be modified in those as there's no mod loader for these versions.
  
 
== Setting Up a Mod ==
 
== Setting Up a Mod ==
First of all, we're going to set up a mod folder for your work. Your stage is going to use the Generic Stage Injection Mod to replace start positions and splines at runtime by the Mod Loader, without need to edit the game's EXE. None of the game's original files will be replaced during this, but even so, it's reccomended you back all of them up just in case you mess something up or something goes wrong.
+
First of all, we're going to set up a mod folder for your work. Your stage is going to use the Generic Stage Injection Mod to replace start positions and splines at runtime by the Mod Loader, without need to edit the game's EXE. None of the game's original files will be replaced during this.
 
 
Notice the HPP package has a folder called Generic Stage Injection Mod DLLs. You'll find two DLLs named main.dll inside Development and Release folders. As quoted straight from the readme.txt file also located here:
 
 
 
These two Mod Loader mod main.dll files contain custom start position and spline injection mods which are loaded from the Config.cc file generated by HPP.
 
  
The difference between them is that the DLL in the Development folder contains additional code for re-replacing the mod files while the game is running; this means you can edit the files and see the changes ingame in real time (the files are replaced again every time you quit a stage). The DLL in the Release folder doesn't have this function, and the stage is injected into the game only once, since the players are not going to edit the files. While making your levels, use the Development DLL; when releasing them, use the Release DLL. Each DLL will output a different message to the Mod Loader log, so you can know which one you're currently using.
+
Notice the HPP package has a folder called Generic Stage Injection Mod. In it, there's a small readme with steps on setting up your Reloaded mod. Follow them and come back to this once you have your mod set up.
  
Note that, in the Development DLL, splines are injected only once, so to see changes in them you must quit the game and open it again. Start positions and all other files will be replaced with the game running.
+
Before using HPP, noticed the readme. It explains a bit about how to use the program and I really reccomend you to read it as I'm not gonna explain here.
  
With that in mind, browse to your Heroes Mod Loader folder and take a look into "Mod-Loader-Mods". Create a new folder here and name it whatever you want to. Then, create a text file named Mod.ini and place it in this folder (you can copy one from another mod if you're lazy) and edit it to fill it with your mod's info. Copy your Development main.dll here as well (or the Release one, if that's what you want). Now create a new folder called "root" here and another one called "dvdroot" under root (you can mimic this from other mods). If you want to, right now you can also create a "collisions" and a "textures" folder under dvdroot so you won't have to do it later.
+
Open the Mod Loader Config Editor window and create a new file. In the Level Flag box, choose which level you want your custom one to replace; this is an important step as some objects will only work in the level slots they originally belonged to (such as frogs) and pinball table and bingo slide collision also only works in slots which originally had them. So once you've picked a level that suits your desires, save the file as Stage.json in your mod stage folder.
  
Open up HPP and you'll see a black screen. Press F1 to show the Viewport Config window, which shows some information about what's being drawn. This window also has a bunch of text explaning how to use the program and I really reccomend you to read it as I'm not gonna explain here. Open the Mod Loader Config Editor window and create a new file. In the Level Flag box, choose which level you want your custom one to replace; this is an important step as some objects will only work in the level slots they originally belonged to (such as frogs) and pinball table and bingo slide collision also only works in slots which originally had them. So once you've picked a level that suits your desires, save the file as Config.cc (other names won't work) in your mod folder. A "Splines" folder with a file named 0.obj should also pop up, leave that there for now.
+
If you try your mod now, since there are no new files, all you're gonna get ingame is the original level but you'll start at the 0, 0, 0 position and there will be no splines.
 
 
Your mod should be set up and will show up in the Mod Loader for enabling. If you try it now, since there are no new files, all you're gonna get ingame is the original level but you'll start at the 0, 0, 0 position and there will be no splines.
 
  
 
== Level Models ==
 
== Level Models ==
Line 44: Line 40:
 
For the game to know which chunk to display at a given time, the camera must be inside boundaries set in the ''s*_blk.bin file'', which we'll discuss soon; if the last part of the name is ommited (S{{red|LL}}_{{green|MM}}.BSP) the file will always be displayed (this is used for some levels' skyboxes).
 
For the game to know which chunk to display at a given time, the camera must be inside boundaries set in the ''s*_blk.bin file'', which we'll discuss soon; if the last part of the name is ommited (S{{red|LL}}_{{green|MM}}.BSP) the file will always be displayed (this is used for some levels' skyboxes).
  
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:
+
The files also have different {{green|MM}} material settings. They will set how the model is rendered. They are the following:
  
*ON - Normal
+
{| class="prettytable"
*ONS - Normal, shadow casting
+
!Identifier||Description
*ONW - Normal, no culling
+
|-
*ONWS - Normal, no culling, shadow casting
+
| DN
*DN - Skybox
+
| Sky model material
*PN - Normal, alpha testing
+
|-
*PNS - Normal, alpha testing, shadow casting
+
| O
*PNW - Normal, alpha testing, no culling
+
| Reflective material
*PNWS - Normal, alpha testing, shadow casting, no culling
+
|-
*DA - Skybox, alpha material
+
| OS
*AFN - Alpha material
+
| Reflective floor material
*AFNS - Alpha material, shadow casting
+
|-
*K - Additive alpha
+
| ON
*KW - Additive alpha, no culling
+
| Regular material
 +
|-
 +
| ONS
 +
| Regular floor material
 +
|-
 +
| ONW
 +
| Regular material without culling
 +
|-
 +
| ONWS
 +
| Regular floor material without culling
 +
|-
 +
| P
 +
| Alpha testing with reflective material
 +
|-
 +
| PS
 +
| Alpha testing with reflective floor material
 +
|-
 +
| PN
 +
| Alpha testing material
 +
|-
 +
| PNS
 +
| Alpha testing floor material
 +
|-
 +
| PNW
 +
| Alpha testing material without culling
 +
|-
 +
| PNWS
 +
| Alpha testing floor material without culling
 +
|-
 +
| DA
 +
| Alpha sky material
 +
|-
 +
| AF
 +
| Alpha reflective material
 +
|-
 +
| AFS
 +
| Alpha reflective floor material
 +
|-
 +
| AFN
 +
| Alpha material
 +
|-
 +
| AFNS
 +
| Alpha floor material
 +
|-
 +
| K
 +
| Additive alpha material
 +
|-
 +
| KW
 +
| Additive alpha material without culling
 +
|-
 +
| A
 +
| Alpha reflective material
 +
|-
 +
| AS
 +
| Alpha reflective floor material
 +
|-
 +
| AN
 +
| Alpha material
 +
|-
 +
| ANS
 +
| Alpha floor material
 +
|}
  
 
=== Importing Your Models ===
 
=== Importing Your Models ===
 
In 3ds Max, you should split your models into meshes so that each mesh will be converted into one BSP file. You can first split the model into multiple by chunk, then split each chunk into the different components of it: floors should be in their own mesh (ONS) as they recieve shadows and walls (ON) don't. Parts of the model with textures with alpha testing should have the PN in their name, textures with normal alpha should have the AFN in their name, the skybox will be DN, effects such as water and glow will be K and so on. You can name your meshes the same name of their BSP so you won't have trouble renaming them later. A file name for the floor models of the third chunk in Seaside Hill would be S01_ONS_03.BSP, a name for a model with alpha textures for the fourth chunk in Casino Park would be STG05_AFN_04.BSP. Note that you can use the shaders from the original stages as well (such as animated water and blue roads from the city levels). Just take a look at the texture name in the original TXD and name your texture accordingly.
 
In 3ds Max, you should split your models into meshes so that each mesh will be converted into one BSP file. You can first split the model into multiple by chunk, then split each chunk into the different components of it: floors should be in their own mesh (ONS) as they recieve shadows and walls (ON) don't. Parts of the model with textures with alpha testing should have the PN in their name, textures with normal alpha should have the AFN in their name, the skybox will be DN, effects such as water and glow will be K and so on. You can name your meshes the same name of their BSP so you won't have trouble renaming them later. A file name for the floor models of the third chunk in Seaside Hill would be S01_ONS_03.BSP, a name for a model with alpha textures for the fourth chunk in Casino Park would be STG05_AFN_04.BSP. Note that you can use the shaders from the original stages as well (such as animated water and blue roads from the city levels). Just take a look at the texture name in the original TXD and name your texture accordingly.
  
There's a maximum of 65535 vertices and triangles per BSP, but each one shouldn't be even close to that (as HeroesModelTool will add extra vertices to fix UV coordinates and vertex colors). Each resulting BSP shouldn't be much bigger than around 400 kb or the game will crash; if that happens, when importing, HPP will warn you of that. In that case, split your files into even more chunks.
+
There's a maximum of 65535 vertices and triangles per BSP, but each one shouldn't be even close to that (as HPP will add extra vertices to fix UV coordinates and vertex colors). Each resulting BSP shouldn't be much bigger than around 400 kb or the game will crash in the game without the [https://github.com/sewer56lol/TONER/releases TONER mod] (PC mod for [https://github.com/sewer56lol/Reloaded-Mod-Loader/releases Reloaded Mod Loader] only); if that happens, when importing, HPP will warn you of that, however with the [https://github.com/sewer56lol/TONER/releases TONER mod] you can bypass this issue. If you wish to stay within these limits for console versions or if you're not using [https://github.com/sewer56lol/Reloaded-Mod-Loader/releases Reloaded] and the [https://github.com/sewer56lol/TONER/releases TONER mod] for some reason, split your files into more chunks. However please note that there is a limit of 256 chunks per stage.
  
 
Export each mesh to a separate OBJ or DAE file (remember to use Y axis = up). The model must use triangular faces, contain vertex positions and texture coordinates. Vertex normals are ignored as the game doesn't use them, and for DAE, vertex colors are supported (Heroes uses vertex colors extensively for shading and shadows on the models). Texture names will be the same ones of the textures you're using in 3ds Max. Their names cannot contain spaces. [http://www.scriptspot.com/3ds-max/scripts/batch-exportimport This addon for 3ds Max] can automatically export each model to a separate file just as we need.
 
Export each mesh to a separate OBJ or DAE file (remember to use Y axis = up). The model must use triangular faces, contain vertex positions and texture coordinates. Vertex normals are ignored as the game doesn't use them, and for DAE, vertex colors are supported (Heroes uses vertex colors extensively for shading and shadows on the models). Texture names will be the same ones of the textures you're using in 3ds Max. Their names cannot contain spaces. [http://www.scriptspot.com/3ds-max/scripts/batch-exportimport This addon for 3ds Max] can automatically export each model to a separate file just as we need.
  
Now, import your models using HPP's Level Editor. Double-click the files to rename them if needed, then save. Take a look into your original game's dvdroot folder. If there's a s(tg){{red|LL}}_h.one file for your level, then that should be your ONE file name; if there isn't, save it as s(tg){{red|LL}}.one. Save it inside your mod's root\dvdroot folder (in your mod's folder), don't replace any of the original files. Saving a ONE file takes quite a bit of time, the program might hang up for up to one minute.
+
Now, import your models using HPP's Level Editor. Double-click the files to rename them if needed, then save. Take a look into your original game's dvdroot folder. If there's a s(tg){{red|LL}}_h.one file for your level, then that should be your ONE file name; if there isn't, save it as s(tg){{red|LL}}.one. Save it inside your mod's Files folder, don't replace any of the original files.
  
 
Since you have no visibility file set up yet, nothing will initially show up; disable the Render By Chunk checkbox in the Viewport Config (or the H shortcut key) to disable per-chunk rendering. If you did everything correctly, your models should show up in HPP.
 
Since you have no visibility file set up yet, nothing will initially show up; disable the Render By Chunk checkbox in the Viewport Config (or the H shortcut key) to disable per-chunk rendering. If you did everything correctly, your models should show up in HPP.
  
Except they probably have no textures if you haven't set that up yet. To set up textures for HPP, create a new folder with the same name of your ONE (without the extension) under HPP's Resources folder (there's an example s01 folder there). Place your textures in PNG format in that folder and HPP will be able to render your level with textures once you save or reload the ONE. This obviously won't add your textures to the game, as for that they must be put in the TXD archive.
+
Except they probably have no textures. HPP can display texures either from a TXD file or from a folder containing PNGs. You can choose any number of them under HPP'S Resources tab.
  
 
=== Visibility ===
 
=== Visibility ===
 
For more information, see [[SCHG:Sonic Heroes/Visibility Editing|Visibility Editing]].
 
For more information, see [[SCHG:Sonic Heroes/Visibility Editing|Visibility Editing]].
  
Ingame, each chunk is rendered if the camera is inside the visibility boundaries defined in the ''_blk.bin'' file. The level editor in HPP includes a visibility editor, where you can add chunks, set the number that they refer to, edit their maximums and minimums and see the chunk boundaries displayed in the viewport (disabled by default, check Chunk Boxes in the Viewport Config or press B to toggle that). You can verify that the chunks are rendered in the proper locations by disabling Render By Chunk and checking them out in HPP. When you're happy with your visibility layout, save the file as s(tg){{red|LL}}_blk.bin in your mod's root\dvdroot folder along with the ONE. From now on, when opening the ONE in the Level Editor, the visibility file will be loaded as well.
+
Ingame, each chunk is rendered if the camera is inside the visibility boundaries defined in the ''_blk.bin'' file. The level editor in HPP includes a visibility editor, where you can add chunks, set the number that they refer to (there can be multiple), edit their maximums and minimums and see the chunk boundaries displayed in the viewport (disabled by default, check Chunk Boxes in the Viewport Config or press B to toggle that). The AutoChunk function will automatically calculate chunk boundaries for you with an offset. You can verify that the chunks are rendered in the proper locations by disabling Render By Chunk and checking them out in HPP. When you're happy with your visibility layout, save the file as s(tg){{red|LL}}_blk.bin in your mod stages Files folder along with the ONE. From now on, when opening the ONE in the Level Editor, the visibility file will be loaded as well.
  
 
If you run your game with the mod enabled now, you'll probably be able to see the custom models, except they have no textures since we didn't add that yet. Also, you have no start position and the collision is still the original level's. It's a good idea to test it now, because if the game crashes, that probably means one of your BSP files is too big (the game doesn't crash if you have an invalid BSP or visibility file, only if it's valid but too big).
 
If you run your game with the mod enabled now, you'll probably be able to see the custom models, except they have no textures since we didn't add that yet. Also, you have no start position and the collision is still the original level's. It's a good idea to test it now, because if the game crashes, that probably means one of your BSP files is too big (the game doesn't crash if you have an invalid BSP or visibility file, only if it's valid but too big).
Line 84: Line 141:
 
We'll be using [https://www.gtamodding.com/wiki/Magic.TXD Magic.TXD] for the textures.
 
We'll be using [https://www.gtamodding.com/wiki/Magic.TXD Magic.TXD] for the textures.
  
The TXD files for level textures are located in dvdroot/textures. You'll probably figure out by now the name of your level's. Copy the original TXD from your game to your mod's root\dvdroot\textures folder and open it in Magic.TXD.
+
The TXD files for level textures are located in dvdroot/textures. You'll probably figure out by now the name of your level's. Copy the original TXD from your game to your mod's Files\textures folder and open it in Magic.TXD.
  
Use Edit->Add or the Insert shortcut key or just drag your new textures into the list to add them to the file. Each texture should have mipmaps and be DXT1 compressed, except for textures with alpha (you can manipulate those settings in Magic.TXD by pressing M with the texture selected; just take a look the format the original textures use and try to mimic it).
+
Use Edit->Add or the Insert shortcut key or just drag your new textures into the list to add them to the file. I reccomend setting each texture to have mipmaps and DXT1 compression, but you can choose any format you see fit, except for textures with alpha (you can manipulate those settings in Magic.TXD by pressing M with the texture selected; just take a look the format the original textures use and try to mimic it).
  
 
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 (some levels will crash without certain textures). Remember this file contains textures for both level and object models. If your model uses the same textures from the game that are already in the file (such as shaders) you obviously don't need to add them a second time. You should test your level again now and it should render correctly.
 
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 (some levels will crash without certain textures). Remember this file contains textures for both level and object models. If your model uses the same textures from the game that are already in the file (such as shaders) you obviously don't need to add them a second time. You should test your level again now and it should render correctly.
Line 93: Line 150:
 
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 it. Replace stairs with ramps. Make sure the model is as simple as possible. Split it into multiple meshes, as this division will be kept in the file. This model has a maximum size of 65535 vertices and/or triangles. Export it as OBJ and import it with HPP's Collision Editor window. Save it in the mod's root\dvdroot\collisions folder (it's named s(tg){{red|LL}}.cl).
+
First, you must create a collision model. You should start from your level's original model, but get rid of details such as plants and complex items that are not supposed to be touchable. You can also add invisible geometry to it. Replace stairs with ramps. Make sure the model is as simple as possible. Split it into multiple meshes, as this division will be kept in the file. This model has a maximum size of 65535 vertices and/or triangles. Export it as OBJ and import it with HPP's Collision Editor window. Save it in the mod's root\dvdroot\collisions folder (it's named s(tg){{red|LL}}.cl).
  
 
Notice there are a few settings in the collision editor: depth level, power flag and flip normals. If you're just a regular stage modder and have zero idea how Sonic Heroes internally handles collision, just leave them as they are (depth level at 5 and power flag at 0xD). If you want to, you can set the depth level to auto. This will usually result in your collision quadtree's depth level being from 8 to 10. This means the game will take less CPU to check for collisions and will run better (at a higher resolution, no framerate drops) on lower-end computers, which is your goal (you want people to play your level even if they have bad PCs) (if you set your depth level to 1 or 2, even if you have a nice PC your game will lag terribly). But custom collision files with high depth levels are known to make the game crash at random spots while running (we have no idea why) and that's why we can just leave it at 5 for now, as it won't crash and won't make your game lag unless you have a computer with terrible specs. If it works, why bother? As for the power flag, it defines a few numbers that are added to the quadtree's settings, we don't know much about what it does. Most of the original files leave it at 0xD so that's what we do.
 
Notice there are a few settings in the collision editor: depth level, power flag and flip normals. If you're just a regular stage modder and have zero idea how Sonic Heroes internally handles collision, just leave them as they are (depth level at 5 and power flag at 0xD). If you want to, you can set the depth level to auto. This will usually result in your collision quadtree's depth level being from 8 to 10. This means the game will take less CPU to check for collisions and will run better (at a higher resolution, no framerate drops) on lower-end computers, which is your goal (you want people to play your level even if they have bad PCs) (if you set your depth level to 1 or 2, even if you have a nice PC your game will lag terribly). But custom collision files with high depth levels are known to make the game crash at random spots while running (we have no idea why) and that's why we can just leave it at 5 for now, as it won't crash and won't make your game lag unless you have a computer with terrible specs. If it works, why bother? As for the power flag, it defines a few numbers that are added to the quadtree's settings, we don't know much about what it does. Most of the original files leave it at 0xD so that's what we do.
Line 100: Line 157:
  
 
=== Collision Flags ===
 
=== Collision Flags ===
When creating your collision model, you must name your meshes so they represent different parts of the level. Append an underscore _ and one of the following letters to set the collision type for that mesh:
+
When creating your collision model, you must name your meshes so they represent different parts of the level. In HPP's readme, you can find a full list of flags which can be appended to the mesh name with an underscore _ to set the collision type for that mesh.
 
 
*nothing - normal floor collision
 
*_a - Water collision (for _wt.cl).
 
*_b - Bingo slide.
 
*_i - Invisible wall. No noticeable difference from normal wall.
 
*_k - Protection barrier. It's a wall that is only solid as long as you are touching the ground.
 
*_l - Slippery wall. It's a wall that has an angle, so you'll slip out of it. You'd be able to walk on it if it was normal floor collision.
 
*_p - Pinball table.
 
*_s - Stairs. Model should be a slope, but your character will stand upright on top of it (if you make a steep slope with this flag, you'll be reminded of Sonic 4)
 
*_t - Triangle jumpable wall.
 
*_w - Wall. You can't walk or run on top of it.
 
*_x - Death collision (for _xx.cl)
 
  
 
Note that the bingo and pinball types will only work in levels which originally had them. The difference between them is that you accelerate much faster and have more control on slides than tables.
 
Note that the bingo and pinball types will only work in levels which originally had them. The difference between them is that you accelerate much faster and have more control on slides than tables.
Line 118: Line 163:
 
If you want to experiment a bit, you can also set the flags manually. Export the collision from one of the original CL files to OBJ, import it in 3ds Max and take a look at how meshes are named. You can append the same type of formatting (_WWXXYYZZ, 4 bytes) and the flags will be that. You can play with flags that have not been documented yet with this.
 
If you want to experiment a bit, you can also set the flags manually. Export the collision from one of the original CL files to OBJ, import it in 3ds Max and take a look at how meshes are named. You can append the same type of formatting (_WWXXYYZZ, 4 bytes) and the flags will be that. You can play with flags that have not been documented yet with this.
  
=== sewer56lol's Collision Tool ===
+
=== sewer56lol's Collision Library ===
sewer56lol has worked on a tool and library for handling CL files. Its collision generator can be considered superior to HPP's for a few technical reasons. You can get the source [https://github.com/sewer56lol/Heroes-Collision-Library here].
+
sewer56lol has worked on a tool and library for handling CL files.  
 +
Its collision generator can be considered superior to HPP's for a few technical reasons.  
 +
You can get the source [https://github.com/sewer56lol/Heroes-Collision-Library here].
 +
 
 +
The project README contains instructions on how to operate the tool and use the library in your own programs if desired.
  
 
=== Death Zones and Water ===
 
=== Death Zones and Water ===
CL files that have _xx or _wt appended to their names contain collision for death and water boundaries, respectively. You can import them with HPP, make sure all models have _a or _x to their names as specified above. When importing, make sure Flip Normals is checked as these files use reversed normals; they'll show up upside down and you'll have to disable culling to see them right side up. These files are a bit problematic and are known not to work ingame for unknown reasons. This is still being worked on. Maybe sewer56lol's collision tool will handle those files better than HPP.
+
CL files that have _xx or _wt appended to their names contain collision for death and water boundaries, respectively. You can import them with HPP, make sure all models have _a or _x to their names as specified above. When importing, make sure Flip Normals is checked as these files use reversed normals; they'll show up upside down and you'll have to disable culling to see them right side up. Also, make sure to set the quadtree depth level to 1 (or 2, maximum).
  
 
== Objects ==
 
== Objects ==
HPP's Layout Editor window can open and edit layout data; [[Heroes SET ID Table Editor]] (which is included in the HPP package) can be used to change object availability for use on certain stages. Object layouts are contained in s(tg)**_p**.bin for each level and team; save them to your root\dvdroot folder. Once you open a layout file in the editor, it should be pretty straightforward; just place objects wherever you want. You can click to select them, move them, rotate, set misc. settings, see a preview of them as a small cube (some objects such as springs and triggers even show up with a different model). 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.
+
HPP's Layout Editor window can open and edit layout data; HPP's SET ID Table Editor can be used to change object availability for use on certain stages. Object layouts are contained in s(tg)**_p**.bin for each level and team; save them to your Files folder. Once you open a layout file in the editor, it should be pretty straightforward; just place objects wherever you want. You can click to select them, move them, rotate, set misc. settings, see a preview of them. 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.
 
 
== Cameras ==
 
''To do: this section''
 
  
 
== Start Positions and Splines ==
 
== Start Positions and Splines ==
Line 135: Line 181:
 
You can set start, ending (victory animation) and bragging (for the start of multiplayer levels) positions in HPP's Mod Loader Config Editor. These will be saved to the Config.cc file. 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.
 
You can set start, ending (victory animation) and bragging (for the start of multiplayer levels) positions in HPP's Mod Loader Config Editor. These will be saved to the Config.cc file. 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.
  
As for splines, you can import those in the Spline Editor window. It is reliant on the Mod Loader Config Editor to display and import splines (that's why it will only show up if you have a config file open). When creating a new Config.cc file, if there are no splines present, a default one of type null is created (the Generic Stage Injection Mod doesn't know how to load zero splines, so it must have at least one). You can delete this default spline after importing at least one custom one.
+
As for splines, you can import those in the Spline Editor window. It is reliant on the Config Editor to display and import splines (that's why it will only show up if you have a config file open).
  
 
When importing a new OBJ file, make sure the only thing in the file is the spline; all the program will do is read all the vertices in order and create the new spline with them. 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]] (level, not program) green spheres as well). You can pick one for each spline (setting it to null will make the spline do nothing, this is useful if you want to disable it without deleting it). The splines can be seen in the view if the option is checked; remember to save.
 
When importing a new OBJ file, make sure the only thing in the file is the spline; all the program will do is read all the vertices in order and create the new spline with them. 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]] (level, not program) green spheres as well). You can pick one for each spline (setting it to null will make the spline do nothing, this is useful if you want to disable it without deleting it). The splines can be seen in the view if the option is checked; remember to save.
  
If for some reason you wish to leave the splines of the original level intact instead of importing your own, you can do that by opening Config.cc in a text editor and removing the line that starts with "PUSH_INSTRUCTION_POINTER". Then, you can delete the Splines folder and its contents, as that line is what makes the Generic Stage Injection Mod load your custom splines. You have to do this again every time you save in HPP.
+
Note that not all levels have spline loaders, meaning you can't add splines for them. These are the levels which did not contain splines originally (such as Sea Gate and Egg Hawk).
 +
 
 +
If you wish to extract and take a look at the original game's splines and start positions, [[HeroesTweaker|Heroes Tweaker]] lets you open Tsonic_win.exe and do that. It can also export the splines as OBJ.
 +
 
 +
== Cameras ==
 +
See [[SCHG:Sonic Heroes/Camera Editing|Camera Editing]].
 +
 
 +
== Particles (PTCL) ==
 +
See [[SCHG:Sonic Heroes/Particle Editing|Particle Editing]].
  
Note that not all levels have spline pointers, meaning you can't add or replace splines for them. The levels which currently have documented ones are the 14 main action stages, Test Level, Egg Albatross and Robot Storm. None of the other bosses, Sea Gate or Multiplayer levels have them yet.
+
== Texture Patterns (TXC) ==
 +
See [[SCHG:Sonic Heroes/Texture Animation Editing|Texture Animation Editing]].
  
If you wish to extract and take a look at the original game's splines and start positions, [[Heroes Tweaker]] (an EXE editor tool which is not updated anymore) lets you open Tsonic_win.exe and do that. It can export the splines as OBJ.
+
== Indirect Info ==
 +
See [[SCHG:Sonic Heroes/Indirect Editing|Indirect Editing]].
  
 
== Custom Mod DLL ==
 
== Custom Mod DLL ==
The Generic Stage Injection Mod, although it has the useful features of replacing start positions and splines from your Config.cc and Splines folder (and mid-game file swapping with the Development version of the mod), can't do much more than that. If you want to edit stuff such as bobsleds, Team Chaotix's mission goals, the amount of items you must collect in their missions, the amount of minutes you have for Team Sonic's Extra mission, the ranking requirements (A, B, C, D ranks) for each team, you must create your own mod DLL, and for that you must know at least the basics of programming in C# with Microsoft Visual Studio. Not only that, you can also add your own code to the game, such as the custom coded mid-level music change implemented in the Emerald Coast stage mod. More details on this will be added later, for know if you want to know more about this, you can ask on our Heroes Hacking Central server on Discord.
+
The Reloaded Generic Stage Injection Mod, although it has the useful features of replacing start positions and splines for any number of levels at once from your Stage.json and Splines folder (and mid-game file swapping), can't do much more than that. If you want to edit stuff such as bobsleds, Team Chaotix's mission goals, the amount of items you must collect in their missions, the amount of minutes you have for Team Sonic's Extra mission, the ranking requirements (A, B, C, D ranks) for each team, you must create your own mod DLL, and for that you must know at least the basics of programming in C# with Microsoft Visual Studio. Not only that, you can also add your own code to the game, such as the custom coded mid-level music change implemented in the Emerald Coast stage mod. More details on this will be added later, for know if you want to know more about this, you can ask on our Heroes Hacking Central server on Discord.
  
 
== Other Stuff ==
 
== 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.
+
Lighting 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 lighting). 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.
 
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]].
+
You can add all of those files to your stage mod's Files folder (or subfolders) and they will be redirected by the Mod Loader.
 
 
You can add all of those files to your root\dvdroot folder (or subfolders) and they will be replaced by the Mod Loader.
 
  
 +
{{SCHGuides}}
 
[[Category:SCHG How-tos]]
 
[[Category:SCHG How-tos]]

Latest revision as of 14:35, 7 August 2020

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)

WARNING: the text on this page is obsolete. Please check the Heroes Power Plant wiki for up-to-date modding information.

Introduction

This guide will show you how to create a custom level in Sonic Heroes. We will mainly be using Heroes Power Plant and creating a Reloaded Mod Loader compatible level mod.

First of all, you should come here and download the latest version of Heroes Power Plant (I'll just refer to it as HPP from now on). Get Magic.TXD as well, as we're gonna need that to edit TXD texture archives. For model editing, we're gonna use 3ds Max, although it's possible to use other model editors as well, 3ds Max is reccomended due to being easy to export different parts of the model to separate files (which we're gonna need to do). Reloaded Mod Loader will be used to load the levels for testing and playing ingame, and HeroesONE is optional but necessary if you're porting objects between levels.

In the PC version of Sonic Heroes, level models are multiple BSP files located inside ONE archives; their visibility data in the level's s*_blk.bin file. Both are located in the dvdroot folder. The collision model is a CL file in the dvdroot/collisions folder. HPP can handle editing of those. Textures are located in a TXD archive, which we'll edit with Magic.TXD.

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 etc. HPP can export level models and collision models in OBJ format. Magic.TXD can rip the textures.

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, Xbox or PlayStation2). However, data located in the EXE such as start positions can't be modified in those as there's no mod loader for these versions.

Setting Up a Mod

First of all, we're going to set up a mod folder for your work. Your stage is going to use the Generic Stage Injection Mod to replace start positions and splines at runtime by the Mod Loader, without need to edit the game's EXE. None of the game's original files will be replaced during this.

Notice the HPP package has a folder called Generic Stage Injection Mod. In it, there's a small readme with steps on setting up your Reloaded mod. Follow them and come back to this once you have your mod set up.

Before using HPP, noticed the readme. It explains a bit about how to use the program and I really reccomend you to read it as I'm not gonna explain here.

Open the Mod Loader Config Editor window and create a new file. In the Level Flag box, choose which level you want your custom one to replace; this is an important step as some objects will only work in the level slots they originally belonged to (such as frogs) and pinball table and bingo slide collision also only works in slots which originally had them. So once you've picked a level that suits your desires, save the file as Stage.json in your mod stage folder.

If you try your mod now, since there are no new files, all you're gonna get ingame is the original level but you'll start at the 0, 0, 0 position and there will be no splines.

Level Models

For more information, see Model Format.

I assume you already have a model of a level you want to import in 3ds Max right now.

Chunks

Chunks are the game's way of splitting a level into multiple parts, so only a some of them will show up at a time. Each chunk has a number and is made up of multiple BSP files, if your curiosity made you open one of the game's original ONEs you should have noticed that. This is how a BSP is named:

SLL_MM_NN.BSP (or STG instead of S)

LL is the level number, MM is the material setting identifier and NN is the chunk number. Check the Level List page to see your level's number (in the File Names and Data list). That will also tell you whether your files start with S or STG.

For the game to know which chunk to display at a given time, the camera must be inside boundaries set in the s*_blk.bin file, which we'll discuss soon; if the last part of the name is ommited (SLL_MM.BSP) the file will always be displayed (this is used for some levels' skyboxes).

The files also have different MM material settings. They will set how the model is rendered. They are the following:

Identifier Description
DN Sky model material
O Reflective material
OS Reflective floor material
ON Regular material
ONS Regular floor material
ONW Regular material without culling
ONWS Regular floor material without culling
P Alpha testing with reflective material
PS Alpha testing with reflective floor material
PN Alpha testing material
PNS Alpha testing floor material
PNW Alpha testing material without culling
PNWS Alpha testing floor material without culling
DA Alpha sky material
AF Alpha reflective material
AFS Alpha reflective floor material
AFN Alpha material
AFNS Alpha floor material
K Additive alpha material
KW Additive alpha material without culling
A Alpha reflective material
AS Alpha reflective floor material
AN Alpha material
ANS Alpha floor material

Importing Your Models

In 3ds Max, you should split your models into meshes so that each mesh will be converted into one BSP file. You can first split the model into multiple by chunk, then split each chunk into the different components of it: floors should be in their own mesh (ONS) as they recieve shadows and walls (ON) don't. Parts of the model with textures with alpha testing should have the PN in their name, textures with normal alpha should have the AFN in their name, the skybox will be DN, effects such as water and glow will be K and so on. You can name your meshes the same name of their BSP so you won't have trouble renaming them later. A file name for the floor models of the third chunk in Seaside Hill would be S01_ONS_03.BSP, a name for a model with alpha textures for the fourth chunk in Casino Park would be STG05_AFN_04.BSP. Note that you can use the shaders from the original stages as well (such as animated water and blue roads from the city levels). Just take a look at the texture name in the original TXD and name your texture accordingly.

There's a maximum of 65535 vertices and triangles per BSP, but each one shouldn't be even close to that (as HPP will add extra vertices to fix UV coordinates and vertex colors). Each resulting BSP shouldn't be much bigger than around 400 kb or the game will crash in the game without the TONER mod (PC mod for Reloaded Mod Loader only); if that happens, when importing, HPP will warn you of that, however with the TONER mod you can bypass this issue. If you wish to stay within these limits for console versions or if you're not using Reloaded and the TONER mod for some reason, split your files into more chunks. However please note that there is a limit of 256 chunks per stage.

Export each mesh to a separate OBJ or DAE file (remember to use Y axis = up). The model must use triangular faces, contain vertex positions and texture coordinates. Vertex normals are ignored as the game doesn't use them, and for DAE, vertex colors are supported (Heroes uses vertex colors extensively for shading and shadows on the models). Texture names will be the same ones of the textures you're using in 3ds Max. Their names cannot contain spaces. This addon for 3ds Max can automatically export each model to a separate file just as we need.

Now, import your models using HPP's Level Editor. Double-click the files to rename them if needed, then save. Take a look into your original game's dvdroot folder. If there's a s(tg)LL_h.one file for your level, then that should be your ONE file name; if there isn't, save it as s(tg)LL.one. Save it inside your mod's Files folder, don't replace any of the original files.

Since you have no visibility file set up yet, nothing will initially show up; disable the Render By Chunk checkbox in the Viewport Config (or the H shortcut key) to disable per-chunk rendering. If you did everything correctly, your models should show up in HPP.

Except they probably have no textures. HPP can display texures either from a TXD file or from a folder containing PNGs. You can choose any number of them under HPP'S Resources tab.

Visibility

For more information, see Visibility Editing.

Ingame, each chunk is rendered if the camera is inside the visibility boundaries defined in the _blk.bin file. The level editor in HPP includes a visibility editor, where you can add chunks, set the number that they refer to (there can be multiple), edit their maximums and minimums and see the chunk boundaries displayed in the viewport (disabled by default, check Chunk Boxes in the Viewport Config or press B to toggle that). The AutoChunk function will automatically calculate chunk boundaries for you with an offset. You can verify that the chunks are rendered in the proper locations by disabling Render By Chunk and checking them out in HPP. When you're happy with your visibility layout, save the file as s(tg)LL_blk.bin in your mod stages Files folder along with the ONE. From now on, when opening the ONE in the Level Editor, the visibility file will be loaded as well.

If you run your game with the mod enabled now, you'll probably be able to see the custom models, except they have no textures since we didn't add that yet. Also, you have no start position and the collision is still the original level's. It's a good idea to test it now, because if the game crashes, that probably means one of your BSP files is too big (the game doesn't crash if you have an invalid BSP or visibility file, only if it's valid but too big).

Textures

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

The TXD files for level textures are located in dvdroot/textures. You'll probably figure out by now the name of your level's. Copy the original TXD from your game to your mod's Files\textures folder and open it in Magic.TXD.

Use Edit->Add or the Insert shortcut key or just drag your new textures into the list to add them to the file. I reccomend setting each texture to have mipmaps and DXT1 compression, but you can choose any format you see fit, except for textures with alpha (you can manipulate those settings in Magic.TXD by pressing M with the texture selected; just take a look the format the original textures use and try to mimic it).

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 (some levels will crash without certain textures). Remember this file contains textures for both level and object models. If your model uses the same textures from the game that are already in the file (such as shaders) you obviously don't need to add them a second time. You should test your level again now and it should render correctly.

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 and complex items that are not supposed to be touchable. You can also add invisible geometry to it. Replace stairs with ramps. Make sure the model is as simple as possible. Split it into multiple meshes, as this division will be kept in the file. This model has a maximum size of 65535 vertices and/or triangles. Export it as OBJ and import it with HPP's Collision Editor window. Save it in the mod's root\dvdroot\collisions folder (it's named s(tg)LL.cl).

Notice there are a few settings in the collision editor: depth level, power flag and flip normals. If you're just a regular stage modder and have zero idea how Sonic Heroes internally handles collision, just leave them as they are (depth level at 5 and power flag at 0xD). If you want to, you can set the depth level to auto. This will usually result in your collision quadtree's depth level being from 8 to 10. This means the game will take less CPU to check for collisions and will run better (at a higher resolution, no framerate drops) on lower-end computers, which is your goal (you want people to play your level even if they have bad PCs) (if you set your depth level to 1 or 2, even if you have a nice PC your game will lag terribly). But custom collision files with high depth levels are known to make the game crash at random spots while running (we have no idea why) and that's why we can just leave it at 5 for now, as it won't crash and won't make your game lag unless you have a computer with terrible specs. If it works, why bother? As for the power flag, it defines a few numbers that are added to the quadtree's settings, we don't know much about what it does. Most of the original files leave it at 0xD so that's what we do.

Once your model is imported and saved, you can check Show Collision or use the X shortcut to display it. The file's quadtree can be displayed as well if Show QuadTree is checked, although there's not too much need for this except maybe for debugging purposes. If you test your model and notice collision is buggy in some parts (such as floor clipping), it's probably because some of your meshes have too many triangles. Try simplifying the mesh, and if you absolutely can't, split it into 2 or more.

Collision Flags

When creating your collision model, you must name your meshes so they represent different parts of the level. In HPP's readme, you can find a full list of flags which can be appended to the mesh name with an underscore _ to set the collision type for that mesh.

Note that the bingo and pinball types will only work in levels which originally had them. The difference between them is that you accelerate much faster and have more control on slides than tables.

If you want to experiment a bit, you can also set the flags manually. Export the collision from one of the original CL files to OBJ, import it in 3ds Max and take a look at how meshes are named. You can append the same type of formatting (_WWXXYYZZ, 4 bytes) and the flags will be that. You can play with flags that have not been documented yet with this.

sewer56lol's Collision Library

sewer56lol has worked on a tool and library for handling CL files. Its collision generator can be considered superior to HPP's for a few technical reasons. You can get the source here.

The project README contains instructions on how to operate the tool and use the library in your own programs if desired.

Death Zones and Water

CL files that have _xx or _wt appended to their names contain collision for death and water boundaries, respectively. You can import them with HPP, make sure all models have _a or _x to their names as specified above. When importing, make sure Flip Normals is checked as these files use reversed normals; they'll show up upside down and you'll have to disable culling to see them right side up. Also, make sure to set the quadtree depth level to 1 (or 2, maximum).

Objects

HPP's Layout Editor window can open and edit layout data; HPP's SET ID Table Editor can be used to change object availability for use on certain stages. Object layouts are contained in s(tg)**_p**.bin for each level and team; save them to your Files folder. Once you open a layout file in the editor, it should be pretty straightforward; just place objects wherever you want. You can click to select them, move them, rotate, set misc. settings, see a preview of them. Please read the Object Editing and Object Porting pages for all the info on this.

Start Positions and Splines

For more information, see EXE Editing.

You can set start, ending (victory animation) and bragging (for the start of multiplayer levels) positions in HPP's Mod Loader Config Editor. These will be saved to the Config.cc file. 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.

As for splines, you can import those in the Spline Editor window. It is reliant on the Config Editor to display and import splines (that's why it will only show up if you have a config file open).

When importing a new OBJ file, make sure the only thing in the file is the spline; all the program will do is read all the vertices in order and create the new spline with them. 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 (level, not program) green spheres as well). You can pick one for each spline (setting it to null will make the spline do nothing, this is useful if you want to disable it without deleting it). The splines can be seen in the view if the option is checked; remember to save.

Note that not all levels have spline loaders, meaning you can't add splines for them. These are the levels which did not contain splines originally (such as Sea Gate and Egg Hawk).

If you wish to extract and take a look at the original game's splines and start positions, Heroes Tweaker lets you open Tsonic_win.exe and do that. It can also export the splines as OBJ.

Cameras

See Camera Editing.

Particles (PTCL)

See Particle Editing.

Texture Patterns (TXC)

See Texture Animation Editing.

Indirect Info

See Indirect Editing.

Custom Mod DLL

The Reloaded Generic Stage Injection Mod, although it has the useful features of replacing start positions and splines for any number of levels at once from your Stage.json and Splines folder (and mid-game file swapping), can't do much more than that. If you want to edit stuff such as bobsleds, Team Chaotix's mission goals, the amount of items you must collect in their missions, the amount of minutes you have for Team Sonic's Extra mission, the ranking requirements (A, B, C, D ranks) for each team, you must create your own mod DLL, and for that you must know at least the basics of programming in C# with Microsoft Visual Studio. Not only that, you can also add your own code to the game, such as the custom coded mid-level music change implemented in the Emerald Coast stage mod. More details on this will be added later, for know if you want to know more about this, you can ask on our Heroes Hacking Central server on Discord.

Other Stuff

Lighting 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 lighting). 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.

You can add all of those files to your stage mod's Files folder (or subfolders) and they will be redirected by the Mod Loader.

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