RX3 file format research thread

Wujek

Senior Squad
I need file samples (rx3 models&textures) from FIFA 12/ FIFA 13/ FIFA 15/ FIFA 16:
heads, hairs, body, balls, boots, gloves, kits, stadiums, trophies
If someone have these games, please extract/decrypt files for me.


Yes, I think it's same for all skinned meshes.


Your work is very interesting. I'm very happy when in future it will be possible to convert faces from Fifa 08 and Fifa 12/13 to my lovely Fifa 14.
I have Fifa 12. I can help you in free time. But please write me PM how and whose files you need.
 

V.K

Starting XI
Try what?
I think Pao means boot conversion.
It would indeed be awesome if we could convert fifa 20/16 boot models to fifa 14.
The boots scene for fifa 14 is struggling with the lack of models to fit the custom textures that guys are working with for 16.
 

Dmitri

Youth Team
I think Pao means boot conversion.
It would indeed be awesome if we could convert fifa 20/16 boot models to fifa 14.
The boots scene for fifa 14 is struggling with the lack of models to fit the custom textures that guys are working with for 16.
If someone will upload boots from FIFA20 PC (exported with skeleton), I could try to convert them.
 

tokke001

Senior Squad
Skeleton is present in skeleton_player.rx3 and represent skeleton hierarchy (FIFA 20-Switch).
Code:
struct Rx3SectionSkeleton {
   unsigned int totalSize; // total size of this section
   unsigned int numBones; // bone count
   unsigned int unknown1[2]; // { 0, 0 }, maybe padding
   Rx3SkeletonBoneInfo bones[numBones]; // bones table
};
Code:
struct Rx3SkeletonBoneInfo { // sizeof() = 4 bytes
   short parent; // -1 for root bone
   short firstChild; // or sibling?
};

for that short value "firstChild" :
you are sure this exist?
at the fifa 20 switch skeleton file:
when there are (for example) 251 bones,
there are only 251 short values (short "parent") present, not more i think...
 

tokke001

Senior Squad
RX3_SECTION_TEXTURES_HEADER

Code:
struct Rx3TextureHeader { // sizeof() = 16 bytes
    unsigned int totalSize; // total size of Rx3 Texture section (including texture header and pixels data)
    unsigned char type; // Rx3TextureType
    unsigned char format; // Rx3TextureFormat
    unsigned short flags; // usually 1
    unsigned short width; // image width
    unsigned short height; // image height
    unsigned short faces; // faces count for cubemap or volume textures (layers), 1 for 2D texture
    unsigned short levels; // mipmap count
};

i found out for ushort flags :
it defines if the raw image data is big-endian or little endian
some values in the raw image data are ushorts (and may need be endian swapped) :
ex. when you Read: AlfaChannel, colordata

usually the image data is always little endian (even when the rest of file is big endian), but sometimes it is big endian
i remember some older fifa games (for xbox360 console) textures looked like this (with current avaible tools) :

so for ushort flags :
1 = little endian (raw image data)
3 = big endian (raw image data)
 
Last edited:

Dmitri

Youth Team
1 = little endian (raw image data)
3 = big endian (raw image data)
Now it looks like type not flags.
i remember some older fifa games (for xbox360 console) textures looked like this (with current avaible tools) :
Normally there's no endianess when we talk about raw colors data.
The color however could be represented in different color modes - RGBA, ABGR etc.
The thing on a pic you showed looks like a pixel swizzling - a special optimization thing which is used on consoles.
 
Last edited:

V.K

Starting XI
I've checked FIFA 13 face files.
They are very similar to FIFA 14.
Files which I checked are big-endian (RX3b). I think FIFA engine can load both big/low endian (at least, FIFA 14 can).
Other than this, I saw only 2 differences:
- skeleton. There are more bones in FIFA 14 (255) than in FIFA 13 (252).
- texture mapping. Placement of ears, teeth and some other parts is different (image is taken from FIFA forum):
Would it be possible to convert full faces or at least the textures from F11-13 format to F14-21?

E.g. this Cesc Fabregas texture from F11-13, can it be converted to fit the F14 layout?




There were also some scanned faces in F11-13 that have since been removed/replaced by EA, which have so far only been available for F14 as static models without any animation using a specific bump:

 
Last edited:

frostxxx

Club Supporter
Continuing my research on FIFA04-FIFA10 .o models, I will make some notes on FIFA11-FIFA16 .rx3 files.

