Basic info about BMP, CMX and SKN files

First we have to know how a Sim is really built. As mentioned in my other guide a picture is projected on the mesh. Basically this is true but it is not as simple as it might sound. Three components are necessary to build the Sim:

  1. The BMP files
    These are BitMap images, often called the "skins". You can create skins by using a almost every graphic-editor. "Paint Shop Pro", or "Adobe Photo Shop" are just a few. There are a lot of tutorials around the Internet to get yourself skinning. Just keep one important thing in mind they must be 256 colors at all times. And the size of BMP files must be 256x256, 128x128 or 64x64 pixles large.
  2. The SKN files
    These files are the meshes. Meshes are files that give the Sim its shape. Meshes can be created with 3D programs. My first guide is describing in detail how you can create your own meshes.
  3. The CMX files
    These files are probably one of the most important files in the game. With CMX files the game decides what your Sims will look like, how they will interact with each other and what animation will be used when the Sim is making his moves. Scope of this guide is giving directions in manipulating CMX files (and SKN files) to change your Sims look.

A lot has been written about the filenames. But at this point it is better to look more closely at the files. In general bodyskins are called something like: B001FAFitdrk_SkinName.bmp

The code before the underscore "_" means that the Sim has a Body number 001of a Female Adult with a Fitbody-type and darkskintone. Variations of names are as followed (001 presents any number from 001 up to 999):

Sim
Types
Tone Fit
Bodytype
Fat
Bodytype
Skinny
Bodytype
Children
Bodytype
Heads
Female Adults Dark
Light
Medium
B001FAFitdrk
B001FAFitlgt
B001FAFitmed
B001FAFatdrk
B001FAFatlgt
B001FAFatmed
B001FASkndrk
B001FASknlgt
B001FASknmed
  C001FAdrk
C001FAlgt
C001FAmed
Male Adults Dark
Light
Medium
B001MAFitdrk
B001MAFitlgt
B001MAFitmed
B001MFAFatdrk
B001MAFatlgt
B001MAFatmed
B001MASkndrk
B001MASknlgt
B001MASknmed
  C001MAdrk
C001MAlgt
C001MAmed
Female Child Dark
Light
Medium
      B001FCChddrk
B001FCChdlgt
B001FCChdmed
C001FCdrk
C001FClgt
C001FCmed
Male Child Dark
Light
Medium
      B001FCChddrk
B001FCChdlgt
B001FCChdmed
C001MCdrk
C001MClgt
C001MCmed

We can say about these files.

  1. There are four different Sims: female adults, male adults, female children and male children.
  2. There are three different skintones: dark, light and medium
  3. There are three different adult bodytypes fit, fat and skinny
  4. There is only one children bodytype
  5. Heads are not related to bodytypes but are seperate and names start with a Cof Cranial.

The code after the underscore "_" gives the skin its name. You can decide the name yourself, in this case skin of the Sim is called "SkinName". By changing the skinname you can create other Sims with the same bodycodes. For instance: B001FAFitdrk_ AnotherSkin.bmp is a Sim with a Body number 001of a Female Adult with a Fitbody-type and darkskintone as well. This means they will use the same body only with another skin.

This is possible because of the CMX files. CMX files tell the game which meshes have to be used for which skins. In other words: The skin is connected with the mesh using the CMX file. The names of the necessary CMX files are:

Sim
Types
Fit
Bodytype
Fat
Bodytype
Skinny
Bodytype
Children
Bodytype
Heads
Female Adults B001FAFit_01.cmx B001FAFat_01.cmx B001FASkn_01.cmx   C001FA_01.cmx
Male Adults B001MAFit_01.cmx B001MAFat_01.cmx B001MASkn_01.cmx   C001MA_01.cmx
Female Child       B001FCChd_01.cmx C001FC_01.cmx
Male Child       B001FCChd_01.cmx C001MC_01.cmx

We can say about these files.

  1. Same codes apply for CMX files as for the skins. This is not surprising because only skins with matching codes can be used by the CMX file. Only skins with the same code can be loaded with the matching CMX files.
  2. Skintones are NOT part of the CMX filename. This is because the skintone is rather a color parameter than for the shape of the Sim. The reason why it is used before the underscore of the BMP file is to make sure skintones don’t mix-up.
  3. The code after the underscore "_" is an identifier and is default 01.cmx, again this can be any other name.

