Essentials Series/Porting a GameCube level to Xbox

This tutorial was written for Preview 52 of Industrial Park. Parts of this process may have changed or shortened since then.

Introduction
This tutorial will go through the process of porting a pre-existing GameCube level (ideally one you have created yourself) to be able to be played on the Xbox version of the game. The tutorial assumes you have extracted copies of the game for both of these platforms, the CXBX-Reloaded emulator, and Industrial Park.

You will need to download the blank HIP and HOP files for Xbox here.

As a final note, this tutorial is geared towards those making levels for Battle for Bikini Bottom, but in theory the process should be very similar for other games.

Getting started

 * 1) Use MagicISO to extract the files from the Xbox version of the game.
 * 2) Make a copy of the extracted Xbox files. This will be where your modded files are stored, as you will need to retain the clean copy for later.
 * 3) Copy and paste blank.HIP and blank.HOP to a level folder in your modded files. For example, my custom level has the name jf01, so I will copy blank.HIP and blank.HOP to the JF folder, and rename them to jf01.HIP and jf01.HOP.

Copying assets
(Note: It is important to keep these isolated within two separate instances of Industrial Park, as having a GameCube and an Xbox level loaded at the same time in a single instance will have unwanted effects, due to the ways these formats are stored as well as parsed by the editor.) (Note: I've found that Industrial Park will usually disallow you from pasting an asset if it is not a supported copy-and-paste type, but I would still use the wiki page as a reference as it contains the most recent and accurate information.)
 * 1) Open two instances of Industrial Park. In one of them, open the Xbox HIP and HOP files you just copied over. In the other, open the GameCube HIP and HOP files of the level you want to port.
 * 1) Hide the HOP windows for both. We will begin by copying over certain assets from the GameCube HIP over to the Xbox HIP.
 * 2) Go to the DEFAULT layer in both HIP windows, and under Assets->Type, change the dropdown to the first in the list.
 * 3) Find which assets can be copied and pasted here by looking at the "Cross-Version Copy" column of the table. I recommend sorting the column so that asset types listed as "No" will appear first.
 * 4) Copy and paste every asset from the GameCube HIP file that is not marked as "No" over to the Xbox HIP file. I do this by changing the asset type dropdown, looking to see if it is marked as "Yes" or "No," and if it is marked as "Yes," I copy every asset listed and paste them into the Xbox HIP file.
 * 1) Do the same for the HOP files. This will be a much shorter process, as many of the assets in HOP files cannot be easily copied and pasted as of writing this tutorial.
 * 2) * For ease, you can usually find copy-able assets in the MODEL and DEFAULT layers of the HOP file. Note that most models obtained from the GameCube version of the original game cannot be copied over, but models that have been imported using Industrial Park's model import (from a format such as OBJ, DAE, etc.) can be safely copied over, so it is up to you to recognize which models are safe to copy; however, as a rule of thumb, I would avoid copying models that were not custom-made.
 * 3) * Remember that only certain asset types in the DEFAULT layer can be copied over, which can be found on the aforementioned wiki page. In general, it's not a lot.
 * 4) Add a SNDI asset to the HOP file's SNDTOC layer. You can do this by right-clicking inside the asset list, and clicking Add Template -> Other -> SoundInfo.

Scavenger hunt
Now begins what is likely the most tedious part of the porting process. Eventually there will be a way to make a level with cross-platform intent from the very start (using Xbox models which are compatible with all platforms), but as of now, this is how a pre-existing level must be ported.

The general process is as follows:
 * 1) Make a list of everything the level imported from the original game (e.g. Duplicatotrons, Fodders, Wooden Tikis, etc.), whether it was from an existing level or from the Industrial Park Editor Files.
 * 2) Find a level that contains one or more of these things from the clean copy of the Xbox version of the game. For example, you can find Fodders, Ham-Mers, Duplicatotrons, Tikis, and more in JF01</tt>.
 * 3) Find the assets related to these things that you could not copy before. Generally, these are things like ATBL</tt>, MINF</tt>, MODL</tt>, RWTX</tt>, SND</tt>, etc.
 * 4) Copy those assets to the appropriate places in your level. For example, you would copy a MODL</tt> to the MODEL layer in your HOP file; you would copy an ATBL</tt> to the DEFAULT layer in your HIP file. In reality, it doesn't actually matter if these assets are in the HIP or HOP, or what layer they are on, but it helps a lot to remain organized, and to add future-proofing for any specific dealings with the assets we find out are done by the game.

