(Sonic Generations) Sonic Unleashed Porting Tutorials
Mar 19, 2016 3:44:29 GMT
Flash Dash and Oscar like this
Post by tuanpingas on Mar 19, 2016 3:44:29 GMT
Hello people!! In the first part of "Sonic Unleashed Porting Tutorials" series, I am going to teach you how to make a basic stage port from Sonic Unleashed to Sonic Generations. It won't be the most polished like Unleashed Project or Adventure Packs, but it should give you basic insight of how Sonic Unleashed stages look like in Sonic Generations.
Here is what you need:
- A copy of Sonic Unleashed for Xbox 360
- XBOX360 ISO Extract 0.6
- Generations Archive Editor
- QuickBMS
- HKX Converter
- SonicGLVL 0.5.7
- SonicGLVL 0.5.7 SVN (for repacking high quality GIA, a.k.a "Stage-Add.pfd", optional of course)
- Multi File Renamer (optional, but recommended)
- Notepad++ (not required, but neccessary because it can read more formats than Notepad by Microsoft).
Download links for tools:
- XBOX360 ISO Extract
- Generations Archive Editor
- QuickBMS
- HKX Converter
- SonicGLVL 0.5.7
- For SonicGLVL 0.5.7 SVN. you have to get it via TortoiseSVN. Once you have downloaded, open it, go to "Repository Browser" and paste the following code.
- Multi File Renamer
- Notepad++
You got all the tools? Great!! Let's begin! I will port Apotos Day Town for example.
STEP 1:
First, use XBOX360 ISO Extract to extract your Sonic Unleashed iso to your specified location.
Create a folder with whatever name. For porting Apotos Day Town, these files from Sonic Unleashed iso are required, and you can copy directly from your extracted Unleashed files:
Then, create 3 new folders inside your folder, naming "Original", "Ported" and "GIA". "Original" is where initially extracted files archives go, "Ported" is where modified files (to accomodate with Sonic Generations)
are stored, and "GIA" is where stage's GIA and terrains is stored (I mean Stage.pfd and Stage-Add.pfd).
Go to "Original" folder and make 2 folders named "#Act" and "Act". In "Ported" folder, do the same, plus create a 3rd folder named "Packed". Click to it, make a new folder. The name must be the same to Stage archive (e.g "ghz200" shown above). Finally go to "ghz200" folder and a new one named "Act".
STEP 2:
You should be noted that these Unleashed files shown above use propietary Xbox 360 compression, which means, to open them using Generations Archive Editor, these files must be converted to PC compression format used in Sonic Generations. I forgot to mention once you downloaded QuickBMS, the following script is required: xcompress_file.bms (I recommend saving it to quickbms folder itself). Once you have successfully converted to PC format, you will see a lot of *.ar.unpacked and *.unpacked. Simply rename *.ar.unpacked to *.ar.00 (if there are multiple archive, rename to the alphabetical order like 00, 01, 02) and *.unpacked to *.arl.
(oops, wrong folder name, should be "GIA" instead of "Packed")
STEP 3:
Open "#Town_Mykonos.ar.00" and extract to "#Act" folder from "Original" one.
Open "Town_Mykonos.ar.00" and extract to "Act" folder from "Original" one.
Now inside "#Act" folder you should see things like this:
Move all files, except XMLs to this directory (shown in directory bar, and oops, should be"ghz200" instead of "Town_Mykonos"):
The XMLs are moved to "#Act" folder in "Ported" folder.
Now move all files extracted from "Town_Mykonos.ar.00" to the same directory shown above.
Then, open "#CmnTown_Mykonos.ar.00" and extract everything to "#Act" folder in "Original" folder. Basically most of the files inside "#CmnTown_Mykonos.ar.00" are files needed for breakable objects.
***A little bit information: "myk_col_village.phy.hkx" or any hkx files containing "col" word are collision for one stage generated from Havok SDK. Since Sonic Team used an older version of the SDK for stage's collision, they need to be converted to be compatible with newer Havok format used in Sonic Generations. To do so, open HKX Converter, move the collision hkx to "source" folder, then run "convert-source-folder-and-resave-meta.bat". The converted collision is stored in "asset-cced" folder. Move the converted collision to "#Act" folder in "Ported" folder.
Open "CmnTown_Mykonos.ar.00" and extract to "Act" folder in "Original" one. Do the same with "CmnMykonos.ar.00". Generations Archive Editor will automatically extract all the rest ar.01 (or more if available), so you don't have to open and extract them manually. Finally, move all of them to the directory shown above.
Before we go to step 4, you can see in "Act" folder in "Town_Mykonos" folder has a lot of *.hkx files. These are not collision, but rather animations generated by older Havok SDK, and again need to converted to be compatible with Sonic Generations. Refer to "***" for conversion step. Then move all converted anims hkx to where it originally is (a.k.a overwrite). Do the same with all HKXs found in "#CmnTown_Mykonos.ar.00" (except collision one).
STEP 4:
We will do some XML editing, materials and models fixing. First, we are going to delete XMLs not used in Sonic Generations. Which files are unused depending on what kind of stage you are porting, may vary from Town, Entrance Field or Action Stage. For Apotos Town, these files are gonna be eliminated (marked as blue bars):
Then, open "Stage.stg.xml". See those highlighted parts?
In Sonic Generations, Sonic Team generated a new file named "Terrain.stg.xml" (which Unleashed does not have) that stores Terrain data, Light data and Sky data. You can take an existing "Terrain.stg.xml" to overwrite or make a new one yourself, then save it to where XMLs are (those params should be moved to instead of copy).
Now for the BGM params. Sonic Generations uses different Container and Name, so you have to edit to suit Generations; otherwise expect a crash. Here is the container's list:
SNG01_GHZ - Green Hill
SNG02_CPZ - Chemical Plant
SNG03_SSZ - Sky Sanctuary
SNG04_SPH - Speed Highway
SNG05_CTE - City Escape
SNG06_SSH - Seaside Hill
SNG07_CSC - Crisis City
SNG08_EUC - Rooftop Run
SNG09_PLA - Planet Wisp
Since Sonic Generations' Main Characters are Classic Sonic and his Modern self, each stage will have Name like this: "Green_Hill_Classic" or "Green_Hill_Generic". Basically these name types apply to all stages, except for Dreamcast era stages, which I recommend you to take look at Stage.stg.xml straight from these stages themselves.
Alternatively, you can copy the CSB file that plays Apotos Day Town from Sound folder from extracted Sonic Unleashed ISO to "Act" folder from "Ported" to play directly from stage's archive without the need of making a custom AAX file. After then, change "IsStream" to false.
Note: However, if you don't want BGM to play, simply change "IsStream" to false and no need to do anything else.
The next part, we are going to fix some materials and models. Open either SonicGLVL 0.5.7 or the SVN version. Open "File", choose "Fix all materials in folder" and "Fix all models in folder" to this directory (ignore error if prompted):
After you have fixed all materials and models, let's head to the next step.
STEP 5:
We will repack GIA and Terrains in this step. Open "Packed" folder from your extracted Sonic Unleashed ISO. Choose the one for Apotos Day Town:
Open the folder and copy "Stage.pfd" to "GIA" folder you made earlier. Use Generations Archive Editor to open it and extract whatever location. You should come with a bunch of AR files. These are packed using propietary Microsoft Xbox 360 compression, you need to again convert to PC format to be compatible with Sonic Generations (refer to step 2). After then you will have to rename the "*.unpacked" extension to "*.ar" using Multi File Renamer. When all converted files are renamed to "*.ar", repack all those ARs as a single PFD file (save as "Stage.pfd") using Generations Archive Editor. The PFD should be in "Town_Mykonos" folder in "Packed" folder (from "Ported" folder). Do the same with "Stage-Add.pfd" if you want high quality GIA in your mod, and it can be found in DLCs (which mean, you will have to purchase from Xbox Marketplace to get them. If you want to learn how to extract Xbox 360 DLC files, there is a tutorial from Digiex forum).
STEP 6:
It's time to repack everything in correct order. Files for repacking are in "Ported" folder. Open Generations Archive Editor, put all files from "#Act" folder into one archive and save as "#ghz200.ar.00". Do the same with "Act" folder and save as "ghz200.ar.00".
Proceed to "Act" folder inside "ghz200" folder, delete "visibilitytree.vt", repack everything and save as ghz200.ar.00 (not the same ghz200.ar.00 mentioned above). After you have done everything correctly, should be like these:
It's not done yet. Open SonicGLVL 0.5.7, open your stage by choosing #ghz200.ar.00 in "Ported" folder. When SonicGLVL asks whether to unpack the geometry and load terrain groups, answer as "Yes". Once the software has completed extracting files, it will look like this:
Finally, repack terrain geometry. Resave everything EXCEPT visibilty tree. Once the repacking has completed, copy your port from "Ported" folder to "mods" folder in your installation directory, make a "mod.ini" by yourself and delete unnecessary files during the porting. I suggest you to look at some mods to understand where files should be placed correctly.
Last but not least, take the "#SystemCommon.ar.00" from Unleashed Project to your port (in "bb" folder), extract SceneEffect.prm.xml from it, change "IgnoreFinalLightColorAdjestment" to true and replace with your modified SceneEffect. Take my "Terrain.prm.xml" here if GIA does not load here. Put it in "#ghz200.ar.00".
Does the stage run well for you? If it does, congratulations!! If it does not, check your steps. Feel free to ask anything you want in reply sections.
Note: If you want to repack high quality GIA, do the same with SonicGLVL 0.5.7. But, when it finally opened your stage, close it. Look at "cache" folder and copy/move "ghz200" folder into "cache" one in SVN version. This part will be a bit tricky. Refer to step 5 for how to extract GIA. When you have all files extracted in both Xbox 360 compression and PC compression, go to "ghz200" cache folder from SonicGLVL 0.5.7 SVN, create 3 new folders: "stage_add", "stage_add_ar" and "stage_add_cab". Copy your converted ARs to "stage_add_ar" and Xbox 360-compressed ARs (a.k.a unconverted) to "stage_add_cab". Leave the "stage_add" folder blank.
Open SonicGLVL 0.5.7 SVN, choose #ghz200.ar.00 again and repack terrain everything (with Visibility Tree unchecked). Now look at the console command. It should now state that the program is repacking HD GIA.
Here is an example video of Apotos Day Town ported to Sonic Generations:
Here is what you need:
- A copy of Sonic Unleashed for Xbox 360
- XBOX360 ISO Extract 0.6
- Generations Archive Editor
- QuickBMS
- HKX Converter
- SonicGLVL 0.5.7
- SonicGLVL 0.5.7 SVN (for repacking high quality GIA, a.k.a "Stage-Add.pfd", optional of course)
- Multi File Renamer (optional, but recommended)
- Notepad++ (not required, but neccessary because it can read more formats than Notepad by Microsoft).
Download links for tools:
- XBOX360 ISO Extract
- Generations Archive Editor
- QuickBMS
- HKX Converter
- SonicGLVL 0.5.7
- For SonicGLVL 0.5.7 SVN. you have to get it via TortoiseSVN. Once you have downloaded, open it, go to "Repository Browser" and paste the following code.
- Multi File Renamer
- Notepad++
You got all the tools? Great!! Let's begin! I will port Apotos Day Town for example.
STEP 1:
First, use XBOX360 ISO Extract to extract your Sonic Unleashed iso to your specified location.
Create a folder with whatever name. For porting Apotos Day Town, these files from Sonic Unleashed iso are required, and you can copy directly from your extracted Unleashed files:
Then, create 3 new folders inside your folder, naming "Original", "Ported" and "GIA". "Original" is where initially extracted files archives go, "Ported" is where modified files (to accomodate with Sonic Generations)
are stored, and "GIA" is where stage's GIA and terrains is stored (I mean Stage.pfd and Stage-Add.pfd).
Go to "Original" folder and make 2 folders named "#Act" and "Act". In "Ported" folder, do the same, plus create a 3rd folder named "Packed". Click to it, make a new folder. The name must be the same to Stage archive (e.g "ghz200" shown above). Finally go to "ghz200" folder and a new one named "Act".
STEP 2:
You should be noted that these Unleashed files shown above use propietary Xbox 360 compression, which means, to open them using Generations Archive Editor, these files must be converted to PC compression format used in Sonic Generations. I forgot to mention once you downloaded QuickBMS, the following script is required: xcompress_file.bms (I recommend saving it to quickbms folder itself). Once you have successfully converted to PC format, you will see a lot of *.ar.unpacked and *.unpacked. Simply rename *.ar.unpacked to *.ar.00 (if there are multiple archive, rename to the alphabetical order like 00, 01, 02) and *.unpacked to *.arl.
(oops, wrong folder name, should be "GIA" instead of "Packed")
STEP 3:
Open "#Town_Mykonos.ar.00" and extract to "#Act" folder from "Original" one.
Open "Town_Mykonos.ar.00" and extract to "Act" folder from "Original" one.
Now inside "#Act" folder you should see things like this:
Move all files, except XMLs to this directory (shown in directory bar, and oops, should be"ghz200" instead of "Town_Mykonos"):
The XMLs are moved to "#Act" folder in "Ported" folder.
Now move all files extracted from "Town_Mykonos.ar.00" to the same directory shown above.
Then, open "#CmnTown_Mykonos.ar.00" and extract everything to "#Act" folder in "Original" folder. Basically most of the files inside "#CmnTown_Mykonos.ar.00" are files needed for breakable objects.
***A little bit information: "myk_col_village.phy.hkx" or any hkx files containing "col" word are collision for one stage generated from Havok SDK. Since Sonic Team used an older version of the SDK for stage's collision, they need to be converted to be compatible with newer Havok format used in Sonic Generations. To do so, open HKX Converter, move the collision hkx to "source" folder, then run "convert-source-folder-and-resave-meta.bat". The converted collision is stored in "asset-cced" folder. Move the converted collision to "#Act" folder in "Ported" folder.
Open "CmnTown_Mykonos.ar.00" and extract to "Act" folder in "Original" one. Do the same with "CmnMykonos.ar.00". Generations Archive Editor will automatically extract all the rest ar.01 (or more if available), so you don't have to open and extract them manually. Finally, move all of them to the directory shown above.
Before we go to step 4, you can see in "Act" folder in "Town_Mykonos" folder has a lot of *.hkx files. These are not collision, but rather animations generated by older Havok SDK, and again need to converted to be compatible with Sonic Generations. Refer to "***" for conversion step. Then move all converted anims hkx to where it originally is (a.k.a overwrite). Do the same with all HKXs found in "#CmnTown_Mykonos.ar.00" (except collision one).
STEP 4:
We will do some XML editing, materials and models fixing. First, we are going to delete XMLs not used in Sonic Generations. Which files are unused depending on what kind of stage you are porting, may vary from Town, Entrance Field or Action Stage. For Apotos Town, these files are gonna be eliminated (marked as blue bars):
Then, open "Stage.stg.xml". See those highlighted parts?
In Sonic Generations, Sonic Team generated a new file named "Terrain.stg.xml" (which Unleashed does not have) that stores Terrain data, Light data and Sky data. You can take an existing "Terrain.stg.xml" to overwrite or make a new one yourself, then save it to where XMLs are (those params should be moved to instead of copy).
Now for the BGM params. Sonic Generations uses different Container and Name, so you have to edit to suit Generations; otherwise expect a crash. Here is the container's list:
SNG01_GHZ - Green Hill
SNG02_CPZ - Chemical Plant
SNG03_SSZ - Sky Sanctuary
SNG04_SPH - Speed Highway
SNG05_CTE - City Escape
SNG06_SSH - Seaside Hill
SNG07_CSC - Crisis City
SNG08_EUC - Rooftop Run
SNG09_PLA - Planet Wisp
Since Sonic Generations' Main Characters are Classic Sonic and his Modern self, each stage will have Name like this: "Green_Hill_Classic" or "Green_Hill_Generic". Basically these name types apply to all stages, except for Dreamcast era stages, which I recommend you to take look at Stage.stg.xml straight from these stages themselves.
Alternatively, you can copy the CSB file that plays Apotos Day Town from Sound folder from extracted Sonic Unleashed ISO to "Act" folder from "Ported" to play directly from stage's archive without the need of making a custom AAX file. After then, change "IsStream" to false.
Note: However, if you don't want BGM to play, simply change "IsStream" to false and no need to do anything else.
The next part, we are going to fix some materials and models. Open either SonicGLVL 0.5.7 or the SVN version. Open "File", choose "Fix all materials in folder" and "Fix all models in folder" to this directory (ignore error if prompted):
After you have fixed all materials and models, let's head to the next step.
STEP 5:
We will repack GIA and Terrains in this step. Open "Packed" folder from your extracted Sonic Unleashed ISO. Choose the one for Apotos Day Town:
Open the folder and copy "Stage.pfd" to "GIA" folder you made earlier. Use Generations Archive Editor to open it and extract whatever location. You should come with a bunch of AR files. These are packed using propietary Microsoft Xbox 360 compression, you need to again convert to PC format to be compatible with Sonic Generations (refer to step 2). After then you will have to rename the "*.unpacked" extension to "*.ar" using Multi File Renamer. When all converted files are renamed to "*.ar", repack all those ARs as a single PFD file (save as "Stage.pfd") using Generations Archive Editor. The PFD should be in "Town_Mykonos" folder in "Packed" folder (from "Ported" folder). Do the same with "Stage-Add.pfd" if you want high quality GIA in your mod, and it can be found in DLCs (which mean, you will have to purchase from Xbox Marketplace to get them. If you want to learn how to extract Xbox 360 DLC files, there is a tutorial from Digiex forum).
STEP 6:
It's time to repack everything in correct order. Files for repacking are in "Ported" folder. Open Generations Archive Editor, put all files from "#Act" folder into one archive and save as "#ghz200.ar.00". Do the same with "Act" folder and save as "ghz200.ar.00".
Proceed to "Act" folder inside "ghz200" folder, delete "visibilitytree.vt", repack everything and save as ghz200.ar.00 (not the same ghz200.ar.00 mentioned above). After you have done everything correctly, should be like these:
It's not done yet. Open SonicGLVL 0.5.7, open your stage by choosing #ghz200.ar.00 in "Ported" folder. When SonicGLVL asks whether to unpack the geometry and load terrain groups, answer as "Yes". Once the software has completed extracting files, it will look like this:
Finally, repack terrain geometry. Resave everything EXCEPT visibilty tree. Once the repacking has completed, copy your port from "Ported" folder to "mods" folder in your installation directory, make a "mod.ini" by yourself and delete unnecessary files during the porting. I suggest you to look at some mods to understand where files should be placed correctly.
Last but not least, take the "#SystemCommon.ar.00" from Unleashed Project to your port (in "bb" folder), extract SceneEffect.prm.xml from it, change "IgnoreFinalLightColorAdjestment" to true and replace with your modified SceneEffect. Take my "Terrain.prm.xml" here if GIA does not load here. Put it in "#ghz200.ar.00".
Does the stage run well for you? If it does, congratulations!! If it does not, check your steps. Feel free to ask anything you want in reply sections.
Note: If you want to repack high quality GIA, do the same with SonicGLVL 0.5.7. But, when it finally opened your stage, close it. Look at "cache" folder and copy/move "ghz200" folder into "cache" one in SVN version. This part will be a bit tricky. Refer to step 5 for how to extract GIA. When you have all files extracted in both Xbox 360 compression and PC compression, go to "ghz200" cache folder from SonicGLVL 0.5.7 SVN, create 3 new folders: "stage_add", "stage_add_ar" and "stage_add_cab". Copy your converted ARs to "stage_add_ar" and Xbox 360-compressed ARs (a.k.a unconverted) to "stage_add_cab". Leave the "stage_add" folder blank.
Open SonicGLVL 0.5.7 SVN, choose #ghz200.ar.00 again and repack terrain everything (with Visibility Tree unchecked). Now look at the console command. It should now state that the program is repacking HD GIA.
Here is an example video of Apotos Day Town ported to Sonic Generations: