Sunday, July 15, 2012

SFxT: How to Duplicate A Character - Proof of Concept

There are a lot of reasons why you might want to duplicate a character in SFxT, the most obvious (to me) being that you would like to play a team that consists of 2 copies of a single character that you are most skilled with. To accomplish this task, we need to edit a few files and make copies and rename a bunch of others, so lets get some tools together first.

As usual, you'll need piecemontee's Asset Explorer (aka SF4Viewer) and a text editor (I recommend Notepad++; regular Notepad WILL NOT WORK). You'll also probably want a bulk renaming utility, such as the aptly named Bulk Rename Utility. You should also take this opportunity to make backups of any files we plan to edit, as mistakes can render your game unplayable. Repeat: MAKE BACKUPS BEFORE TRYING ANY OF THIS.

NOTE: this is currently a proof of concept. The duplicate character will only work in training mode unless we duplicate more files, which I'll add to the post if/when I track them all down. Fights with intro animations will crash. See the bottom of the post for Robhal's update! Also, duplicating characters will corrupt your save data, so be sure to back that up first.

STEP 1 - Creating our duplicate

The first step to duplicating a character is to make a copy of the target's character folder. For this tutorial, I'll be using Ken as an example. So, navigate to [install dir]\resource\CMN\battle\chara, right-click on the desired character folder, select copy, then right-click elsewhere in the directory and choose 'paste.' You should end up with a folder named '*** - copy.'

Next, rename that folder to a non-conflicting 3-letter prefix that will represent your new character duplicate. In my case, I'm going to use 'KE2.' Note: you must use exactly 3 letters for your prefix or the game will fail to even load.

Once that's done, navigate into your new folder and open your bulk renaming utility. Select all of your files in the folder and rename all of them to match your 3-letter prefix (that is, all of the KEN* files should be renamed to KE2*), then do the same for all of the files in the 'sound' folder (these steps will be different depending on which renaming utility you use, so I'm not going to go over it here).

It should end up looking like this:

Now, we'll need to make duplicate call sounds (*_CAL_*) for each character we expect to partner our duplicate with. For the sake of simplicity, I'm only going to partner KE2 with regular ol' KEN, but if you wanted to be able to partner him/her with any other character, you would need to make calls in each potential partner's 'sound' directory. So, navigate to his folder, go into 'sound' and then make a copy of his *_CAL_KEN_E and ...J files. Rename them to match your duplicate prefex, like this:

Note: Failure to create the proper calls in each partner's sound folder will result in a game crash. (It's interesting that Capcom has these duplicate calls in the first place, suggesting that single-character teams were a possibility at some point).

Ok, with that done, we're ready to move on to step 2.

STEP 2 - Telling the game about our duplicate

SFxT keeps track of the available characters and what to think about them in the const.lua file, located in the [install dir]\resource\CMN\boot\game directory. Make a copy of the file and move it to a directory where you have write permissions, such as your desktop.

Then, open the file in your text editor and you should see a section labeled "charas" at the top of the file. Navigate down to the subsection for your duplicated character (in my case, Ken) and copy everything from his/her subsection, starting with the open-curly-braces (this thing: { ) and ending with close-curly-braces-followed-by-a-comma (this part: }, ).

Now, paste that in (right after the original is fine) and change the first line, labeled "['code']" to your duplicate's code (in my case, KE2). You can change the name here, too, but I don't think it really matters. While we're here, you can also modify anything else you want, such as vitality, "official partner," default voice, etc.