Repeat steps 2-4 as necessary until you have found everything from your list.

If you have the extracted textures from the game as PNG files, you can shorten this process a small bit by going to the TEXTURE layer in your HOP file, and clicking Edit -> Import Textures, then locating all of the textures in PNG format from the level. Through doing this, you will not need to copy RWTX</tt> assets from anywhere else. This is also the only way you can add custom-made textures.

A small note to add is that you will need to import any custom-made sounds manually using WAV files. Duplicate any existing SND</tt> asset within the SRAM layer of your HOP file, click Edit Data, check the "Trim Header and send it to SNDI</tt>" box, and click Import Sound Data, then locate the WAV file. Update the asset's header to match whatever the sound was originally called in your GameCube level. The process is similar for custom music; you would do this inside mnu5.HIP, but by replacing an asset rather than duplicating any.

For custom sounds with related JAW assets, you will also want to click Import Jaw Data after importing the sound.

If you are not well-versed in which levels things appear in the original game (e.g. where the heck do I find a Bzzt-Bot?), feel free to ask in our Discord server, as many of the people there have a high level of knowledge about the game.

Remaking assets
Fortunately, this part of the process has been cut considerably as Industrial Park has updated. Here you will need to remake any custom-made assets that cannot be copied over (again, check the wiki page). This is far easier than it seems, albeit slightly tedious.

For example, let's remake this SURF</tt> asset.


 * 1) Copy a SURF</tt> from any level in the Xbox version of the original game. We're going to change its values, so it doesn't matter what you pick.
 * 2) Paste it into the DEFAULT layer into your Xbox HIP.
 * 3) Click Edit Data, and change all of the values to the ones in the original SURF</tt>.
 * 4) * In this example, I would change DamageType to 00, Sticky to 00, DamageFlags to 00, etc.
 * 5) When you are done, close the asset data editor.

You should now have every asset from the GameCube level in your Xbox level.

Testing

 * 1) Save the Xbox HIP and HOP.
 * 2) Open sb.ini</tt> in your modded files and change the BOOT scene to your level name (e.g. replace HB00</tt> with <tt>JF01</tt>).
 * 3) Open CXBX-Reloaded.
 * 4) Go to File -> Open Xbe and find the <tt>default.xbe</tt> file in the modded version of the game.
 * 5) Go to Emulation -> Start.

Your level should now load inside the emulator, and be playable with an Xbox controller.

Once you have completed this process to the number of levels to your liking, you can create an ISO using Qwix and transfer it to your modded Xbox console.

Debugging
Sometimes you will try to test a level, and it will freeze on loading, or at some other point in the level. There are multiple reasons for this.


 * CXBX-Reloaded is not an amazing emulator. Various things can cause slowdown or for the game to freeze for a couple of seconds and then continue. Issues like these will not happen on a real console.
 * This is also the reason why many models will not display in the emulator. Rest assured that these will, in fact, display on console.
 * You may have forgotten to port an asset over, or ported it from the wrong version of the game. Make sure that during the "scavenger hunt," you are only looking in levels from the clean Xbox version of the game. A good check to make is that the number of assets in your Xbox level should be the same as the number of assets in your GameCube level. If it's not, it's likely that you forgot something!
 * If you port a model from the wrong version of the game, sometimes CXBX-Reloaded will falsely allow you to load into the level, only to freeze after a little while, and since the emulator doesn't show many models, it's easy to miss what went wrong. I would go through and do a double-check of all models when this happens.
 * Make sure the level doesn't freeze in the GameCube version. I would do this before starting the porting process.

If your issue is not resolved through any of these means, feel free to ask in the Discord server, as this is a fairly new step in modding the game.

Polishing
Certain things in the original game are different depending on what version you are using. For instance, when you walk up to the clam gate at the top of Jellyfish Fields, it will read "Press the R button to enter Jellyfish Caves" on GameCube, but on Xbox it will read "Pull the R trigger to enter Jellyfish Caves." For an extra coat of polish on your level, I would make similar changes to fit the Xbox version.