For instance when we have B001FAFitdrk_SkinName.bmp, B001FAFitdrk_OtherSkin.bmp and for instance the light skintone version B001FAFitlgt_OtherSkin.bmp in our Maxis\The Sims\GameData\Skins directory we only have to have one CMX file called B001FAFit_01.cmx to display them all in the game.

To know how the CMX file works to connect the right bodymesh to the skin we need to look inside the CMX file. A frequent asked question is how to open or edit the CMX files and, if the required program is available for download.

You don’t need any sophisticated programs to open CMX files, it is just an ASCII based file so any text editor will do. The simplest one is already installed on your computer try using C:\WINDOWS\NOTEPAD.EXE. We can open the CMX file by choosing Open… from the File menu, browse to the directory where your CMX file is located. Choose "All Files (*.*)" in the Files of type box and click on the file you want and click the "Open" button.

For instance if the CMX file B001FAFit_01.cmx is opened you will see something like this:

B001FAFit_01.CMX  
// Character File. Copyright 1997, Maxis Inc. File info
version 300 Version info
0 Pause
1 Number of Sims
B001FAFit_01 Name of the CMX file
0 Pause
0 Pause
1 Number of meshes
PELVIS Base bodypart of mesh
xskin-B001fafit_01-PELVIS-BODY Name of the mesh (SKN file)
0 Pause
0 Pause
0 End

In this file only the lines that give us the "Name of the CMX file", the "Number of meshes", the "Base bodypart of mesh" and the "name of the mesh (SKN file)" are of interest.

Name of the CMX file: This line contains the exact filename of the CMX file with the extension .CMX. If this line is incorrect it is likely the game will crash or the wrong skins are loaded on the mesh.
Number of meshes: This line contains the number of meshes that are needed for the Sim. Most of the times this is just one. Only it sometimes occurs additional meshes are used for spectacles, capes, or what ever object (wings are famous).
Base bodypart of mesh: This line contains the bodypart on which the mesh must be based. For all bodies this will always be PELVIS. During animations this is where the positions of the mesh will be orientated. For instance: spectacles will be based on the HEAD so it will follow the head moves during animations
Name of the mesh: This line contains the filename of the mesh (SKN file) that must be loaded for the Sim. Here the skin will be connected with the mesh.

Here we can see how the skin (BMP file) is connected with the mesh (SKN file). The skin B001FAFitdrk_SkinName.bmp can only be loaded when the CMX file B001FAFit_01.cmx is present. The CMX file tells the game to use the xskin-B001fafit_01-PELVIS-BODY.skn mesh. The mesh gives the Sim its shape while the skin is coloring it.

The SKN file is an ASCII file as well, so lets try opening this file in Notepad.exe as well. If you open xskin-B001fafit_01-PELVIS-BODY.skn you might see something like this:

Xskin-B001fafit_01-PELVIS-BODY.skn  
Xskin-B001fafit_01-PELVIS-BODY Name of the mesh
x Name of the default skin
19 Number of bodyparts
R_LEG

Bodyparts

R_LEG1
R_FOOT
R_TOE0
PELVIS
L_LEG
L_LEG1
L_FOOT
L_TOE0
SPINE
SPINE1
SPINE2
NECK
R_ARM
L_ARM
L_ARM1
R_ARM1
R_ARM2
L_ARM2
524

3D data

19 2 1
2 16 1
17 3 4
22 3 17
40 38 5
Etcetera

Let us focus on the first two rows of the file. The first row is giving us the name of the SKN, be sure this name is correct to prevent crashes of the game or wrong skins to be displayed. The second row is used for a filename of a skin. Now this is odd, because as we have seen skins are connected with the mesh by the codes given in the CMX file. TRUE!This line is added by Maxis to help the game loading its default skins in the game. In this case the B001FAFit mesh is not used for any default outfits. In that case it better to place a single x on the second row to prevent the game will look for it. How to deal with default meshes and skins will be explained in another guide.