SF4 Modding: sensibeat's Tutorials

Transparency tutorial (editing col.emz file only)**** (Vanilla SF4)****

So, as many people are asking, and because it may be difficult to find every informations in the SF4 modding thread (31 pages already), I translated a tutorial I made some time ago on a french forum.

I used Sakura as an example.

To make transparency only using col.emz file, 2 steps are required:

  • editing the col.emz file with a hexadecimal editor
  • editing the Alpha layer of the dds where the texture is
  1. edit the col.emz file

First I use piecemontee’s SF4Explorer to identify the objects names and find them easier in the hex-editor
link: Free File Hosting Made Simple - MediaFire (you can get a newer version but this one is enough for names)

Ok… there the skirt was obviously “Skirt”, but “Hatimaki” for her hairband was quite harder to figure…

Now you know the name of the thing you want to edit, open the col.emz of your mod (not the original col.emz, the unarchived one -dat, emb, name it… I rename mine .emz just after I unarchive them to .emb with quickbms-) under a hex-editor and do a search on that name:

Now scroll down a bit to the line “BrushA”:

See those 40 characters outligned? You’ll have to edit them:

For full transparency (removing objects, holes, ripped clothes) change them by those 40:

(I’ll test on Sakura’s skirt)

For semi transparency (Rose’s pants) change them by those 40:

(I’ll test on Sakura’s hairband)

Ok, now that first step is done, save your col.emz and let’s edit that texture.

  1. edit the .dds file

Firstly what is an Alpha layer?

It’s a layer in addition to basic color layers (RGB) that will create transparency (a white layer without colors, only black & white -and shades of grey-).

You find it here in Photoshop:

If it’s here, no problem, your .dds file is in DXT5 format.
If it isn’t there, the .dds file should be in DXT1, you’ll have to add one yourself.

To know the DXT format of your .dds files I recommend downloading Windows Texture Viewer from the NVIDIA site: it shows the DXT.
link: Windows Texture Viewer

To show you the effect of semi transparency, I put a big rectangle with a gradient from white (visible) to black (invisible) on Sakura’s hairband:

(on screen: Alpha layer alone)

To show you full transparency, I draw some simple shapes on her skirt:

(on screen: RGB layers and Alpha layer displayed together: the black of the Alpha layer is shown in transparent red under this display mode in Photoshop)

Then I inject the .dds back in the col.emz file…

And here is the result:

Have fun!

Credits goes to sn00pee for all his finds on the subject.


*forgot to mention an important thing:
Full transparency works if you save in both formats, DXT1 1bit alpha or DXT5.
Semi transparency only works if you save in DXT5.

sn00pee (again) found a way to inject bigger files in .emz without crashing the game here.
(I think the guy that created Rose Ninja used that method on the coughsecond colorcough)

cmn.emz file structure** (Vanilla SF4)**

I extracted ZGF.cmn.emz in piecemontee’s SF4 AE and opened it in my hexadecimal editor:

I highlighted the references for each data, in bright colors the Relative Location and in faded color, the Length.
So the 16 characters in red are references for #EMO, the 16 in orange are references for #EMM … etc

You have to know that those values are read backwards (2 characters at a time)

In the case of #EMO, let’s look at it’s Relative Location (in bright red), we read: 60 00 00 00
It means the Relative Location is 00 00 00 60 (60)

The Rule is: Relative Location (RL) = offset of True Beginning (TB) - offset of Current Reference Location (CL)

We have RL: 60 and CL: 20
TB = RL+CL = 60+20 = 80 (easy one but for later calculations remember we’re in hexadecimal)

The True Beginning of #EMO is at offset: 80

Let’s try with #EMM:
We read: E8 8D 02 00
Meaning our RL is: 00 02 8D E8 (28DE8)
We have CL: 28
TB = 28DE8+28 = 28E10

The True Beginning of #EMM is at offset: 28E10

Now let’s take a look at our #EMO’s Length (in faded red, 1st screen), we read: 88 8D 02 00
It means the length of the file is 00 02 8D 88 (28D88)

The Rule is: Length (L) = offset of True Ending (TE) - offset of True Beginning (TB)

We have L: 28D88 and TB: 80
TE = L+TB = 28D88+80 = 28E08

The True Ending of #EMO is at offest: 28E08

The last references are the True Beginnings of the files names at the end of the cmn.emz file:

For ZGF.skl.emo we can read: 90 D0 A8 00
Meaning its True Beginning is at offset A8D090

cmn.emz file size editing tutorial**** (Vanilla SF4)****

So now we want to copy some file in our cmn.emz.

