Important information: this site is currently scheduled to go offline indefinitely by end of the year.

XBM 360 model file

Post questions about game models here, or help out others!
Post Reply
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

XBM 360 model file

Post by JohnHudeski »

I usually don't do this but I am having a very slow brain day.
Please can anyone guide my mind into figuring out the rest of this structure
Thanks

Code: Select all

//Big Endian
struct KengoXBM
{
    struct Header
    {
        uint ID;
        uint unkn0;
        uint otherCount; //mesh? group?
        uint shapeCount;
//------------Line 2---------------
        uint unk1;
        uint unk2; //"Points" to address of first item. always 80
        uint addrs[12];
        uint addr;//Seems like a special section
        uint unkn3; //not 1
    }header;

    struct Other
    {
        char name[32];
        char data[160];
    }other[header.otherCount];

    struct Shape
    {
        char name[32];
        float matrix1[16];
        float chnk0[32]; //Vertices?
        char data[320];
    }shape[header.shapeCount];

    //Unknown chunks
    char un02[header.addrs[3]-header.addrs[2]];
    char un03[header.addrs[4]-header.addrs[3]];
    char un04[header.addrs[5]-header.addrs[4]];
    char un05[header.addrs[6]-header.addrs[5]];
    char un06[header.addrs[7]-header.addrs[6]];
    char un07[header.addrs[8]-header.addrs[7]];
    char un08[header.addrs[9]-header.addrs[8]];
    char un09[header.addrs[10]-header.addrs[9]];
    char un10[header.addrs[11]];
    char un11[header.addr-(header.addrs[11]+header.addrs[10])];
    //char un12[addrs[3]-addrs[2]];
    
    struct Unkn_str
    {
        uint one; //usually
        uint size;
        uint pad[6]; //usually zero
    }unknStr;
    char un12[unknStr.size];
    char remnants[32];
}xbm;
You do not have the required permissions to view the files attached to this post.
Last edited by JohnHudeski on Thu Dec 11, 2014 4:12 am, edited 1 time in total.
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

I have updated the structure
Thanks to all who downloaded
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

Code: Select all

//Big endian
struct KengoXBM
{
    struct Header
    {
        uint ID;
        uint unkn0;
        uint otherCount; //mesh? group?
        uint shapeCount;
//------------Line 2---------------
        uint unk1;
        uint unk2; //"Points" to address of first item. always 80
        uint addrs[12];
        uint addr;//Seems like a special section
        uint unkn3; //not 1
    }header;

    struct Other
    {
        char name[32];
        int unkn[8];
        char data[128];
    }other[header.otherCount];

    struct Shape
    {
        char name[32];
        float matrix1[16];
        float chnk0[32]; //Vertices?
        float chnk1[4];
        int chunk2[12];
        struct ShapeChunk
        {
            int i0;
            int i1;
            int i2;
            int i3;
            int i4;
            int i5; //Constant -65536
            int i6;
            int i7; //268435554, 268435746, 268435458
        }sChnk[3];
        int addr[7];
        int chunk3[33];
    }shape[header.shapeCount];

    //Unknown chunks
    char un02[header.addrs[3]-header.addrs[2]]; //This is a structure of some sort
    char un03[header.addrs[4]-header.addrs[3]]; //shape related
    //shape related
    // 0 - might be an id/int or 2 shorts
    float un04[(header.addrs[5]-header.addrs[4])/4]; 
    float un05[(header.addrs[6]-header.addrs[5])/4]; 
    float un06[(header.addrs[7]-header.addrs[6])/4];  //shape related
    float un07[(header.addrs[8]-header.addrs[7])/4];  //shape related
    float un08[(header.addrs[9]-header.addrs[8])/4];  //shape related
    float un09[(header.addrs[10]-header.addrs[9])/4];  //shape related
    char un10[header.addrs[11]];
    char un11[header.addr-(header.addrs[11]+header.addrs[10])];
    //char un12[addrs[3]-addrs[2]];
    
