RX3 file format research thread

Dmitri

Youth Team
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
 
Last edited:

Telega12

Reserves
Too many words. It is so easy, i am converted many faces from classic patch. You need OFW3 software for .o models(04-10)
 

Dmitri

Youth Team
I'm mainly doing this for myself. This will help me in converting FIFA 19/20 Switch resources to FIFA Manager and older FIFA versions.

It is so easy, i am converted many faces from classic patch.
How many? Which tools did you use?

You need OFW3 software for .o models(04-10)
I must say you are very optimistic. Have you ever tried to create a face in .o format?
 
Last edited:

Dmitri

Youth Team
PS
FIFA 11 files use different layout for .rx3 files.
FIFA 11 files are actually RenderWare 4 files (the engine which was used in NFS MostWanted 2012, SimCity and some other games) (\x89,R,W,4 header).
 

Telega12

Reserves
PS
FIFA 11 files use different layout for .rx3 files.
FIFA 11 files are actually RenderWare 4 files (the engine which was used in NFS MostWanted 2012, SimCity and some other games) (\x89,R,W,4 header).
for fifa 11 you must to extract cff, edit, and cff convert to obj, then obj to rx3. It would be more usefull to open model from rx2
 

Telega12

Reserves
I'm mainly doing this for myself. This will help me in converting FIFA 19/20 Switch resources to FIFA Manager and older FIFA versions.


How many? Which tools did you use?


I must say you are very optimistic. Have you ever tried to create a face in .o format?
I extract o.model, and do it for fifa 14-16 format
 

Dmitri

Youth Team
And how many faces did you make? How much time did you spend on one face?

Well, I clearly see that we are talking about different things and we use different ranging for "complexity" and "amount".
For me an "easy" is when you need to make one click with the mouse and nothing else. And "many" means thousands and tens of thousands :D
 
Last edited:

jj88

Club Supporter
interesting research, I have tried to carry a head of fifa 14 to 13 exchanging blocks with fifa file explorer, turning them into cff, obj and with hexadecimal editor without any success, in the end I gave up the curious thing is that there is a tool that converts fifa heads13 to 14 but there is nothing to do the work in reverse at the end I gave up, I can only find the modelset 12/13 to make heads with facegen but that file was lost from the network.
 

Dmitri

Youth Team
I have very limited knowledge about all these old tools (CFF, OIF, etc.) because I never used them.
I only know that they never gave a freedom in editing model files. How for example you can export/import skinned meshes if .obj files do not support skeleton and skinning at all?
If RX3 format will be completely researched I think models/textures could be easily converted between different games.
 

jj88

Club Supporter
I have very limited knowledge about all these old tools (CFF, OIF, etc.) because I never used them.
I only know that they never gave a freedom in editing model files. How for example you can export/import skinned meshes if .obj files do not support skeleton and skinning at all?
If RX3 format will be completely researched I think models/textures could be easily converted between different games.
It would be great to be able to do that, but it must be a long and painful road to get there, by the way if someone passes by and has the model set facegen csamFIFA Faces + v3.3 by du_oro10 together with the HEAD_ RX3 base could do them to me Arriving is for an oldgen console project, many facemaker used those files for their work but none worried about keeping those files.
 

*aLe

Youth Team
Where could this info help us mate?
Well, maybe it could help me find a way to have 128x256 numbers in FIFA 14 with mipmaps and DXT3 compression... At the moment I'm stuck either with 128x128 DXT3 textures with mipmaps (default FIFA 14 format) or 128x256 uncompressed textures without mipmaps (which don't look very good from afar).
I was looking for a guide to better understand the RX3 format and, well, this can come in handy (I'll probably end up throwing everything away and using 128x128 ones but hey, it's worth a try at least).
Thank you @Dmitri :)
 

Dmitri

Youth Team
@*aLe
It might be a restriction in the game code/engine.
For example, in FIFA Manager (graphics are based on FIFA09), it was always necessary to keep kitnumbers as 1024x128 texture, because the game creates a new 128x128 texture for specific number (say, 10), and then copies pixels from kitnumbers texture, one-by-one.

@all
could someone upload FIFA12/13/14/15/16 .rx3 texture/model files (from original PC version)? This will help me a lot.
 
Last edited:

pe pe

Club Supporter
Interesting thread, thanks for sharing your research. It is always great to see people disecting older games. I can help you out by uploading rx3's files, are there anything particular you are looking for? Unfortunately my bandwith can't handle uploading all games in their whole.
 

Telega12

Reserves
I have very limited knowledge about all these old tools (CFF, OIF, etc.) because I never used them.
I only know that they never gave a freedom in editing model files. How for example you can export/import skinned meshes if .obj files do not support skeleton and skinning at all?
If RX3 format will be completely researched I think models/textures could be easily converted between different games.
It is delusion. You never could convert fifa 12-13 head to fifa 14-16 format, because it is has different amount of vertices and absolutely other texture structure.
 

Dmitri

Youth Team
It is delusion. You never could convert fifa 12-13 head to fifa 14-16 format, because it is has different amount of vertices and absolutely other texture structure.
Why can't you change the amount of vertices and update texture "structure"? (whatever you meant with this)
 

Telega12

Reserves
Why can't you change the amount of vertices and update texture "structure"? (whatever you meant with this)
I saw you a nooby in this issue. It would work if head model has much more vertices than 3157, if lower - no. Do you make one head model ever?
 


Top