We need the Length of the file.
Calculate it or easier, just open the file in the hexadecimal editor, the last offset number is our Length.

I want to “inject” an edited HWK.fce.ema

Last offset is 7BA97 so our Length will be 97 BA 07 00

Note that it’s smaller than ZGF.fce.ema but it works the same with bigger files.

Now let’s find the ZGF.fce.ema location (search works well too but let’s use our new knowledge)
TB = 9C5C28+38 = 9C5C60
The true beginning of the #EMA is at offset 9C5C60

I select the full file

I overwrite it with the HWK.fce.ema file

I insert blanks (00) to make the next #EMA begin at the start of a line (like it was)

Now I know there are 3 files after the one I inserted (Thx to piecemontee’s AE) that were moved by my changes.
I need to check the TBs of the #EMA #BAC #BCM + the TBs of the files at the end:

#EMA TB: A41700
A41700 - 40 (CL) = A416C0 (RL)

A5B6A0 - 48 (CL) = A5B658 (RL)

#BCM TB: A826B0
A826B0 - 50 (CL) = A82660 (RL)

ZGF.skl.emo TB: A843E0
ZGF.skl.emm TB: A843EC
ZGF.obj.ema TB: A843F8
ZGF.fce.ema TB: A84404
ZGF.cam.ema TB: A84410
ZGF.bac TB: A8441C
ZGF.bcm TB: A84424

We need to enter the Length of the new fce.ema (other lengths didn’t change), and new RLs and TBs backwards:

Et voilà.

is there away to do this on hit sparks?

Tough work!
Here is a vfx.emz (an easy one: El Fuerte don’t have that many fireballs…)

As you can see there are many files to work on and SSF4 files aren’t packed in the same way at all.
Add to that I have no way of making the vfx.bvs files from SSF4 Xbox360 readable on SF4 PC (kensou’s tools don’t recognize them).
And visual effects are linked to the character’s moveset (El Fuerte has many dummy files where others have more visual effects)

Best way should be like some did already by swapping dds, but I didn’t tried that much and you have to find 2 characters that have almost the same number of moves that require an effect and animations that look alike (giving Ryu’s effects to Ken is easy).

Great Tutorial.

I saw that you were able to fix the “face melt” or “monkey face” issue when you apply a moveset to a different model than the original one - i.e. you were able to get Juri’s face to work with Gen’s moveset, etc… Can you please tell us on how you were able to do those kind of things?

Right now, the only way I can make it non-hideous is by zeroing out the face reference and making the character stonefaced through the whole match. But that’s really no fun…

Please, I’d really appreciate your help.

Yeah sorry I forgot to mention it but you need to backport the original files from Super Street Fighter IV on Xbox 360.

Here you go, I backported them with kensou’s tools and made a pack with all of them: New_Challengers.fce.ema.rar

Thanks! I’ll try the fce.ema. So… to make sure, you extracted the fce.ema files, then just overwrote them using the tool, right?

swapping objects between costumes/characters** (Vanilla SF4)**

tools used:
[]piecemonteeSF4explorerV0.37b: Download sf4viewer from SourceForge.net
]kensou’s sf4tool: MEGAUPLOAD - The leading online storage and file delivery service
[*]hexadecimal editor HxD (free): Downloads | mh-nexus

files: swap obj.rar

I) obj.emo file structure


In SF4explorerV0.37b I open the file GKI_02.cos.emz and I use the “Raw dump” option to dump the obj.emo file that I rename as GKI_02.obj.emo:


Let’s take a look at GKI_02.obj.emo in SF4explorer:


Notice there are 13 #EMG and 19 objects names.

obj.emo file references

Let’s take a look at GKI_02.obj.emo in HxD:

offset 00 to 0F:


That’s how starts your standard emo file, nothing particularly interesting there.

offset 10 to 1F:


00 0B A3 40

true offset (counting from offset 00) of the beginning of the 2nd part of the emo file

offset 20 to 21:


00 0D

number of emg (D in hexadecimal = 13 in decimal)

offset 22 to 23:


00 13

number of objects names (13 in hex = 19 in dec)

offset 24 to 27:


00 0B A2 70 (+ 20 = 00 0B A2 90)

relative offset (counting from offset 20) of the beginning of another batch of important references following the last emg

offset 28 to 5B:


every block of 8 digits is the relative offset (couting from offset 30) of an emg

00 00 00 40 + 30 = 00 00 00 70 offset of 1st emg
00 00 B0 13 + 30 = 00 00 B0 43 offset of 2nd emg
00 0A 68 D0 + 30 = 00 0A 69 00 offset of 13th emg