    struct Unkn_str //un12's header
    {
        uint one; //usually
        uint size;
        uint pad[6]; //usually zero
    }unknStr;
    char un12[unknStr.size];
    //char remnants[32];
}xbm;
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4285
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: XBM 360 model file

Post by shakotay2 »

why do u think .XBM is a model file?
For me it looks like a material file ("Xbox 360 Shader Compiler")

(while matWVPVS could be the abbreviation for "matrix World view projection" for example)
VS= VertexShader

I would search for such structures:
struct VS_OUTPUT
{
float4 Pos : POSITION;
float2 Tex : TEXCOORD0;
float3 Light : TEXCOORD1;
float3 View : TEXCOORD2;
};
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

I believe it is a large container file with model and shader
Also in the game there are only 6 file type
And I have figure out every other one
Shaders are in a different file

Code: Select all

struct Shape
    {
        char name[32];
        float matrix1[16];
        float chnk0[32]; //Bounding box??
        float chnk1[4];
        int chunk2[12];
        struct ShapeChunk
        {
            int i0;
            int i1;
            int i2;
            int i3;
            int i4;
            int i5; //Constant -65536
            int i6;
            int i7; //268435554, 268435746, 268435458
        }sChnk[3];
 
        //0 = -1s (random stuff)
        //1 = vertices floats
        //2 = Draw order? faces? shorts?
        //3 = addr in un02 header->(count,size,0,count)?
        //------------below are weird ints at the bottom of un03
        //4 =
        //5 =
        //6 =
        int addr[7];
        int chunk3[33];
    }shape[header.shapeCount];
//addr[3-6] points to what seems like vertex, normal etc.. I cant figure out size yet
Last edited by JohnHudeski on Fri Dec 12, 2014 8:03 am, edited 1 time in total.
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

Progress!?!?!

So my guess was right to an extent
As you can see from the image I was able to read the bounding box and the object itself
You do not have the required permissions to view the files attached to this post.
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

The biggest problem was making sense of the triangles
There are many duplicate vertices (uses 24 vertices where 8 would suffice)
I haven't manually rendered an object since 2009 so this is insane to me
basically there is an chunk with vertex indices (shorts) that read in 4s (quads)
0,1,2,3,-1
4,5,6,7,-1
.......,
n-3,n-2,n-1, -1

Where n is the number of vertices

This would be a nightmare for non primitive objects

I did the rendering in unity3d and I had to modify things manually cos i could not make sense of this (triangle strip?)

Anyone willing to educate me?


Sorry! I'm an idiot Just remember Line and triangle strips
You do not have the required permissions to view the files attached to this post.
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

So this is what is looks like
I the object was called Magic Box and existed in a folder called effects
I can only imagine this is the reason for so many verts that cross each other inside the mesh
I have also figure out how to automate the data reading
All I need now is u,v and normals
You do not have the required permissions to view the files attached to this post.
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

Why would a vertex weight come in x,y,z format and not just 1 floating point value per bone?
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

Got everything but UVs
You do not have the required permissions to view the files attached to this post.
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

So I think I found the UV coordinates
Basically the only file section i havent touched so far.
And to my surprise it is something unreal

I think the uv's are stored as halves or shorts or am I Nuts?
Or maybe they aren't even uvs

Only files with textures have this section with data other than 0xFFFF

Code: Select all

struct SampleUV
{
    int pad0;
    hfloat a;
    hfloat b;
} ud[number of verts];
You do not have the required permissions to view the files attached to this post.
JohnHudeski
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Mar 02, 2011 10:38 pm
Has thanked: 10 times
Been thanked: 58 times

Re: XBM 360 model file

Post by JohnHudeski »

I can't believe I am still stuck trying to figure out the UV for this game
I have Identified the data chunk but I still cannot understand how it is represented. It is really depressing
Post Reply