Save the file and replace the original (make a backup first, if you haven't already). Now we're ready for step 3.

STEP 3 - Creating a character select slot

SFxT determines which character slots are available through the selector_layout.emz file, located in the [install dir]\resource\CMN\ui\pre_battle directory. However, if you try to open the file directly, you'll see just a bunch of gibberish because the file is compressed. To decompress it, just open piecemontee's Asset Explorer and drag the file into the left-hand window pane. It will automatically create a backup of the original file (called selector_layout.emz.compressed) in the same directory, which is convenient. Once that is done, open the now-decompressed file in your text editor and it should look something like this:

This grid represents the character select icon grid, and we can use this file to move characters around (in case you want your favorite character to be closer to the top, for instance) or create new slots altogether by overwriting blanks (#BL). You can also remove characters by replacing them with blanks.

As you can see in the above pic, I have already replaced one of the blanks with my duplicated character abbreviation, to the left of the Random Select box. Note: Make sure you place it somewhere adjacent to an existing character or else you won't be able to move the cursor to it (i.e., the far corners are not good spots).

Once you're finished making changes, save the file and replace the original, making sure to back it up first, if you haven't already.

Now we're ready to launch our game. If all goes well, you should see a new character select slot on the character select screen (to the left of the Random box, just as we stipulated in our text file), which is treated as an entirely new character as far as double-picking is concerned:

Some Current Unknowns

First, I don't know how the game determines which character portrait goes into the character select screen, which is why our dupe has a blank box. Second, I don't know why the duped character is positioned strangely when you select him/her (my KE2 always appears hanging off the screen if I select him first for some reason).

If you figure out anything cool, please leave a comment.

Have fun, share your work and ALWAYS MAKE BACKUPS.

UPDATE - Robhal figured out the missing files to make the duplicated characters usable in vs. and story modes:

And now these my instructions below are continuation from hunterk's method above, to be able to play the duplicated character in Arcade and Versus mode.1. Go to folder "\Street Fighter X Tekken\stream\CMN\battle\chara", right-click on the desired character folder, select copy, then right-click elsewhere in the directory and choose 'paste.' You should end up with a folder named '*** - copy.' Next, rename that folder to a non-conflicting 3-letter prefix that will represent your new character duplicate. In this case, 'KE2'. Then navigate into the new folder and rename all the files (just two files) to match your 3-letter prefix (that is, all of the KEN* files should be renamed to KE2*).

2. Go to folder "\Street Fighter X Tekken\resource\CMN\ui\battle\comment\cmt", copy the desired character file (in here, KEN.cmt) and rename it to 'KE2.cmt'. OPTIONAL: You may also move the file 'KE2.cmt' to folder "\Street Fighter X Tekken\patch\CMN\ui\battle\comment\cmt" for easier maintenance.

3. Go to folder "\Street Fighter X Tekken\resource\ENG\ui\battle\comment", copy the desired character file (in here, KEN.m4s) and rename it to 'KE2.m4s'. OPTIONAL: You may also move the file 'KE2.m4s' to folder "\Street Fighter X Tekken\patch\ENG\ui\battle\comment" for easier maintenance.

4.Go to folder "\Street Fighter X Tekken\resource\ENG\ui\battle\subtitle", copy the desired character file (in here, KEN.m4s) and rename it to 'KE2.m4s'. OPTIONAL: You may also move the file 'KE2.m4s' to folder "\Street Fighter X Tekken\patch\ENG\ui\battle\subtitle" for easier maintenance.

SOME ISSUE TO NOTICED:1. In any battle, when the duplicated character use the Cross Rush (ABC Launcher), he/she still has that zoom-in camera animation.2. In battle with intro, the duplicated character has a weird subtitle. And in the winning screen, the duplicated character has a blank comment.3. You can't view the quickcombo preview, the trial, and the command list of the duplicated character, otherwise it will fall back to title screen.4. When you play the Arcade mode, make sure you pick the duplicated character as 2nd character (tag partner). The reason is if you pick the duplicated character as 1st character and when you defeat the final boss (either Akuma or Ogre), after the credit screen, it will fall back to title screen. --> (I haven't found the solution to this issue yet)

I guess i found the files for char face thumb, and name at selection screen... but all i have done was place the name and pic on the raandom idk how to do to create a new slot but here the folders

Source/CMN/ui/common/ (chara_name, chara_icon, and chara_face) open the *.emz files, inside you'll see that the name and pics are all *.DDS, but the files also have some *.GFX extensios what's must be the key to add new pic and name slots, but i wasn't able to decompress them...