offset 0B A2 90: (given at offset 24)


every blocks of 8 digits is the relative offset (starting counting from 20) of the 1st letter of the readable names written just after from 00 0B A2 C4 to 00 0B A3 1F

00 0B A2 A4 + 20 = 00 0B A2 C4 e_dtooth
00 0B A2 AD + 20 = 00 0B AZ AF e_tongue
00 0B A2 F9 + 20 = 00 0B A3 19 hair_TG

offset 0B A3 40: (given at offset 10)


offset of the beginning of the second part of the emo, that I have yet to understand…

II) .emg file structure


From RYU_03.cos.emz I dump the face emg file that I rename as RYU_03.face.emg (included in swap obj.rar):


Notice that the emg is composed of 4 objects sharing 1 name.

.emg file references

Let’s take a look at RYU_03.face.emg in HxD:

offset 04 to 07:


00 01 01 43

number of this emg, former is 00 01 01 42, next is 00 01 01 44

offset 10 to 13:


00 00 02 C7

appears on every emg, may be the marker to the starting point of every later offset references

offset 14 to 15:


00 01

number of object’s name(s)

offset 1C:

00 50

no idea what those datas are

offset 20 to 21:


06 66

number of vertex (666 in hex = 1638 in dec)

offset 2E:

00 40

appears on every emg, no idea what those data are

offset 24 to 25:


00 00 39 64 (+ 10 = 39 74)

relative offset (couting from offset 10) of another part of the emg

offset 2A to 2B:


00 04

number of objects

offset 2C to 2D:


00 70 (+ 10 = 80)

relative offset (counting from offset 10) of the list of relative offsets of the objects

offset 30 to 5F:

no idea what those datas are

offset 60 to 63:


00 00 00 54 + 10 = 64

relative offset (counting from offset 10) of the 1st object’s name dds references (only one here, more references here in case of more objects)

offset 64 to 7B:


02 00 00 00 00 02 80 3F 22 00 80 3F 00 00 00 00 00 07 80 3F 22 00 80 3F

dds reference
the 1st number in red points to the texture dds
the 2nd number in red points to the normal map dds

offset 80 to 8F:


list of relative offsets (counting from 10) of the objects

00 00 00 80 + 10 = 90     1st object
00 00 20 50 + 10 = 20 60  2nd object
00 00 29 D0 + 10 = 29 E0  3rd object
00 00 38 80 + 10 = 38 90  4th object

offset 3974: (given at offset 24)


offset of the beginning of the second part of the emg, that I have yet to understand…

III) swapping bigger objects and rewriting the references (Vanilla SF4)

Let’s put Ryu’s hairs on Akuma’s (a.k.a. Gouki).


From GKI_02.obj.emo I dump and rename (included in swap obj.rar):
They’ll be used in kensou’s sf4tool to repack the file.

From RYU_03.cos.emz I dump the hair emg file that I rename as RYU_03.hair.emg (included in swap obj.rar):

Open GKI_02.obj.emo and RYU_03.hair.emg in HxD:
The hair being the last emg of GKI file, we can get the information on it’s beginning and ending from these:


offset 24 = offset of the list of offsets of names following the last emg:
00 0B A2 70 + 20 = 00 0B A2 90 so the emg finishes at 00 0B A2 8F (1 before)
offset 58 = 1st offset of last emg (hair):  00 0A 68 D0 + 30 = 00 0A 69 00

Let’s use the “Select block” option in HxD:


Now select all of the RYU file and copy/paste it over GKY’s selection:




Notice the 2 offsets that will need to be rewritten at the beginning of the file:

00 0C 01 70  -20 = 00 0C 01 50  -> backwards: 50 01 0C 00 @ offset 24
00 0C 02 20 -> backwards: 20 02 0C 00 @ offset 10

Then the 2 offsets at the beginning of the file:


So it’s good for the emo’s references.

Now let’s take a look at the emg’s references:


43 -> former emg is 42
01 -> number of the 2nd texture dds
05 -> number of the 2nd normal map dds

Save and Rename the file as GKI_01.obj.emo

Put it in a new folder with:
and only those 4 files.

Open kensou’s sf4tool and go look for your file path in the upper right, then click the left button under the big window:


Notice the files obj.emo and shd.emo are swapped.
Rewrite them in the right order (obj before shd) and click the right button:



Rename the newpack.emz into GKI_01.cos.emz and test it ingame with the GKI_01_01.col.emz provided (2nd costume 1st color file edited to be played as 1st costume):


You’ve got Akuma with Ryu’s hairs.

IV) swapping smaller objects

Swapping objects** (SSF4AE)**