RX3 general file structure
The file starts with a header:
Code:
struct Rx3Header { // sizeof() = 16 bytes
    char signature[3]; // "RX3"
    char endianness; // 'b' - big-endian, 'l' - little-endian
    unsigned int version; // file version? (4)
    unsigned int fileSize; // total file size
    unsigned int sectionsCount; // number of sections
}
The header is followed with section headers:
Code:
struct Rx3SectionHeader { // sizeof() = 16 bytes
    unsigned int hash; // section name, see Rx3SectionHash
    unsigned int dataOffset; // offset in file to section data
    unsigned int dataSize; // size of data in bytes
    unsigned int unknown; // maybe padding (0)
}
Section hashes:
Code:
enum Rx3SectionHash : unsigned int { // sizeof() = 4 bytes
    RX3_SECTION_TEXTURE_BATCH = 1808827868, // "texturebatch"
    RX3_SECTION_TEXTURE = 2047566042, // "texture"
    RX3_SECTION_VERTEX_BUFFER = 5798561, // "vb"
    RX3_SECTION_INDEX_BUFFER_BATCH = 582139446, // "ibbatch"
    RX3_SECTION_INDEX_BUFFER = 5798132, // "ib"
    RX3_SECTION_BONE_REMAP = 255353250, // "boneremap"
    RX3_SECTION_ANIMATION_SKIN = 3751472158, // "animationskin"
    RX3_SECTION_EDGE_MESH = 1843792843, // "edgemesh"
    RX3_SECTION_SIMPLE_MESH = 3566041216, // "simplemesh"
    RX3_SECTION_VERTEX_FORMAT = 3263271920, // "vertexformat"
    RX3_SECTION_NAME_TABLE = 1285267122, // "nametable"
    RX3_SECTION_LOCATION = 685399266, // "location"
    RX3_SECTION_HOTSPOT = 4116388378, // "hotspot"
    RX3_SECTION_MATERIAL = 123459928, // "material"
    RX3_SECTION_COLLISION = 4185470741, // "collision"
    RX3_SECTION_COLLISION_TRIMESH = 4034198449, // "collisiontrimesh"
    RX3_SECTION_SCENE_INSTANCE = 2116321516, // "sceneinstance"
    RX3_SECTION_SCENE_LAYER = 230948820, // "scenelayer"
    RX3_SECTION_SCENE_ANIMATION = 2360999927, // "sceneanimation"
    RX3_SECTION_MORPH_INDEXED = 3247952176, // "morphindexed"
    // since FIFA 15
    RX3_SECTION_SKELETON = 1881640942, // "skeleton"
    RX3_SECTION_CLOTH_DEF = 283785394, // "clothdef"
    // since FIFA 16
    RX3_SECTION_QUAD_INDEX_BUFFER_BATCH = 341785025, // "quadibbatch"
    RX3_SECTION_QUAD_INDEX_BUFFER = 191347397, // "qib"
    RX3_SECTION_BONE_NAME = 137740398, // "bonename"
    RX3_SECTION_ADJACENCY = 899336811 // "adjacency"
};

Section data format is different for each section type.
So in general, RX3 file consists of file header, section headers and sections data.
Depending on file content (texture container/simple model/hierarchical model/skinned model), a different list of sections is presented in the file.

Texture containers
Texture containers (.rx3) usually consist of these sections:
Code:
RX3_SECTION_TEXTURES_HEADER
RX3_SECTION_TEXTURE (for each texture in container)
RX3_SECTION_NAMES
Texture containers for kits may also include RX3_SECTION_HOTSPOT section.

RX3_SECTION_TEXTURES_HEADER
This section contains a list of texture headers (basic information about texture) for each texture in the container.
Code:
struct Rx3SectionTexturesHeader { // sizeof() = 16 bytes
    unsigned int texturesCount; // number of textures in container
    unsigned int unknown[3]; // maybe padding (0)
}
This header is followed by texture headers (texture header represents basic information about texture):
Code:
struct Rx3TextureHeader { // sizeof() = 16 bytes
    unsigned int totalSize; // total size of Rx3 Texture section (including texture header and pixels data)
    unsigned char type; // Rx3TextureType
    unsigned char format; // Rx3TextureFormat
    unsigned short flags; // usually 1
    unsigned short width; // image width
    unsigned short height; // image height
    unsigned short faces; // faces count for cubemap or volume textures (layers), 1 for 2D texture
    unsigned short levels; // mipmap count
};

Known texture types:
Code:
enum Rx3TextureType : unsigned char { // sizeof() = 1 byte
    RX3_TEXTURE_2D = 1,
    RX3_TEXTURE_CUBEMAP = 3, // texture consists of 6 faces
    RX3_TEXTURE_VOLUME = 4 // texture consists of multiple layers
}

Known texture formats:
Code:
enum Rx3TextureFormat : unsigned char { // sizeof() = 1 byte
    RX3_TEXFORMAT_DXT1 = 0,
    RX3_TEXFORMAT_DXT3 = 1,
    RX3_TEXFORMAT_DXT5 = 2,
    RX3_TEXFORMAT_ATI2 = 7, // also known as BC5 compression
    RX3_TEXFORMAT_ATI1 = 12, // also known as BC4 compression
}

