[question] .xmf files

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

St4n
Posts: 90
Joined: Sat, 3. Mar 12, 15:56

[question] .xmf files

Post by St4n »

Is there currently any software allowing to edit these files or maybe a compiler which change them to as usable format?

If not, is anyone looking into this matter or do we have to wait until ES releases some tool or compiler?
User avatar
Observe
Posts: 5345
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe »

Several of us looked into this some time ago, and there are Cal3d exporters for 3DS Max - which is what ES is using. We can export .xmf mesh files, but we haven't exactly sorted out the binary encoding that ES is using. Additional information has been requested and investigation is ongoing.
St4n
Posts: 90
Joined: Sat, 3. Mar 12, 15:56

Post by St4n »

Thx, for the information. I'll wait. ;)
hhr
Posts: 61
Joined: Fri, 6. Oct 06, 15:18
x4

Post by hhr »

Observe wrote:and there are Cal3d exporters for 3DS Max - which is what ES is using.
why you think so, only because of a similar file extension??
hhr
Posts: 61
Joined: Fri, 6. Oct 06, 15:18
x4

Post by hhr »

Code: Select all

// header
char magic[4];      // = {'X', 'U', 'M', 'F'}
short version;      // 0x0003 (3) ???
short chunkOffset;  // 0x0040 (64) ???
char chunkCount;    // 2 <= N <= 11
char chunkSize;     // 0x38 | 0xBC (56 | 188)
char materialCount;
char unknown1;      // 0x88 (136)
char unknown2;      // 0x01 (1)
char unknown3;      // 0x00 (0)
int vertexCount;
int indexCount;     // (number of triangles) x 3
int unknown4;       // 0x00000004 (4)
int unknown5;       // 0 - models, 1 - collision ???
char zeros[34];      // 34 x 0x00


// chunks
// absolute offset (64)
{
    int id1;            // 0|2|3|4|6|8|30
    int part;           // 0|1|2|3|4 (++ when current.id1 == prevouis.id1) (101 - error?)
    int offset          // relative to gzipped data start
    int one1;           // 0x00000001 (1)
    int zero;           // 0x00000000 (0)
    int id2;            // 1|2|4|15|16|30|31|32
    int size;           // packed size
    int elementCount;
    int bytesPerElement;// 2|4|8|12|16|20|24|28|32|36|40|44|48|60|64
    int one2;           // 0x00000001 (1)
    char unknownData[chunkSize - 40];   // 16|148 bytes
}
// ...
// repeat (chunkCount) times


// materials
// absolute offset (64 + chunkCount * chunkSize)
if materialCount > 0 {
    {
        int indexStart;
        int indexCount;
        char materialName[128];
    }
    // ...
    // repeat (materialCount) times
}


// gzipped data
// absolute offset (64 + (chunkCount*chunkSize) + (materialCount*136))
char data[];
some examples for *-collision.xmf:

[ external image ] [ external image ] [ external image ] [ external image ] [ external image ]


known chunks:
id1=0, id2=2, bytesPerElement=12 — vertex buffer; point(float, float, float)
id1=30, id2=31, bytesPerElement=4 — index buffer; face(int, int, int)
id1=30, id2=30, bytesPerElement=2 — index buffer; face(short, short, short)
...
Last edited by hhr on Thu, 28. Nov 13, 08:48, edited 1 time in total.
balogt
Posts: 773
Joined: Thu, 18. Dec 03, 09:00
x3

Post by balogt »

any chance you have a plugin for 3dsmax made yet? doubleshadow is a wiz at that kind of thing...makes opening the files soooo much easier.
hhr
Posts: 61
Joined: Fri, 6. Oct 06, 15:18
x4

Post by hhr »

i do not use 3DS Max, thank God, there are many other free editors.

file format and the data is not yet fully understood, so about the finished product are not talking.
hhr
Posts: 61
Joined: Fri, 6. Oct 06, 15:18
x4

Post by hhr »

test converter to Wavefront OBJ - https://github.com/hhrhhr/Lua-utils-for-X-Rebirth

usage:

Code: Select all

tools\luajit.exe lua\xmf2obj.lua path_to_xmf [output_dir [output_name|dump]]
output_dir - default "."
output_name - default "out" (out.obj + out.mtl)

not all models can be converted. if instead of the "output_name" write "dump", then the script will extract the binary data (header and body) for further study.

Capital Destroyer:
[ external image ][ external image ][ external image ][ external image ][ external image ][ external image ]

Return to “X Rebirth - Scripts and Modding”