[]piecemonteeSF4explorerV0.37b: http://sourceforge.net/projects/sf4viewer/files/0.37 (Console files format support - SuperSF4)/piecemonteeSF4explorerV0.37b.exe/download
]hexadecimal editor HxD (free): http://mh-nexus.de/en/downloads.php?product=HxD
I’ll swap cammy’s first costume hat with the 2nd one.

In sf4explorer I open CMY_02.obj.emo and I “raw dump” (not “extract”) the #EMG (cap_lether) (cap_line)
(I name it CMY_02.cap.emg)


I open CMY_01.obj.emo and CMY_02.cap.emg in HxD

In CMY_01.obj.emo I search for the #EMG (F3) containing the “cap”


(note the offset: 670C0)

I go to the next #EMG (F3)


I place the cursor just before that #EMG and I use the “select block” fonction (CTRL+E) using the start offset I noted (670C0):




(Note the Length: 63F0)

The #EMG selected in CMY_01.obj.emo, I now “Select All” (CTRL+A) CMY_02.cap.emg and I copy it (CTRL+C).


(Note the Length: 50C0)

I paste it (CTRL+V) over the #EMG selected in CMY_01.obj.emo




Let’s do some math in hexadecimal:

63F0 (Length of former #EMG) - 50C0 (Length of new #EMG) = 1330

1) I need to substract 1330 in the index at the start of the file for every offset of the #EMGs for every object coming after the “cap”, as the new object is smaller than the old one.

By opening CMY_01.obj.emo in sf4explorer, I can count that the cap is the 10th #EMG so I have to substract 1330 from the 11th #EMG to the last one (22th #EMG).


The index of the #EMGs starts at offset 28
From there each block of 8 digits is the offset of one #EMGs minus 30 written backwards 2 digits at a time (“little endian”):
01 23 45 69 in little endian will be 69 45 23 01 in big endian


So I’ll have to edit the 12 index entries from offset 50 (#EMG 11) to 7F (#EMG 22)
I substract 1330 to the offsets (calculating in hexadecimal and reading offsets in “big endian”):

00 06 D4 80 - 1330 = 00 06 C1 50

00 06 E4 50 - 1330 = 00 06 D1 20


00 0A F1 60 - 1330 = 00 0A DE 30

And I rewrite them backwards (“little endian”)


2) I need to substract 1330 to 2 more offsets related to the 2nd part of the obj.emo file:


00 0C A7 00 - 1330 = 00 0C 93 D0

00 0C A5 90 - 1330 = 00 0C 92 60


Let’s go to the 2nd offset (minus 20 written backwards, so 00 0C 92 60 + 20 = 00 0****C 92 80), using the goto fonction (CTRL+G):


Here’s another index I need to substract 1330 to:


From offset C9280 to C92D7, just before the first readable datas (hand_env):

00 0C A5 E8 - 1330 = 00 0C 92 B8


00 0C A6 D1 - 1330 = 00 0C 93 A1


Save and that’s it for the 1st part:


Next I’ll show how to add dds to the col.emb and nml.emb files and how to link objects in the obj.emo file to the right dds.

1) Adding dds to the col.emb (and nml.emb) files

In sf4explorer, I extract the dds for the cap from CMY_02_01.col.emb
That I name CMY_02_01.dds:


I open CMY_01.col.emb and CMY_02_01.dds in HXD


In CMY_01.col.emb, I add a line of “00” at the end of the index, here:


I change this “04” at offset 0C (former number of dds):


Into “05” (new number of dds):


And I edit the index because I moved all the offsets by 10 with my line of “00”:


I add another line of “00” at the end of the file, here:


(Note the starting offset of the new dds will be: 155850)

I “select All” (CTRL+A) CMY_02_01.dds and copy it


(Note the Length: 555F0)

I paste it at the end of the file (after the line of “00”):


Then I go back to the start of the file to enter the starting offset of the new dds minus 40 writen in “little endian”
(40 = offset where I’ll write the new index entry)
00 15 58 50 - 40 = 00 15 58 10 [COLOR=#000000](“big endian”)[/COLOR]
That gives in “little endian”:


Now I add the new dds length written in “little endian” (00 05 55 F0):


Save and do the exact same thing with the normal map dds in CMY_01.nml.emb, adding the normal map dds that contains the cap from CMY_02.nml.emb

2) Linking objects in the obj.emo file to the right dds

dds are ordered from 0 and the normal map dds follow the texture dds, so if you add 1 texture dds, every normal map dds will change number.
I have now 5 texture dds from #0 to #4
and 5 normal map dds from #5 to #9