RX3_SECTION_TEXTURE
This section starts with texture header (Rx3TextureHeader), and continued with texture levels (mipmaps) for each texture face.
Texture level starts with a header:
Code:
struct Rx3TextureLevelHeader { // sizeof() = 16 bytes
    unsigned int pitch;
    unsigned int lines;
    unsigned int levelSize; // size of pixels data (pitch * lines)
    unsigned int padding; // 0;
};
This header is then followed by pixels data.

In general, the layout for texture section is following:
Code:
Texture header
FOR number of faces in texture
FOR number of levels in texture
Texture level header
Texture level pixels
END FOR
END FOR

RX3_SECTION_NAMES
This section contains names for some objects. In texture containers it holds texture names. In other containers it might be used for other things.
The section starts with a header:
Code:
struct Rx3SectionNamesHeader { // sizeof() = 16 bytes
    unsigned int totalSize; // total size of this section
    unsigned int namesCount; // number of names
    unsigned int unknown[2]; // maybe padding (0)
}
Then the header is followed by names.
The name starts with a header:
Code:
struct Rx3NameHeader { // sizeof() = 8 bytes
    unsigned int objectId; // ID of the object this name refers to (RX3_SECTION_TEXTURE for texture names)
    unsigned int stringDataSize; // size of name string, including null-terminator
}
The header is followed by a null-terminated name string.

RX3_SECTION_HOTSPOT
This section contains positions for placing special things on the kit - numbers, crest etc. The section starts with a header:
Code:
struct Rx3SectionHotspotHeader { // sizeof() = 16 bytes
    unsigned int totalSize; // total size of this section
    unsigned char unknown1; // 1
    unsigned char numAreas; // number of areas
    unsigned char unknown2[2]; // maybe padding (0)
    unsigned int unknown3[2]; // maybe padding (0)
}
The header is followed by each area data:
Code:
string - area name, null-terminated string
unsigned char - number of hot-spots in area
for number of hot-spots in area
    string - hot-spot name, null-terminated string
    float[4] - hot-spot rectangle

Simple models

RX3_SECTION_SIMPLE_MESH

There is a parameter inside the file which determines the primitive type (lines, tri-strips, tri-lists, etc.).
Code:
struct Rx3SectionSimpleMesh { // sizeof() = 16 bytes
    unsigned short primitiveType;
    unsigned short unknown1; // usually 0
    unsigned short unknown2; // usually 0
    unsigned short unknown3; // usually 0
    int unknown[2]; // padding (0, 0)
};
Known primitive types:
Code:
4 - TRIANGLELIST
6 - TRIANGLESTRIP

Other posts:
http://www.soccergaming.com/index.p...t-research-thread.6467750/page-2#post-6600063
http://www.soccergaming.com/index.p...t-research-thread.6467750/page-3#post-6600089
is possible to convert fifa 16 female body, faces, eyes, hair etc to fifa 14?
 

DoradoOroOro

Club Supporter
I need file samples (rx3 models&textures) from FIFA 12/ FIFA 13/ FIFA 15/ FIFA 16:
heads, hairs, body, balls, boots, gloves, kits, stadiums, trophies
If someone have these games, please extract/decrypt files for me.


Yes, I think it's same for all skinned meshes.
Hi Dmitri, do you still need samples from those games?
If you need someone, I can get it for you, I have the games :)
 

Mishuk

Youth Team
Yes that's i also checked. And blender script don't support editing or increase or decrease vertices. :(
 

Dmitri

Youth Team
A very cursory analysis of the "clothdef" section:

"clothdef" is used for cloth and hair simulation. First introduced in FIFA 15.
It's used on player clothes (jersey, shorts) and player hairs. Since FIFA 16 there's a low-resolution simulation for hairlods.

Files with this section are placed in data/sceneassets/simplecloth folder. Hair uses these files: simhair_PLAYERID_0_0.rx3

I think this section contains a physical model of the mesh, collision models, and probably some parameters of hair movement.

Some interesting information about it can be found here:
Also partially related:

On this screenshot, you can see some strange red/green/blue meshes around player head and hair. I think it's a visual representation of the data in this section.
1622281623780.png

where red meshes are collision models, green - maybe hair physical model, and green rays - maybe, connections between physical and renderable model.

I made a 010 Editor template for the file with this section, attached to this post. As I said, it's very cursory, many unknown values are there. Some names I took from the executable.

I tried to visualize an array of unknown positions (called unk72 in the template): possibly those are vertices for hair physical model.
vis_unk72.PNG
 

Attachments

  • ClothDef.zip
    1.1 KB · Views: 10


Top