I open CMY_01.obj.emo in HxD and do a search on “#EMG” (F3)
Each #EMG has those kind of data outlined here:


They contain the links to the dds:


The numbers in red are links to the texture dds
The numbers in green are links to the normal map dds

I have to change all the links to the normal map dds for the 22 #EMG according to the new order of the dds
(I just have to add 1 to every normal map link as we added 1 texture dds)


And edit the “cap” #EMG to link it to my 2 new dds #4 and #9:


Save and it’s over.


Changing the sizes of dds in col.emb** (SSF4AE)**

I used KEN_01_01.col.emb he has 4 dds 512x512 I’m gonna make his file accept 4 dds 1024x1024

Open your col.emb file in your hexadecimal editor ( I highlighted the index):


in red:
20 00 00 00 : offset of 1st dds minus 20 written backwards 2 digits at a time (“little endian”)
F0 55 05 00 : length of 1st dds written backwards 2 digits at a time

in blue:
18 56 05 00 : offset of 2nd dds minus 28 written backwards 2 digits at a time (“little endian”)
F0 55 05 00 : length of 2nd dds written backwards 2 digits at a time

in yellow:
10 AC 0A 00 : offset of 3rd dds minus 30 written backwards 2 digits at a time (“little endian”)
F0 55 05 00 : length of 3rd dds written backwards 2 digits at a time

in green:
08 02 10 00 : offset of 4th dds minus 38 written backwards 2 digits at a time (“little endian”)
F0 55 05 00 : length of 4th dds written backwards 2 digits at a time

Open a 1024x1024 dds in your hexadecimal editor:


Select All (CTRL+A), Copy (CTRL+C) and Paste (CTRL+V) it over the 1st dds in your col.emb file.

Just be sure to let a line of “00’s” before the next dds like this:


Rince and repeat for the 3 other dds.

Now get back at the beginning of the file and change the index.
It’s quite fast as we’re dealing with easy values so we can count in little endian:


Save and you can use that KEN_01_01.col.emb file to inject 1024x1024 edited dds with sf4explorer.

In this step for the Swapping objects** (SSF4AE) tutorial:

I’m confused which “#EMG” I’m meant to find as there are a lot in the KEN_01.obj.emo file. As I would like to try placing Ken’s Alternate 3 hair (KEN_04) into Original costume (KEN_01)

Swapping static objects with sloth86’s tools.

sloth86’s tools: http://aemods.pbworks.com/w/page/42053948/aetools#Sloth86sModelSwapTools
]OBJ2EMG.exe (latest version: http://www.mediafire.com/?p1vvruy4ycy3ejt)
piecemonteeSF4explorerV0.37b.exe: http://sf4viewer.sourceforge.net/

With this method you can only swap static objects assigned to 1 bone.

First chose a .obj you want to swap:


Chose a character and extract the full model as a .obj with sf4explorer:


You’ll have to edit the model in your 3D editor to fit the character:



¤ More infos about that part here: http://filthypants.blogspot.com/2009/08/beginners-guide-to-sf4-model-editing.html

¤ To open the .obj in 3ds max you may need to open it and save it in misfit model 3d first.

Now you have your model in place save it and open EMG2SMD.exe:


I want to swap my cap with zangief’s hairs (15th #EMG -as viewed in sf4explorer-)

Open the smd in notepad and look for the number of the bone you want to link your object to:


in that case I want to link to the “head bone”: #6.

¤ More infos on smd here: http://developer.valvesoftware.com/wiki/Studiomdl_Data

Now you can use OBJ2EMG.exe:


¤ To use a .obj from 3ds max in OBJ2EMG you may need to open it and save it in misfit model 3d first.

Then use EMGSWAP.exe:


We aren’t done yet, it needs some textures (diffusion+normal map dds):


¤ See other tutorials to add dds to your col.emb and nml.emb…

Then use DDSREFEDIT32.exe (I renamed former new.emo to ZGF_01.obj.emo before this step):


That looks OK in sf4explorer:


Let’s test in game:


I thought the bone ID# was in hexadecimal in the smb… it’s in decimal sorry for the confusion, I erased that part.
You actually need to write it in hexadecimal when you do it manually, we’ll see that in another tutorial…

edit 2: I knew I forgot something…

I didn’t linked any material features in the .emm to my “mcap”

2 ways to do it:

  1. the lazy way: edit the obj.emo in hexadecimal and change “mcap” by a material that could do the trick like “shoes” or “pants”



  1. using NanjouJ’s matedit tool, replacing an unused material (in that case “hair”) by “mcap” and the features you want to use on it.

Here’s the final result with material features added (no more weird reflections):